Commit 2c4700e9 authored by Julien Schröter's avatar Julien Schröter

Pass version information to executable when CI builds the project

parent 4b8a6d55
Pipeline #1811 passed with stages
in 23 minutes and 51 seconds
......@@ -70,9 +70,9 @@ compile:
- cd $GOPATH/src/$REPO_NAME
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.akamu.de/".insteadOf "https://gitlab.akamu.de/"
- go get ./...
- GOOS=linux GOARCH=amd64 go build -tags netgo -a -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/linux
- GOOS=darwin GOARCH=amd64 go build -o $CI_PROJECT_DIR/darwin
- GOOS=windows GOARCH=amd64 go build -o $CI_PROJECT_DIR/windows.exe
- GOOS=linux GOARCH=amd64 go build -tags netgo -a -ldflags "-extldflags '-static' -X 'gitlab.akamu.de/akamu/game-server-go/version.Identifier=$(< MILESTONE)' -X 'gitlab.akamu.de/akamu/game-server-go/version.Commit=$CI_COMMIT_SHORT_SHA' -X 'gitlab.akamu.de/akamu/game-server-go/version.Environment=$CI_COMMIT_REF_NAME' -X 'gitlab.akamu.de/akamu/game-server-go/version.Pipeline=$CI_PIPELINE_ID' -X 'gitlab.akamu.de/akamu/game-server-go/version.Job=$CI_JOB_ID' -X 'gitlab.akamu.de/akamu/game-server-go/version.BuiltOn=$(date)'" -o $CI_PROJECT_DIR/linux
- GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'gitlab.akamu.de/akamu/game-server-go/version.Identifier=$(< MILESTONE)' -X 'gitlab.akamu.de/akamu/game-server-go/version.Commit=$CI_COMMIT_SHORT_SHA' -X 'gitlab.akamu.de/akamu/game-server-go/version.Environment=$CI_COMMIT_REF_NAME' -X 'gitlab.akamu.de/akamu/game-server-go/version.Pipeline=$CI_PIPELINE_ID' -X 'gitlab.akamu.de/akamu/game-server-go/version.Job=$CI_JOB_ID' -X 'gitlab.akamu.de/akamu/game-server-go/version.BuiltOn=$(date)'" -o $CI_PROJECT_DIR/darwin
- GOOS=windows GOARCH=amd64 go build -ldflags "-X 'gitlab.akamu.de/akamu/game-server-go/version.Identifier=$(< MILESTONE)' -X 'gitlab.akamu.de/akamu/game-server-go/version.Commit=$CI_COMMIT_SHORT_SHA' -X 'gitlab.akamu.de/akamu/game-server-go/version.Environment=$CI_COMMIT_REF_NAME' -X 'gitlab.akamu.de/akamu/game-server-go/version.Pipeline=$CI_PIPELINE_ID' -X 'gitlab.akamu.de/akamu/game-server-go/version.Job=$CI_JOB_ID' -X 'gitlab.akamu.de/akamu/game-server-go/version.BuiltOn=$(date)'" -o $CI_PROJECT_DIR/windows.exe
artifacts:
paths:
- linux
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment