-
-
Save cute-angelia/ffd4410d0e7af9971bf839375cb9bfbf to your computer and use it in GitHub Desktop.
Jenkins build setup for Go Projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You need install jenkins go plugin first -> https://wiki.jenkins.io/display/JENKINS/Go+Plugin | |
#!/usr/bin/bash | |
pwd | |
export GOPROXY=https://goproxy.io | |
cd ./ && make proto | |
export GOROOT=/usr/local/go | |
export GOPATH=$WORKSPACE | |
mkdir -p $GOPATH/src | |
project_name=$(echo $GIT_URL | awk -F/ '{print $NF}' | sed 's/.git//g') | |
echo ${project_name} | |
ln -f -s $WORKSPACE $GOPATH/src/$project_name | |
## only edit svr-class => want | |
cd $GOPATH/src/$project_name/svr/svr-class && go mod vendor && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment