-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
59 lines (53 loc) · 1.1 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
image: ubuntu:latest
variables:
APP_NAME: bingo
GIT_DEPTH: 200
DOCKER_HOST: tcp://docker:2375
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: true
before_script:
- apt-get update -qq && apt-get install -y -qq git make protobuf-compiler
# - export APP_VERSION=${CI_COMMIT_TAG}
- VERSION=$(git describe --tags)
- export APP_VERSION=${VERSION#v}
- echo ${APP_VERSION}
stages:
- Test
- Build
- Deploy
test:
stage: Build
image: golang:latest
script:
- echo "Run Unit tests."
- make cover
only:
- tags
build:
stage: Build
image: golang:latest
services:
- docker:stable-dind
script:
- echo "Start building..."
- make protoc
- ./scripts/docker/build.sh ${APP_VERSION}
artifacts:
paths:
- _output/*.tar.gz
only:
- tags
- develop
deploy_staging:
stage: Deploy
dependencies:
- build
script:
- echo "Start deploying staging..."
- ls -hl _output
- ./scripts/docker/deploy.sh ${APP_VERSION} ${REMOTE_USER} ${REMOTE_HOST} ${REMOTE_KEY}
only:
- tags
- develop
environment:
name: staging
url: https://staging.bingo.com