Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leopku/00ac15765e2457a7263c8abfe89ea4c4 to your computer and use it in GitHub Desktop.
Save leopku/00ac15765e2457a7263c8abfe89ea4c4 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 ./...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment