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