.gitlab-ci.yml 2.42 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
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
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 37 38 39 40 41 42 43 44 45 46 47
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
48
  - make test
49 50
  dependencies:
  - install
51 52
  except:
  - master
zauberstuhl's avatar
zauberstuhl committed
53
linux:amd64:
zauberstuhl's avatar
zauberstuhl committed
54
  artifacts:
55
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
56
    paths:
zauberstuhl's avatar
zauberstuhl committed
57 58
    - updater.*.bin
  stage: build
59 60 61 62
  script:
  - export GOARCH=amd64
  - export GOOS=linux
  - make release
63
  dependencies:
64
  - install
65 66
  except:
  - master
zauberstuhl's avatar
zauberstuhl committed
67
windows:amd64:
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=x86_64-w64-mingw32-g++
  - export CC=x86_64-w64-mingw32-gcc
  - export GOARCH=amd64
  - export GOOS=windows
  - make release
80
  dependencies:
81
  - install
82 83
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
84
windows:386:
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 CXX=i686-w64-mingw32-g++
  - export CC=i686-w64-mingw32-gcc
  - export GOARCH=386
  - export GOOS=windows
  - make release
97
  dependencies:
98
  - install
99 100
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
101
linux:arm:7:
zauberstuhl's avatar
zauberstuhl committed
102
  artifacts:
103
    expire_in: "1 hour"
zauberstuhl's avatar
zauberstuhl committed
104
    paths:
zauberstuhl's avatar
zauberstuhl committed
105 106
    - updater.*.bin
  stage: build
107 108 109 110 111 112 113
  script:
  - export CGO_ENABLED=1
  - export CC=arm-linux-gnueabihf-gcc
  - export GOARCH=arm
  - export GOOS=linux
  - export GOARM=7
  - make release
114
  dependencies:
115
  - install
116 117
  only:
  - /^v[\d\.]+-\w.*$/
zauberstuhl's avatar
zauberstuhl committed
118
deploy artifacts to bintray:
119 120
  before_script:
  - export VERSION=$(git tag -l --sort=-v:refname |head -n1)
zauberstuhl's avatar
zauberstuhl committed
121 122 123
  stage: deploy
  script:
  - bash ci/scripts/bintray.sh
zauberstuhl's avatar
zauberstuhl committed
124 125 126 127 128
  dependencies:
  - linux:amd64
  - windows:amd64
  - windows:386
  - linux:arm:7
129 130
  only:
  - /^v[\d\.]+-\w.*$/