Last active
June 7, 2017 10:47
-
-
Save tsdtsdtsd/c25ce06231d36fef7b1caab86711128e to your computer and use it in GitHub Desktop.
Config for building a golang 1.8 application with glide vendoring 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.8-alpine # The alpine builds are much smaller but lack tools we need, we'll add them later | |
stages: | |
- build | |
- test | |
before_script: | |
- apk --update --upgrade add git curl-dev openssh curl ca-certificates # This is how we add system dependencies. | |
# You may need less or more packages for your app. | |
- curl -sS https://glide.sh/get | sh | |
- mkdir -p /go/src/gitlab.com/ | |
- cp -r /builds/[your-user] /go/src/gitlab.com/[your-user] | |
- cd /go/src/gitlab.com/[your-user]/[your-repo] | |
- go env # Just because the output can get helpfull | |
build-my-project: | |
stage: build | |
script: | |
- glide update # I prefer to add the `glide.lock` file to my `.gitignore`. You may prefer to skip this step if you don't. | |
- glide install | |
- go build | |
# test-my-project: | |
# stage: test | |
# script: | |
# - go test -v -cover ./... |
and/or check in your dependencies like most gophers do. since it is "only" source code it should not be too much.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are absolutely right @sorenmat. Docker is just pretty new to me, small steps ;)