forked from codefresh-contrib/cfstep-helm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh-helm3.yml
76 lines (69 loc) · 2.05 KB
/
codefresh-helm3.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
version: '1.0'
steps:
define_the_versions_list:
image: alpine
commands:
- |-
cat <<EOF > helmVersionsList
3.8.0
3.9.0
when:
condition:
all:
notRecursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == true'
run-cli-loop:
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:
type: freestyle
image: alpine
commands:
- echo $HELM_VERSION
- env | grep CF_
when:
condition:
all:
recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false'
clone:
type: git-clone
arguments:
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
git: github-cf-api-token
revision: '${{CF_REVISION}}'
when:
condition:
all:
recursivelyInvoked: 'includes("${{HELM_VERSION}}", "${{") == false'
build_image:
type: build
registry: pysarenko
working_directory: '${{clone}}'
image_name: '${{STEP_IMAGE}}'
tag: '${{HELM_VERSION}}-${{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:
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: pysarenko