-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
51 lines (44 loc) · 989 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
51
stages:
- build
- test
- publish
- cleanup
- deploy
build_image:
tags:
- docker
stage: build
script:
- docker build -t docker.nico-hessler.de/ex/wustopia:$CI_COMMIT_REF_NAME .
test_image:
tags:
- docker
stage: test
script:
- docker run --rm docker.nico-hessler.de/ex/wustopia:$CI_COMMIT_REF_NAME python3 tests.py
publish:
tags:
- docker
stage: publish
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN docker.nico-hessler.de
- docker push docker.nico-hessler.de/ex/wustopia:$CI_COMMIT_REF_NAME
cleanup:
tags:
- docker
stage: cleanup
except:
- master
script:
- docker rmi docker.nico-hessler.de/ex/wustopia:$CI_COMMIT_REF_NAME
deploy_job:
tags:
- docker
only:
- master
stage: deploy
when: manual
script:
- git push github HEAD:master
- docker tag docker.nico-hessler.de/ex/wustopia:master docker.nico-hessler.de/ex/wustopia:latest
- docker service update --force wustopia_web