.gitlab-ci.yml 1.77 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 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
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
build with GOARCH=amd64 GOOS=linux:
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
build with GOARCH=amd64 GOOS=windows:
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
build with GOARCH=386 GOOS=windows:
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
build with GOARCH=arm GOOS=linux GOARM=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 79 80 81 82 83 84 85 86 87
deploy artifacts to bintray:
  artifacts:
    expire_in: "1 day"
    paths:
    - updater.*.bin
  stage: deploy
  script:
  - bash ci/scripts/bintray.sh
  when: manual
  allow_failure: true