-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
77 lines (69 loc) · 1.57 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
stages:
- build-docker
- build
- release
.docker:
stage: build-docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
# Merge requests
ci:build:docker-image:
extends: .docker
script:
- /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile --cache=true --destination ${CI_REGISTRY_IMAGE}:build-mr-${CI_MERGE_REQUEST_ID}
only:
- merge_requests
ci:build:cv:
stage: build
image:
name: ${CI_REGISTRY_IMAGE}:build-mr-${CI_MERGE_REQUEST_ID}
needs:
- ci:build:docker-image
script:
- make
artifacts:
expire_in: 1 week
expose_as: generated cv
paths:
- cv.pdf
only:
- merge_requests
# Tags / releases
build:docker-image:
extends: .docker
script:
- /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile --cache=true --destination ${CI_REGISTRY_IMAGE}:build-${CI_COMMIT_REF_NAME}
only:
- tags
build:cv:
stage: build
image:
name: ${CI_REGISTRY_IMAGE}:build-${CI_COMMIT_REF_NAME}
needs:
- build:docker-image
script:
- make
artifacts:
paths:
- cv.pdf
only:
- tags
release:
stage: release
image:
name: python:3
needs:
- build:cv
script:
- pip3 install gitlab-release
- gitlab-release --link-artifact cv.pdf
artifacts:
paths:
- cv.pdf
only:
- tags