-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
50 lines (43 loc) · 1013 Bytes
/
.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
variables:
VERSION: "2.35"
IMAGE_NAME: "wabizapi-mock"
TAG: "dev"
PROTOC_BUILDER_IMAGE: mtr.external.otc.telekomcloud.com/digitalmedia-connector/protoc-builder
stages:
- pre_build
- check
- build
- container_scan_stage
.pre_build_test: &pre_build_test
image: golang
tags:
- run_docker
script:
- go test ./...
.build_template: &build_image
tags:
- run_docker
image: docker
before_script:
- echo $MTR_PWD | docker login -u $MTR_USER --password-stdin $MTR_URL
script:
- docker build --build-arg VERSION=$VERSION --tag $MTR_URL/$IMAGE_NAME:$TAG .
- docker push $MTR_URL/$IMAGE_NAME:$TAG
- docker image rm $MTR_URL/$IMAGE_NAME:$TAG
unit test:
allow_failure: true
stage: check
<<: *pre_build_test
build latest:
stage: build
variables:
TAG: latest
only:
refs:
- tags
<<: *build_image
build versioned:
stage: build
variables:
TAG: $CI_COMMIT_REF_SLUG
<<: *build_image