.gitlab-ci.yml 1.24 KB
Newer Older
zauberstuhl's avatar
zauberstuhl committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
image: golang:1.9-stretch
services:
- postgres:latest
variables:
  POSTGRES_DB: ganggo
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
  UPDATE_CHANNEL: alpha
  BUILD_GOOS: linux
  BUILD_GOARCH: amd64
  # XXX not working yet see https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/876
  CI_PROJECT_DIR: $GOPATH/src/github.com/ganggo/ganggo
stages:
- test
- package
- deploy
before_script:
- export VERSION=$(git describe --abbrev=0 --tags)
- curl -sL https://deb.nodesource.com/setup_10.x | bash -
- apt-get install -y nodejs
# XXX remove clone workaround if CI_PROJECT_DIR is implemented
- mkdir -p $GOPATH/src/github.com/ganggo
- ln -s $(pwd) $GOPATH/src/github.com/ganggo/ganggo
# XXX end
- cd $GOPATH/src/github.com/ganggo/ganggo && make install
running unit tests:
  stage: test
  script:
  # if we define GOARCH, GOOS and GOARM directly
  # it will be resetted after calling install/script function
  # to avoid it we wrap the values in the BUILD-variables
  - GOARCH=$BUILD_GOARCH GOOS=$BUILD_GOOS GOARM=$BUILD_GOARM make test
build update package:
  stage: package
  artifacts:
36
    name: "$BUILD_GOOS-$BUILD_GOARCH-$UPDATE_CHANNEL"
zauberstuhl's avatar
zauberstuhl committed
37
    paths:
38
    - updater
zauberstuhl's avatar
zauberstuhl committed
39 40
  script:
  - GOARCH=$BUILD_GOARCH GOOS=$BUILD_GOOS GOARM=$BUILD_GOARM make release
41
  when: manual