9
9
description : Information about the Snapshot to be pushed
10
10
- name : event-type
11
11
description : The type of event that triggered the pipeline
12
+ - name : snapshot-type
13
+ description : The type of snapshot that triggered the pipeline
14
+ - name : release-tags
15
+ description : A space-separated list of tags that should be applied to the release
16
+ default : " "
12
17
- name : sync
13
18
description : >-
14
19
True if all components are built from the same git commit. False if components
33
38
value : $(params.SNAPSHOT)
34
39
- name : EVENT_TYPE
35
40
value : $(params.event-type)
41
+ - name : SNAPSHOT_TYPE
42
+ value : $(params.snapshot-type)
43
+ - name : RELEASE_TAGS
44
+ value : $(params.release-tags)
36
45
- name : SYNC
37
46
value : $(params.sync)
38
47
- name : REPO_PREFIX
@@ -91,7 +100,11 @@ spec:
91
100
COMPONENTS="$(jq -r '.components | length' <<< "$SNAPSHOT")"
92
101
SKIP=($SKIP_COMPONENTS)
93
102
94
- if [ "$EVENT_TYPE" != "push" ]; then
103
+ if [ "$SNAPSHOT_TYPE" != "override" ]; then
104
+ NOTE="Skipped push of $COMPONENTS components from \"$SNAPSHOT_TYPE\" snapshot"
105
+ test_output SKIPPED 0 0 0 "$NOTE"
106
+ exit
107
+ elif [ "$EVENT_TYPE" != "override" ]; then
95
108
NOTE="Skipped push of $COMPONENTS components from \"$EVENT_TYPE\" event"
96
109
test_output SKIPPED 0 0 0 "$NOTE"
97
110
exit
@@ -110,8 +123,21 @@ spec:
110
123
(( SKIPS+=1 ))
111
124
continue
112
125
fi
113
- log Copying "$NAME" from "$SRC" to "$DEST"
114
- if skopeo copy --all --retry-times 5 "docker://$SRC" "docker://$DEST"; then
126
+ DESTS=("$DEST")
127
+ for TAG in $RELEASE_TAGS; do
128
+ RELEASE_DEST="${DEST%:*}:$TAG"
129
+ DESTS+=("$RELEASE_DEST")
130
+ done
131
+ SUCCESS="true"
132
+ for DEST in "${DESTS[@]}"; do
133
+ log Copying "$NAME" from "$SRC" to "$DEST"
134
+ if skopeo copy --all --retry-times 5 "docker://$SRC" "docker://$DEST"; then
135
+ :
136
+ else
137
+ SUCCESS="false"
138
+ fi
139
+ done
140
+ if [ "$SUCCESS" == "true" ]; then
115
141
(( SUCCESSES+=1 ))
116
142
else
117
143
FAILED_COMPONENTS+=("$NAME")
0 commit comments