-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
61 lines (55 loc) · 1.71 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
60
61
stages:
- build
- deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_TLS_CERTDIR: ''
# build:supernumerary-node:
# stage: build
# image: registry.ronaksoftware.com/base/docker/golang:1.14.1
# script:
# - cd cmd/cli-supernumerary/node
# - mkdir -p $CI_PROJECT_DIR/cmd/cli-supernumerary/node/_build
# - env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --mod=vendor -ldflags "-s -w" -o $CI_PROJECT_DIR/cmd/cli-supernumerary/node/_build/supernumerary
# artifacts:
# untracked: true
# expire_in: 1 hour
# deploy:supernumerary-node:
# stage: deploy
# only:
# - master
# image: docker:latest
# services:
# - docker:dind
# variables:
# IMAGE_TAG: "0.1"
# script:
# - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# - cd ./cmd/cli-supernumerary/node
# - docker build --pull -t $CI_REGISTRY_IMAGE/supernumerary:$IMAGE_TAG .
# - docker push $CI_REGISTRY_IMAGE/supernumerary:$IMAGE_TAG
# - echo $CI_REGISTRY_IMAGE
build:live-logger:
stage: build
image: registry.ronaksoft.com/base/docker/golang:1.14.7
script:
- cd cmd/cli-livelog/
- env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --mod=vendor -ldflags "-s -w" -o $CI_PROJECT_DIR/cmd/cli-livelog/cli-livelog
artifacts:
untracked: true
expire_in: 1 hour
deploy:live-logger:
stage: deploy
only:
- master
image: docker:latest
services:
- docker:dind
variables:
IMAGE_TAG: "latest"
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- cd ./cmd/cli-livelog/
- docker build --pull -t $CI_REGISTRY_IMAGE/live-logger:$IMAGE_TAG .
- docker push $CI_REGISTRY_IMAGE/live-logger:$IMAGE_TAG
- echo $CI_REGISTRY_IMAGE