.gitlab-ci.yml 2.89 KB
Newer Older
1 2 3
# you will find the build script for the image
# in git.feneas.org:ganggo/docker.git
image: ganggo/ganggo-ci:1.9-stretch
zauberstuhl's avatar
zauberstuhl committed
4 5
services:
- postgres:latest
6
- mysql:latest
zauberstuhl's avatar
zauberstuhl committed
7 8 9 10 11 12
variables:
  POSTGRES_DB: ganggo
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
  UPDATE_CHANNEL: alpha
stages:
13
- install
zauberstuhl's avatar
zauberstuhl committed
14
- test
zauberstuhl's avatar
zauberstuhl committed
15 16
- build
- deploy
17
- review
zauberstuhl's avatar
zauberstuhl committed
18
before_script:
19
- export VERSION=$(git tag -l --sort=-v:refname |head -n1)
Ghost User's avatar
Ghost User committed
20
- export PROJECT_PATH=$GOPATH/src/git.feneas.org/ganggo
21 22
- mkdir -p $PROJECT_PATH bin
- rm -r $GOPATH/bin
Ghost User's avatar
Ghost User committed
23
- ln -s $(pwd) $PROJECT_PATH/ganggo
24
- ln -sf $(pwd)/bin $GOPATH/bin
Ghost User's avatar
Ghost User committed
25
- cd $PROJECT_PATH/ganggo
26
install:
27 28 29 30 31 32
  artifacts:
    expire_in: "1 hour"
    paths:
    - vendor/
    - node_modules/
    - bin/
33
  stage: install
zauberstuhl's avatar
zauberstuhl committed
34
  script:
35
  - make install
36 37
  except:
  - master
38 39 40 41 42 43 44 45 46 47 48 49 50
linux:test:psql:
  stage: test
  script:
  - bash ci/scripts/change_database.sh postgres
  - make test
  dependencies:
  - install
  except:
  - master
linux:test:mysql:
  stage: test
  script:
  - bash ci/scripts/change_database.sh mysql
51
  - make test
52 53
  dependencies:
  - install
54 55
  except:
  - master
zauberstuhl's avatar
zauberstuhl committed
56
linux:amd64:
zauberstuhl's avatar
zauberstuhl committed
57
  artifacts:
58
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
59
    paths:
zauberstuhl's avatar
zauberstuhl committed
60 61
    - updater.*.bin
  stage: build
62 63 64 65
  script:
  - export GOARCH=amd64
  - export GOOS=linux
  - make release
66
  dependencies:
67
  - install
68 69
  except:
  - master
zauberstuhl's avatar
zauberstuhl committed
70
windows:amd64:
zauberstuhl's avatar
zauberstuhl committed
71
  artifacts:
72
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
73
    paths:
zauberstuhl's avatar
zauberstuhl committed
74 75
    - updater.*.bin
  stage: build
76 77 78 79 80 81 82
  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
83
  dependencies:
84
  - install
85 86
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
87
windows:386:
zauberstuhl's avatar
zauberstuhl committed
88
  artifacts:
89
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
90
    paths:
zauberstuhl's avatar
zauberstuhl committed
91 92
    - updater.*.bin
  stage: build
93 94 95 96 97 98 99
  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
100
  dependencies:
101
  - install
102 103
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
104
linux:arm:7:
zauberstuhl's avatar
zauberstuhl committed
105
  artifacts:
106
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
107
    paths:
zauberstuhl's avatar
zauberstuhl committed
108 109
    - updater.*.bin
  stage: build
110 111 112 113 114 115 116
  script:
  - export CGO_ENABLED=1
  - export CC=arm-linux-gnueabihf-gcc
  - export GOARCH=arm
  - export GOOS=linux
  - export GOARM=7
  - make release
117
  dependencies:
118
  - install
119 120
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
121
deploy artifacts to bintray:
122 123
  before_script:
  - export VERSION=$(git tag -l --sort=-v:refname |head -n1)
zauberstuhl's avatar
zauberstuhl committed
124 125 126
  stage: deploy
  script:
  - bash ci/scripts/bintray.sh
zauberstuhl's avatar
zauberstuhl committed
127 128 129 130 131
  dependencies:
  - linux:amd64
  - windows:amd64
  - windows:386
  - linux:arm:7
132 133
  only:
  - /^v[\d\.]+-\w.*$/
134 135 136 137 138 139 140 141 142 143 144 145
trigger other pipelines:
  before_script:
  - export VERSION=$(git tag -l --sort=-v:refname |head -n1)
  stage: review
  script:
  # ID 99 https://git.feneas.org/ganggo/docker
  - curl -X POST -F "token=$CI_JOB_TOKEN" -F "ref=master" -F "variables[GVERSION]=$VERSION" https://git.feneas.org/api/v4/projects/99/trigger/pipeline
  # XXX trigger updating documentation
  dependencies:
  - deploy artifacts to bintray
  only:
  - /^v[\d\.]+-\w.*$/