.gitlab-ci.yml 2 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
services:
- postgres:latest
variables:
  POSTGRES_DB: ganggo
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: ""
  UPDATE_CHANNEL: alpha
stages:
zauberstuhl's avatar
zauberstuhl committed
12
- dependency
zauberstuhl's avatar
zauberstuhl committed
13
- test
zauberstuhl's avatar
zauberstuhl committed
14 15 16 17
- package
artifacts:
  name: "$UPDATE_CHANNEL"
  expire_in: "1 day"
18
  paths:
zauberstuhl's avatar
zauberstuhl committed
19
  - updater.*.bin
zauberstuhl's avatar
zauberstuhl committed
20 21 22 23
before_script:
- export VERSION=$(git describe --abbrev=0 --tags)
- mkdir -p $GOPATH/src/github.com/ganggo
- ln -s $(pwd) $GOPATH/src/github.com/ganggo/ganggo
zauberstuhl's avatar
zauberstuhl committed
24 25 26 27 28 29 30 31 32 33
install dependencies:
  stage: dependency
  cache:
    key: "ganggo-$CI_PIPELINE_ID"
    paths:
    - vendor
    - node_modules
  script:
  - make install
run unit tests:
zauberstuhl's avatar
zauberstuhl committed
34
  stage: test
zauberstuhl's avatar
zauberstuhl committed
35 36 37 38 39 40
  cache:
    key: "ganggo-$CI_PIPELINE_ID"
    paths:
    - vendor
    - node_modules
    policy: pull
zauberstuhl's avatar
zauberstuhl committed
41
  script:
42
  - make test
zauberstuhl's avatar
zauberstuhl committed
43 44 45 46 47 48 49 50
build with GOARCH=amd64 GOOS=linux:
  stage: package
  cache:
    key: "ganggo-$CI_PIPELINE_ID"
    paths:
    - vendor
    - node_modules
    policy: pull
51 52 53 54
  script:
  - export GOARCH=amd64
  - export GOOS=linux
  - make release
zauberstuhl's avatar
zauberstuhl committed
55 56 57 58 59 60 61 62
build with GOARCH=amd64 GOOS=windows:
  stage: package
  cache:
    key: "ganggo-$CI_PIPELINE_ID"
    paths:
    - vendor
    - node_modules
    policy: pull
63 64 65 66 67 68 69
  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
zauberstuhl's avatar
zauberstuhl committed
70 71 72 73 74 75 76 77
build with GOARCH=386 GOOS=windows:
  stage: package
  cache:
    key: "ganggo-$CI_PIPELINE_ID"
    paths:
    - vendor
    - node_modules
    policy: pull
78 79 80 81 82 83 84
  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
zauberstuhl's avatar
zauberstuhl committed
85 86 87 88 89 90 91 92
build with GOARCH=arm GOOS=linux GOARM=7:
  stage: package
  cache:
    key: "ganggo-$CI_PIPELINE_ID"
    paths:
    - vendor
    - node_modules
    policy: pull
93 94 95 96 97 98 99
  script:
  - export CGO_ENABLED=1
  - export CC=arm-linux-gnueabihf-gcc
  - export GOARCH=arm
  - export GOOS=linux
  - export GOARM=7
  - make release