Skip to content

Instantly share code, notes, and snippets.

@tsdtsdtsd
Last active June 7, 2017 10:47
Show Gist options
  • Save tsdtsdtsd/c25ce06231d36fef7b1caab86711128e to your computer and use it in GitHub Desktop.
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
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 ./...
@tsdtsdtsd
Copy link
Author

You are absolutely right @sorenmat. Docker is just pretty new to me, small steps ;)

@advincze
Copy link

advincze commented Apr 2, 2017

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