-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
92 lines (83 loc) · 3.47 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
image: docker:stable
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
stages:
- build
- test
- release
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME
build:
stage: build
tags:
- multicore
script:
- docker pull $IMAGE_TAG:system-latest || true
- docker pull $IMAGE_TAG:builder-latest || true
## builder image for caching:
## https://github.com/moby/moby/issues/34715
## https://gitlab.com/gitlab-org/gitlab-omnibus-builder/merge_requests/83
- docker build --pull
--cache-from $IMAGE_TAG:system-latest
--tag $IMAGE_TAG:system-latest
--target system
.
- docker push $IMAGE_TAG:system-latest
## 2nd stage build using builder-latest for caching
- docker build --pull
--cache-from $IMAGE_TAG:system-latest
--cache-from $IMAGE_TAG:builder-latest
--tag $IMAGE_TAG:builder-latest
--target builder
.
- docker push $IMAGE_TAG:builder-latest
## 3rd stage build using system-latest and builder-latest for caching
- docker build --pull
--cache-from $IMAGE_TAG:system-latest
--cache-from $IMAGE_TAG:builder-latest
--tag $IMAGE_TAG:test
.
- docker push $IMAGE_TAG:test
retry: 2
test01:
stage: test
script:
- docker pull $IMAGE_TAG:test
## make demos/ from git repos available to docker env for testing: https://gitlab.com/gitlab-org/gitlab-runner/issues/1482#note_34438183
# - cp -a /demos/ ./demos/ # not needed any more?
- docker run --rm
-v $(pwd)/demos:/tmp/demos
--workdir /tmp/demos/
$IMAGE_TAG:test
FacetAnalyserCLI 8faced-rhombic-dodecahedron_twinned_010_deformed_wss.vtp 51 15 0.2 0.001 2 0 8faced-rhombic-dodecahedron_twinned_010_deformed_wss_FA.vtp 8faced-rhombic-dodecahedron_twinned_010_deformed_wss_FA-hull.vtp 8faced-rhombic-dodecahedron_twinned_010_deformed_wss_FA-edges.vtp
## test should result in the same file as stored by git
- apk update && apk upgrade && apk add --no-cache git
- git update-index -q --refresh
- git diff-index --exit-code HEAD --
retry: 2
test02:
stage: test
script:
- docker pull $IMAGE_TAG:test
## make demos/ from git repos available to docker env for testing: https://gitlab.com/gitlab-org/gitlab-runner/issues/1482#note_34438183
# - cp -a /demos/ ./demos/ # not needed any more?
- docker run --rm
-v $(pwd)/demos:/tmp/demos
--workdir /tmp/demos/
$IMAGE_TAG:test
FacetAnalyserCLI 8faced-rhombic-dodecahedron_twinned_010_deformed_wss.vtp 51 15 0.2 0.001 0 1 8faced-rhombic-dodecahedron_twinned_010_deformed_wss_FA0.vtp 8faced-rhombic-dodecahedron_twinned_010_deformed_wss_FA0-hull.vtp 8faced-rhombic-dodecahedron_twinned_010_deformed_wss_FA0-edges.vtp
## test should result in the same file as stored by git
- apk update && apk upgrade && apk add --no-cache git
- git update-index -q --refresh
- git diff-index --exit-code HEAD --
retry: 2
release:
stage: release
script:
- docker pull $IMAGE_TAG:test
- docker tag $IMAGE_TAG:test $IMAGE_TAG:latest
- docker push $IMAGE_TAG:latest
- docker tag $IMAGE_TAG:test $IMAGE_TAG:$CI_COMMIT_SHORT_SHA
- docker push $IMAGE_TAG:$CI_COMMIT_SHORT_SHA