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