.gitlab-ci.yml 1.85 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
services:
- postgres:latest
variables:
  POSTGRES_DB: ganggo
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
  UPDATE_CHANNEL: alpha
zauberstuhl's avatar
zauberstuhl committed
11 12 13 14 15
cache:
  key: "ganggo"
  paths:
  - vendor
  - node_modules
zauberstuhl's avatar
zauberstuhl committed
16 17
stages:
- test
zauberstuhl's avatar
zauberstuhl committed
18 19
- build
- deploy
zauberstuhl's avatar
zauberstuhl committed
20
before_script:
21
- export VERSION=$(git tag -l --sort=-v:refname |head -n1)
zauberstuhl's avatar
zauberstuhl committed
22 23
- mkdir -p $GOPATH/src/git.feneas.org/ganggo
- ln -s $(pwd) $GOPATH/src/git.feneas.org/ganggo/ganggo
zauberstuhl's avatar
zauberstuhl committed
24
- make install
zauberstuhl's avatar
zauberstuhl committed
25
run unit tests:
zauberstuhl's avatar
zauberstuhl committed
26 27
  stage: test
  script:
28
  - make test
zauberstuhl's avatar
zauberstuhl committed
29
linux:amd64:
zauberstuhl's avatar
zauberstuhl committed
30 31
  artifacts:
    expire_in: "1 day"
zauberstuhl's avatar
zauberstuhl committed
32
    paths:
zauberstuhl's avatar
zauberstuhl committed
33 34
    - updater.*.bin
  stage: build
35 36 37 38
  script:
  - export GOARCH=amd64
  - export GOOS=linux
  - make release
zauberstuhl's avatar
zauberstuhl committed
39
windows:amd64:
zauberstuhl's avatar
zauberstuhl committed
40 41
  artifacts:
    expire_in: "1 day"
zauberstuhl's avatar
zauberstuhl committed
42
    paths:
zauberstuhl's avatar
zauberstuhl committed
43 44
    - updater.*.bin
  stage: build
45 46 47 48 49 50 51
  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
52 53
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
54
windows:386:
zauberstuhl's avatar
zauberstuhl committed
55 56
  artifacts:
    expire_in: "1 day"
zauberstuhl's avatar
zauberstuhl committed
57
    paths:
zauberstuhl's avatar
zauberstuhl committed
58 59
    - updater.*.bin
  stage: build
60 61 62 63 64 65 66
  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
67 68
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
69
linux:arm:7:
zauberstuhl's avatar
zauberstuhl committed
70 71
  artifacts:
    expire_in: "1 day"
zauberstuhl's avatar
zauberstuhl committed
72
    paths:
zauberstuhl's avatar
zauberstuhl committed
73 74
    - updater.*.bin
  stage: build
75 76 77 78 79 80 81
  script:
  - export CGO_ENABLED=1
  - export CC=arm-linux-gnueabihf-gcc
  - export GOARCH=arm
  - export GOOS=linux
  - export GOARM=7
  - make release
82 83
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
84
deploy artifacts to bintray:
zauberstuhl's avatar
zauberstuhl committed
85
  # NOTE deployment only works on protected branches!
zauberstuhl's avatar
zauberstuhl committed
86
  before_script: []
zauberstuhl's avatar
zauberstuhl committed
87 88 89
  stage: deploy
  script:
  - bash ci/scripts/bintray.sh
zauberstuhl's avatar
zauberstuhl committed
90 91
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
92 93 94 95 96
  dependencies:
  - linux:amd64
  - windows:amd64
  - windows:386
  - linux:arm:7