-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathcodefresh-helm3.yml
More file actions
178 lines (169 loc) · 4.37 KB
/
codefresh-helm3.yml
File metadata and controls
178 lines (169 loc) · 4.37 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
version: '1.0'
stages:
- "init"
- "build"
- "push"
steps:
define_the_versions_list:
stage: 'init'
image: alpine
commands:
# already built versions:
# 3.0.0
# 3.0.1
# 3.0.2
# 3.0.3
# 3.1.0
# 3.1.1
# 3.1.2
# 3.1.3
# 3.2.0
# 3.2.1
# 3.2.2
# 3.2.3
# 3.2.4
# 3.3.1
# 3.4.1
# 3.5.2
# 3.6.0
# 3.6.1
# 3.6.2
# 3.7.0
# 3.7.1
# 3.7.2
# 3.8.0
# 3.9.0
# 3.9.1
# 3.9.2
# 3.9.3
# 3.9.4
# 3.10.0
# 3.10.1
# 3.10.2
# 3.10.3
# 3.11.0
# 3.11.1
# 3.11.2
# 3.11.3
# 3.12.0
# 3.12.1
# 3.12.2
# 3.12.3
# 3.13.0
# 3.13.1
- |-
cat <<EOF > helmVersionsList
3.13.2
3.13.3
3.14.0
3.14.1
3.14.2
3.14.3
3.14.4
when:
condition:
all:
notRecursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == true'
run-cli-loop:
stage: 'init'
image: codefresh/cli
commands:
- for VAR in $(cat helmVersionsList); do codefresh wait $(codefresh run ${{CF_PIPELINE_NAME}} -d --branch ${{CF_BRANCH}} --variable HELM_VERSION=${VAR} --trigger ${{CF_PIPELINE_TRIGGER_ID}} --context github && sleep 10) & done
- for j in $(jobs -p); do wait $j || (echo "Failed to build one of the images" && ! break); done
when:
condition:
all:
notRecursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == true'
debug:
stage: 'build'
type: freestyle
image: alpine
commands:
- export IMAGE_VERSION=$(if [[ "$CF_BRANCH" == 'master' ]]; then echo "$CF_BRANCH"; else echo "$CF_BRANCH-$CF_SHORT_REVISION"; fi)
- cf_export IMAGE_VERSION=$IMAGE_VERSION
- echo $HELM_VERSION
- echo $IMAGE_VERSION
when:
condition:
all:
recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false'
clone:
stage: 'build'
type: git-clone
arguments:
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
git: github
revision: '${{CF_REVISION}}'
when:
condition:
all:
recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false'
build_image:
stage: 'build'
type: build
registry: dockerhub
working_directory: '${{clone}}'
image_name: '${{STEP_IMAGE}}'
tag: '${{HELM_VERSION}}-${{CF_BRANCH}}-${{CF_SHORT_REVISION}}'
build_arguments:
- 'HELM_VERSION=${{HELM_VERSION}}'
- 'S3_PLUGIN_VERSION=0.9.2'
- 'GCS_PLUGIN_VERSION=0.3.0'
- 'PUSH_PLUGIN_VERSION=0.8.1'
when:
condition:
all:
recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false'
push_to_dev:
type: push
tag: '${{HELM_VERSION}}-${{CF_BRANCH}}-${{CF_SHORT_REVISION}}'
candidate: ${{build_image}}
when:
condition:
all:
recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false'
scale:
PushToDevDockerHub:
registry: dockerhub
PushToDevQuay:
image_name: "codefreshplugins/cfstep-helm"
tag: '${{HELM_VERSION}}-${{CF_BRANCH}}-${{CF_SHORT_REVISION}}'
candidate: ${{build_image}}
registry: quay
run_e2e:
stage: 'build'
type: codefresh-run
fail_fast: false
arguments:
FOLLOW_LOGS: false
PIPELINE_ID: Helm3/helm3-e2e
DETACH: false
# TRIGGER_ID: trigger
# BRANCH: ${{CF_BRANCH}}
RESET_VOLUME: true
# VARIABLE_FILE: ${{CF_VOLUME_PATH}}/env_vars_to_run_pipe.yml
VARIABLE:
- HELM_VERSION='${{HELM_VERSION}}-${{CF_BRANCH}}-${{CF_SHORT_REVISION}}'
- CF_BRANCH=${{CF_BRANCH}}
when:
condition:
all:
recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false'
masterBranch: 'match("${{CF_BRANCH}}", "^master", true) == false'
push_to_master:
type: push
tag: ${{HELM_VERSION}}
candidate: ${{build_image}}
when:
condition:
all:
recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false'
masterBranch: 'match("${{CF_BRANCH}}", "^master", true) == true'
scale:
PushToDockerHub:
registry: dockerhub
PushToQuay:
image_name: "codefreshplugins/cfstep-helm"
tag: ${{HELM_VERSION}}
candidate: ${{build_image}}
registry: quay