Skip to content

Commit f5b4c02

Browse files
committed
Pipeline for automatic build
1 parent 7a70591 commit f5b4c02

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.gitlab-ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -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+
except:
30+
- web
31+
when: on_success
32+
33+
34+
clean_images:
35+
stage: clean
36+
script:
37+
- docker rmi $CI_COMMIT_SHA
38+
except:
39+
- master
40+
- web

0 commit comments

Comments
 (0)