.gitlab-ci.yml 2.13 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
34 35
  except:
  - master
zauberstuhl's avatar
zauberstuhl committed
36
linux:amd64:
zauberstuhl's avatar
zauberstuhl committed
37
  artifacts:
38
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
39
    paths:
zauberstuhl's avatar
zauberstuhl committed
40 41
    - updater.*.bin
  stage: build
42 43 44 45
  script:
  - export GOARCH=amd64
  - export GOOS=linux
  - make release
46 47
  dependencies:
  - linux:test
zauberstuhl's avatar
zauberstuhl committed
48
windows:amd64:
zauberstuhl's avatar
zauberstuhl committed
49
  artifacts:
50
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
51
    paths:
zauberstuhl's avatar
zauberstuhl committed
52 53
    - updater.*.bin
  stage: build
54 55 56 57 58 59 60
  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
61 62
  dependencies:
  - linux:test
63 64
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
65
windows:386:
zauberstuhl's avatar
zauberstuhl committed
66
  artifacts:
67
    expire_in: "1 hour"
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 CXX=i686-w64-mingw32-g++
  - export CC=i686-w64-mingw32-gcc
  - export GOARCH=386
  - export GOOS=windows
  - make release
78 79
  dependencies:
  - linux:test
80 81
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
82
linux:arm:7:
zauberstuhl's avatar
zauberstuhl committed
83
  artifacts:
84
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
85
    paths:
zauberstuhl's avatar
zauberstuhl committed
86 87
    - updater.*.bin
  stage: build
88 89 90 91 92 93 94
  script:
  - export CGO_ENABLED=1
  - export CC=arm-linux-gnueabihf-gcc
  - export GOARCH=arm
  - export GOOS=linux
  - export GOARM=7
  - make release
95 96
  dependencies:
  - linux:test
97 98
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
99
deploy artifacts to bintray:
100 101
  before_script:
  - export VERSION=$(git tag -l --sort=-v:refname |head -n1)
zauberstuhl's avatar
zauberstuhl committed
102 103 104
  stage: deploy
  script:
  - bash ci/scripts/bintray.sh
zauberstuhl's avatar
zauberstuhl committed
105 106 107 108 109
  dependencies:
  - linux:amd64
  - windows:amd64
  - windows:386
  - linux:arm:7
110 111
  only:
  - /^v[\d\.]+-\w.*$/