.gitlab-ci.yml 2.11 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 11 12
services:
- postgres:latest
variables:
  POSTGRES_DB: ganggo
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
  UPDATE_CHANNEL: alpha
stages:
- test
zauberstuhl's avatar
zauberstuhl committed
13 14
- build
- deploy
zauberstuhl's avatar
zauberstuhl committed
15
before_script:
16
- export VERSION=$(git tag -l --sort=-v:refname |head -n1)
Ghost User's avatar
Ghost User committed
17
- export PROJECT_PATH=$GOPATH/src/git.feneas.org/ganggo
18 19
- mkdir -p $PROJECT_PATH bin
- rm -r $GOPATH/bin
Ghost User's avatar
Ghost User committed
20
- ln -s $(pwd) $PROJECT_PATH/ganggo
21
- ln -sf $(pwd)/bin $GOPATH/bin
Ghost User's avatar
Ghost User committed
22
- cd $PROJECT_PATH/ganggo
23 24 25 26 27 28 29
linux:test:
  artifacts:
    expire_in: "1 hour"
    paths:
    - vendor/
    - node_modules/
    - bin/
zauberstuhl's avatar
zauberstuhl committed
30 31
  stage: test
  script:
32
  - make install
33
  - make test
zauberstuhl's avatar
zauberstuhl committed
34
linux:amd64:
zauberstuhl's avatar
zauberstuhl committed
35
  artifacts:
36
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
37
    paths:
zauberstuhl's avatar
zauberstuhl committed
38 39
    - updater.*.bin
  stage: build
40 41 42 43
  script:
  - export GOARCH=amd64
  - export GOOS=linux
  - make release
44 45
  dependencies:
  - linux:test
zauberstuhl's avatar
zauberstuhl committed
46
windows:amd64:
zauberstuhl's avatar
zauberstuhl committed
47
  artifacts:
48
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
49
    paths:
zauberstuhl's avatar
zauberstuhl committed
50 51
    - updater.*.bin
  stage: build
52 53 54 55 56 57 58
  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
59 60
  dependencies:
  - linux:test
61 62
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
63
windows:386:
zauberstuhl's avatar
zauberstuhl committed
64
  artifacts:
65
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
66
    paths:
zauberstuhl's avatar
zauberstuhl committed
67 68
    - updater.*.bin
  stage: build
69 70 71 72 73 74 75
  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
76 77
  dependencies:
  - linux:test
78 79
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
80
linux:arm:7:
zauberstuhl's avatar
zauberstuhl committed
81
  artifacts:
82
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
83
    paths:
zauberstuhl's avatar
zauberstuhl committed
84 85
    - updater.*.bin
  stage: build
86 87 88 89 90 91 92
  script:
  - export CGO_ENABLED=1
  - export CC=arm-linux-gnueabihf-gcc
  - export GOARCH=arm
  - export GOOS=linux
  - export GOARM=7
  - make release
93 94
  dependencies:
  - linux:test
95 96
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
97
deploy artifacts to bintray:
98 99
  before_script:
  - export VERSION=$(git tag -l --sort=-v:refname |head -n1)
zauberstuhl's avatar
zauberstuhl committed
100 101 102
  stage: deploy
  script:
  - bash ci/scripts/bintray.sh
zauberstuhl's avatar
zauberstuhl committed
103 104 105 106 107
  dependencies:
  - linux:amd64
  - windows:amd64
  - windows:386
  - linux:arm:7
108 109
  only:
  - /^v[\d\.]+-\w.*$/