mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-05 00:23:33 +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
34 lines
662 B
Bash
Executable File
34 lines
662 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set +e
|
|
|
|
usage(){
|
|
echo "Usage: builder <golang image:version> <code path> <code release tag> <main.go path> <binary name>"
|
|
echo "e.g: builder golang:1.9.2 github.com/helm/chartmuseum v0.7.1 cmd/chartmuseum chartm"
|
|
exit 1
|
|
}
|
|
|
|
if [ $# != 5 ]; then
|
|
usage
|
|
fi
|
|
|
|
GOLANG_IMAGE="$1"
|
|
CODE_PATH="$2"
|
|
CODE_VERSION="$3"
|
|
MAIN_GO_PATH="$4"
|
|
BIN_NAME="$5"
|
|
|
|
set -e
|
|
|
|
cd `dirname $0`
|
|
cur=$PWD
|
|
|
|
mkdir -p binary
|
|
rm -rf binary/$BIN_NAME || true
|
|
cp compile.sh binary/
|
|
|
|
docker run -it -v $cur/binary:/go/bin --name golang_code_builder $GOLANG_IMAGE /bin/bash /go/bin/compile.sh $CODE_PATH $CODE_VERSION $MAIN_GO_PATH $BIN_NAME
|
|
|
|
#Clear
|
|
docker rm -f golang_code_builder
|