forked from neomantra/docker-onload
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
119 lines (102 loc) · 2.42 KB
/
.gitlab-ci.yml
File metadata and controls
119 lines (102 loc) · 2.42 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# docker-onload GitLab CI/CD
# Copyright (c) 2020 Neomantra BV
image: docker:latest
stages:
- setup
- triggers
- build
variables:
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
before_script:
- apk add --update ruby
###############################################################################################
# Images
###############################################################################################
master-build-setup:
stage: setup
only:
- master
script:
- ./gen_gitlab_yml.rb --template --zf -o $ONLOAD_VERSION -p "$CI_REGISTRY_IMAGE:" > onload-gitlab-ci.yml
artifacts:
paths:
- onload-gitlab-ci.yml
variables:
ONLOAD_VERSION: latest
master-build-triggers:
stage: triggers
only:
- master
trigger:
strategy: depend
include:
- artifact: onload-gitlab-ci.yml
job: master-build-setup
tag-build-setup:
stage: setup
only:
- tags
script:
- ./gen_gitlab_yml.rb --template --zf -o $ONLOAD_VERSION -p "$CI_REGISTRY_IMAGE:" > onload-gitlab-ci.yml
artifacts:
paths:
- onload-gitlab-ci.yml
variables:
ONLOAD_VERSION: $CI_COMMIT_TAG
tag-build-triggers:
stage: triggers
only:
- tags
trigger:
strategy: depend
include:
- artifact: onload-gitlab-ci.yml
job: tag-build-setup
branch-build-setup:
stage: setup
only:
- branches
script:
- ./gen_gitlab_yml.rb --template --zf -o $ONLOAD_VERSION -p "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME-" > onload-gitlab-ci.yml
artifacts:
paths:
- onload-gitlab-ci.yml
variables:
ONLOAD_VERSION: latest
branch-build-triggers:
stage: triggers
only:
- branches
trigger:
strategy: depend
include:
- artifact: onload-gitlab-ci.yml
job: branch-build-setup
build-all-setup:
stage: setup
rules:
- if: '$BUILD == "ALL"'
when: manual
environment:
name: production
script:
- |
./gen_gitlab_yml.rb --template > onload-gitlab-ci.yml
for OOVERSION in $(./build_onload_image.rb --versions) ; do
./gen_gitlab_yml.rb --zf -o $OOVERSION -p "$CI_REGISTRY_IMAGE:" >> onload-gitlab-ci.yml
done
artifacts:
paths:
- onload-gitlab-ci.yml
build-all-triggers:
stage: triggers
rules:
- if: '$BUILD == "ALL"'
when: manual
trigger:
strategy: depend
include:
- artifact: onload-gitlab-ci.yml
job: build-all-setup