-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
55 lines (47 loc) · 1.01 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
---
image: docker:19.03.0
stages:
- build
- test
- publish
- release
variables:
PANDOC_IMAGE: ${CI_REGISTRY_IMAGE}
PANDOC_BUILD_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
services:
- docker:19.03.0-dind
before_script:
- env
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker info
build_image:
stage: build
script:
- docker build -t ${PANDOC_BUILD_IMAGE} .
- docker push ${PANDOC_BUILD_IMAGE}
tags:
- docker
publish_latest:
stage: publish
script:
- docker pull ${PANDOC_BUILD_IMAGE}
- push_tag="${PANDOC_IMAGE}:latest"
- docker tag ${PANDOC_BUILD_IMAGE} ${push_tag}
- docker push ${push_tag}
only:
- master
tags:
- docker
release_image:
stage: release
script:
- docker pull ${PANDOC_BUILD_IMAGE}
- push_tag="${PANDOC_IMAGE}:${CI_COMMIT_TAG#v}"
- docker tag ${PANDOC_BUILD_IMAGE} ${push_tag}
- docker push ${push_tag}
only:
- tags
tags:
- docker