.gitlab-ci.yml 1.57 KB
Newer Older
1 2 3
# you will find the build script
# for the image in ci/docker/Dockerfile
image: zauberstuhl/ganggo-ci:1.9-stretch
zauberstuhl's avatar
zauberstuhl committed
4 5 6 7 8 9 10 11 12
services:
- postgres:latest
variables:
  POSTGRES_DB: ganggo
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
  UPDATE_CHANNEL: alpha
stages:
- test
13
- packages
zauberstuhl's avatar
zauberstuhl committed
14
- deploy
15 16 17 18 19
cache:
  key: "ganggo-$CI_PIPELINE_ID"
  paths:
  - vendor
  - node_modules
zauberstuhl's avatar
zauberstuhl committed
20 21 22 23
before_script:
- export VERSION=$(git describe --abbrev=0 --tags)
- mkdir -p $GOPATH/src/github.com/ganggo
- ln -s $(pwd) $GOPATH/src/github.com/ganggo/ganggo
24
- if [ ! -d "vendor" ]; then make install; fi
zauberstuhl's avatar
zauberstuhl committed
25 26 27
running unit tests:
  stage: test
  script:
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
  - make test
building with GOARCH=amd64 GOOS=linux:
  stage: packages
  script:
  - export GOARCH=amd64
  - export GOOS=linux
  - make release
building with GOARCH=amd64 GOOS=windows:
  stage: packages
  script:
  - export CGO_ENABLED=1
  - export CXX=x86_64-w64-mingw32-g++
  - export CC=x86_64-w64-mingw32-gcc
  - export GOARCH=amd64
  - export GOOS=windows
  - make release
building with GOARCH=386 GOOS=windows:
  stage: packages
  script:
  - export CGO_ENABLED=1
  - export CXX=i686-w64-mingw32-g++
  - export CC=i686-w64-mingw32-gcc
  - export GOARCH=386
  - export GOOS=windows
  - make release
building with GOARCH=arm GOOS=linux GOARM=7:
  stage: packages
  script:
  - export CGO_ENABLED=1
  - export CC=arm-linux-gnueabihf-gcc
  - export GOARCH=arm
  - export GOOS=linux
  - export GOARM=7
  - make release
deploy update packages:
  stage: deploy
zauberstuhl's avatar
zauberstuhl committed
64
  artifacts:
65 66
    name: "$UPDATE_CHANNEL"
    expire_in: "1 day"
zauberstuhl's avatar
zauberstuhl committed
67
    paths:
68
    - updater.*.bin
zauberstuhl's avatar
zauberstuhl committed
69
  script:
70
  - bash -c true
71
  when: manual