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