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