We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a70591 commit f5b4c02Copy full SHA for f5b4c02
.gitlab-ci.yml
@@ -0,0 +1,40 @@
1
+
2
+variables:
3
+ NAME: gitlab-registry.cern.ch/swan/docker-images/notebook
4
5
6
+stages:
7
+ - build
8
+ - deploy
9
+ - clean
10
11
12
+build_image:
13
+ stage: build
14
+ script: docker build --compress --rm -t $CI_COMMIT_SHA .
15
+ except:
16
+ - web
17
+ - master
18
19
20
+publish_image:
21
+ stage: deploy
22
+ script:
23
+ - docker tag $CI_COMMIT_SHA $NAME:$CI_COMMIT_TAG
24
+ - docker login gitlab-registry.cern.ch -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
25
+ - docker push $NAME:$CI_COMMIT_TAG
26
+ - docker logout
27
+ only:
28
+ - /^v.*$/
29
30
31
+ when: on_success
32
33
34
+clean_images:
35
+ stage: clean
36
37
+ - docker rmi $CI_COMMIT_SHA
38
39
40
0 commit comments