Skip to content

Instantly share code, notes, and snippets.

@tobias-kuendig
Created October 25, 2018 04:45
Show Gist options
  • Save tobias-kuendig/8950dcc8efa11eb1845b1f0bfdee0800 to your computer and use it in GitHub Desktop.
Save tobias-kuendig/8950dcc8efa11eb1845b1f0bfdee0800 to your computer and use it in GitHub Desktop.
Simple golang build with dep on GitLab CI
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