Created
October 25, 2018 04:45
-
-
Save tobias-kuendig/8950dcc8efa11eb1845b1f0bfdee0800 to your computer and use it in GitHub Desktop.
Simple golang build with dep on GitLab CI
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
image: golang:1.10 | |
variables: | |
CI_SERVER_HOSTNAME: gitlab.com | |
# CI_SERVER_HOSTNAME: gitlab.selfhosted.tld | |
cache: | |
paths: | |
- ${CI_PROJECT_DIR}/vendor | |
before_script: | |
- go get -u github.com/golang/dep/cmd/dep | |
- mkdir -p /go/src/${CI_SERVER_HOSTNAME}/${CI_PROJECT_NAMESPACE} | |
- ln -s ${CI_PROJECT_DIR} /go/src/${CI_SERVER_HOSTNAME}/${CI_PROJECT_PATH} | |
- cd /go/src/${CI_SERVER_HOSTNAME}/${CI_PROJECT_PATH} | |
- dep ensure | |
build: | |
stage: build | |
artifacts: | |
expire_in: 10min | |
paths: | |
- server | |
script: | |
- go build -o server cmd/server/main.go | |
- ls -lah /go/src/github.com/golang/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment