.gitlab-ci.yml 1.76 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 21
before_script:
- export VERSION=$(git describe --abbrev=0 --tags)
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
zauberstuhl's avatar
zauberstuhl committed
52
windows:386:
zauberstuhl's avatar
zauberstuhl committed
53 54
  artifacts:
    expire_in: "1 day"
zauberstuhl's avatar
zauberstuhl committed
55
    paths:
zauberstuhl's avatar
zauberstuhl committed
56 57
    - updater.*.bin
  stage: build
58 59 60 61 62 63 64
  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
zauberstuhl's avatar
zauberstuhl committed
65
linux:arm:7:
zauberstuhl's avatar
zauberstuhl committed
66 67
  artifacts:
    expire_in: "1 day"
zauberstuhl's avatar
zauberstuhl committed
68
    paths:
zauberstuhl's avatar
zauberstuhl committed
69 70
    - updater.*.bin
  stage: build
71 72 73 74 75 76 77
  script:
  - export CGO_ENABLED=1
  - export CC=arm-linux-gnueabihf-gcc
  - export GOARCH=arm
  - export GOOS=linux
  - export GOARM=7
  - make release
zauberstuhl's avatar
zauberstuhl committed
78
deploy artifacts to bintray:
zauberstuhl's avatar
zauberstuhl committed
79
  # NOTE deployment only works on protected branches!
zauberstuhl's avatar
zauberstuhl committed
80
  before_script: []
zauberstuhl's avatar
zauberstuhl committed
81 82 83
  stage: deploy
  script:
  - bash ci/scripts/bintray.sh
zauberstuhl's avatar
zauberstuhl committed
84 85
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
86 87 88 89 90
  dependencies:
  - linux:amd64
  - windows:amd64
  - windows:386
  - linux:arm:7