mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-18 16:25:16 +01:00
22ea7dd91f
add env file template for chart repo server in make/common/config/chartserver update the Makefiles to support build chart repo server add docker file and related build scripts for upstream chart server - chartmuseum update prepare to support generating chart server related configs add docker compose file for the chart server add build/install command options to install with/without chart repo server update install.sh to support chart repo server installation
35 lines
698 B
Bash
35 lines
698 B
Bash
#!/bin/bash
|
|
set +e
|
|
|
|
usage(){
|
|
echo "Usage: compile.sh <code path> <code tag> <main.go path> <binary name>"
|
|
echo "e.g: compile.sh github.com/helm/chartmuseum v0.5.1 cmd/chartmuseum chartm"
|
|
exit 1
|
|
}
|
|
|
|
if [ $# != 4 ]; then
|
|
usage
|
|
fi
|
|
|
|
CODE_PATH="$1"
|
|
VERSION="$2"
|
|
MAIN_GO_PATH="$3"
|
|
BIN_NAME="$4"
|
|
|
|
#Get the source code of chartmusem
|
|
go get $CODE_PATH
|
|
|
|
set -e
|
|
|
|
#Checkout the released tag branch
|
|
cd /go/src/$CODE_PATH
|
|
git checkout tags/$VERSION -b $VERSION
|
|
|
|
#Install the go dep tool to restore the package dependencies
|
|
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
dep ensure
|
|
|
|
#Compile
|
|
cd /go/src/$CODE_PATH/$MAIN_GO_PATH && go build -a -o $BIN_NAME
|
|
mv $BIN_NAME /go/bin/
|