-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
56 lines (47 loc) · 1.69 KB
/
.gitlab-ci.yml
File metadata and controls
56 lines (47 loc) · 1.69 KB
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
# ASCII art brought to you by:
# http://patorjk.com/software/taag/#p=display&f=Star%20Wars&t=Type%20Something%20
stages:
- build
- deploy
variables:
TAG: $CI_COMMIT_SHA
BRANCH: $CI_COMMIT_REF_SLUG
REGISTRY: ci.tno.nl
IMAGE_BASE: ci.tno.nl/osmapeditoressim/panel-service
image: docker:20.10
services:
- docker:20.10-dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $REGISTRY
# ______ __ __ __ __ _______
#| _ \ | | | | | | | | | \
#| |_) | | | | | | | | | | .--. |
#| _ < | | | | | | | | | | | |
#| |_) | | `--' | | | | `----.| '--' |
#|______/ \______/ |__| |_______||_______/
build-panel-service:
stage: build
variables:
IMAGE: $IMAGE_BASE/panelservice
script:
- docker pull $IMAGE:$BRANCH || true
- docker build --build-arg git_commit=$TAG . -f Dockerfile --cache-from $IMAGE:$BRANCH -t $IMAGE:$TAG -t $IMAGE:$BRANCH
# - docker build --no-cache --build-arg git_commit=$TAG . -f Dockerfile -t $IMAGE:$TAG -t $IMAGE:$BRANCH
- docker push $IMAGE:$TAG
- docker push $IMAGE:$BRANCH
# _______ _______ .______ __ ______ ____ ____
#| \ | ____|| _ \ | | / __ \ \ \ / /
#| .--. || |__ | |_) | | | | | | | \ \/ /
#| | | || __| | ___/ | | | | | | \_ _/
#| '--' || |____ | | | `----.| `--' | | |
#|_______/ |_______|| _| |_______| \______/ |__|
push-latest-panel-service:
stage: deploy
variables:
IMAGE: $IMAGE_BASE/panelservice
script:
- docker pull $IMAGE:$TAG
- docker tag $IMAGE:$TAG $IMAGE:latest
- docker push $IMAGE:latest
only:
- main