-
Notifications
You must be signed in to change notification settings - Fork 23
/
.one-pipeline-archive.yaml
127 lines (115 loc) · 4.02 KB
/
.one-pipeline-archive.yaml
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
version: "1"
setup:
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
GHE_TOKEN=$(get_env git-token)
ARCHIVE_DESTINATION_REPO=$(get_env archive-destination-repo)
REPO=$(get_env repository)
ARCHIVE_PARAMETERS=$(get_env archive-parameters)
ARCHIVE_CMD="git push --prune https://${GHE_TOKEN}@${ARCHIVE_DESTINATION_REPO} ${ARCHIVE_PARAMETERS}"
echo "Archive command:"
echo $ARCHIVE_CMD
git push --prune https://$GHE_TOKEN@$ARCHIVE_DESTINATION_REPO $ARCHIVE_PARAMETERS
RETCODE=$?
if [ $RETCODE != 0 ]; then
echo "${REPO} was not archived successfuly. A return code of ${RETCODE} was found after the archive operation was executed."
slack_users=$(get_env slack_users)
echo "slack_users=$slack_users"
eval "arr=($slack_users)"
for user in "${arr[@]}"; do
echo "user=$user"
curl -X POST -H 'Content-type: application/json' --data '{"text":"<'$user'> Archive operation failure see below "}' $(get_env slack_web_hook_url)
echo " "
done
pipeline_url="https://cloud.ibm.com/devops/pipelines/tekton/${PIPELINE_ID}/runs/${PIPELINE_RUN_ID}?env_id=ibm:yp:us-south"
curl -X POST -H 'Content-type: application/json' --data '{"text":"The archive operation for '$REPO' has failed."}' $(get_env slack_web_hook_url) </dev/null
curl -X POST -H 'Content-type: application/json' --data '{"text":"Failing pipeline: '$pipeline_url'"}' $(get_env slack_web_hook_url) </dev/null
curl -X POST -H 'Content-type: application/json' --data '{"text":"Destination repository: '$ARCHIVE_DESTINATION_REPO'"}' $(get_env slack_web_hook_url) </dev/null
exit 1
else
echo "${REPO} has been archived successfully to ${ARCHIVE_DESTINATION_REPO}"
fi
detect-secrets:
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
abort_on_failure: false
image_pull_policy: IfNotPresent
skip: true
script: |
#!/usr/bin/env bash
echo "Skip detect-secrets"
exit 0
test:
dind: true
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
echo "Skipping test"
exit 0
static-scan:
dind: true
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
echo "Skipping static-scan"
exit 0
compliance-checks:
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.3@sha256:5b8f7e1964c0a82995689d636b60a1761dd08ce422b9195aadc0249e5da90dae
abort_on_failure: false
script: |
#!/usr/bin/env bash
echo "Skipping compliance-checks"
exit 0
containerize:
dind: true
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
echo "Skipping containerize"
exit 0
sign-artifact:
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/image-signing:1.0.0@sha256:e9d8e354668ba3d40be2aaee08298d2aa7f0e1c8a1829cca4094ec93830e3e6a
script: |
#!/usr/bin/env bash
echo "Skipping sign-artifact"
exit 0
deploy:
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
echo "Skipping deploy"
exit 0
dynamic-scan:
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
echo "Skipping dynamic-scan"
exit 0
acceptance-test:
dind: true
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
echo "Skipping acceptance-test"
exit 0
scan-artifact:
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
echo "Skipping scan-artifact"
exit 0
release:
abort_on_failure: false
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
script: |
#!/usr/bin/env bash
echo "Skipping release"
exit 0