11version : ' 1'
22
33setup :
4- image : icr.io/continuous-delivery/pipeline/pipeline-base-image:2 .12@sha256:ff4053b0bca784d6d105fee1d008cfb20db206011453071e86b69ca3fde706a4
4+ image : icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3 .12
55 script : |
66 #!/usr/bin/env bash
77
88 echo "setup"
9- apt-get update
10- apt-get -y install build-essential
119
1210 # Download Go
1311 GO_VERSION=$(get_env go-version)
@@ -55,11 +53,11 @@ setup:
5553 echo "git push --prune https://$GHE_TOKEN@$WHITESOURCE_GHE_REPO $BRANCH_REFSPEC +refs/tags/*:refs/tags/*"
5654 git push --prune https://$GHE_TOKEN@$WHITESOURCE_GHE_REPO $BRANCH_REFSPEC +refs/tags/*:refs/tags/*
5755 fi
58-
56+
5957test :
6058 dind : true
6159 abort_on_failure : true
62- image : icr.io/continuous-delivery/pipeline/pipeline-base-image:2 .12@sha256:ff4053b0bca784d6d105fee1d008cfb20db206011453071e86b69ca3fde706a4
60+ image : icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3 .12
6361 script : |
6462 #!/usr/bin/env bash
6563
@@ -89,17 +87,19 @@ test:
8987static-scan :
9088 dind : true
9189 abort_on_failure : false
92- image : icr.io/continuous-delivery/pipeline/pipeline-base-image:2 .12@sha256:ff4053b0bca784d6d105fee1d008cfb20db206011453071e86b69ca3fde706a4
90+ image : icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3 .12
9391 script : |
9492 #!/usr/bin/env bash
93+
9594 PERIODIC_SCAN=$(get_env periodic-rescan)
9695 PERIODIC_SCAN="$(echo "$PERIODIC_SCAN" | tr '[:upper:]' '[:lower:]')"
9796
9897 if [[ ! -z "$PERIODIC_SCAN" && "$PERIODIC_SCAN" != "false" && "$PERIODIC_SCAN" != "no" ]]; then
99- echo "Skipping static scan. This is a periodic run that is only meant to produce CVE information."
98+ echo "Skipping static- scan. This is a periodic run that is only meant to produce CVE information."
10099 exit 0
101100 fi
102101
102+ BRANCH=$(get_env branch)
103103 read -r SONAR_HOST_URL <<< "$(get_env sonarqube | jq -r '.parameters.dashboard_url' | sed 's:/*$::')"
104104 read -r SONAR_USER <<< "$(get_env sonarqube | jq -r '.parameters.user_login')"
105105 SONARQUBE_INSTANCE_ID=$(get_env sonarqube | jq -r '.instance_id')
@@ -109,6 +109,7 @@ static-scan:
109109 sonar.projectKey=runtime-component-operator
110110 sonar.host.url=$SONAR_HOST_URL
111111 sonar.sources=.
112+ sonar.branch.name=$BRANCH
112113 sonar.login=$SONAR_USER
113114 sonar.password=$SONAR_PASS
114115 sonar.c.file.suffixes=-
@@ -118,6 +119,7 @@ static-scan:
118119 chmod -x "$WORKSPACE"/runtime-component-operator/sonar-project.properties
119120 #echo "$SONAR_PASS" >> /tmp/sonarqube-token
120121 "${COMMONS_PATH}"/static-scan/run.sh
122+
121123 ## Perform static lint
122124 ./scripts/pipeline/static-linter-scan.sh --git-token $(get_env git-token) --static-linter-version $(get_env static-linter-version)
123125
@@ -152,25 +154,19 @@ containerize:
152154 export PIPELINE_USERNAME=$(get_env ibmcloud-api-user)
153155 export PIPELINE_PASSWORD=$(get_env ibmcloud-api-key-staging)
154156 PIPELINE_REGISTRY=$(get_env pipeline-registry)
155- PIPELINE_OPERATOR_IMAGE=$(get_env pipeline-operator-image)
156-
157- PERIODIC_SCAN=$(get_env periodic-rescan)
158- PERIODIC_SCAN="$(echo "$PERIODIC_SCAN" | tr '[:upper:]' '[:lower:]')"
159-
160- if [[ ! -z "$PERIODIC_SCAN" && "$PERIODIC_SCAN" != "false" && "$PERIODIC_SCAN" != "no" ]]; then
161- echo "Skipping containerize stage. This is a periodic run that is only meant to produce CVE information."
162- else
163- # Build amd64 image
164- make build-pipeline-releases
165- # Build ppc64le and s390x images
166- ./scripts/pipeline/launch-travis.sh -t $(get_env travis-token) -r "https://github.com/application-stacks/runtime-component-operator" -b $(get_env branch) -l
167- # Build manifest
168- make build-pipeline-manifest
169- # Build bundle image
170- ./scripts/pipeline/launch-catalog-build.sh -t $(get_env travis-token) -r "https://github.com/application-stacks/runtime-component-operator" -b $(get_env branch) -l
171- fi
157+ PIPELINE_OPERATOR_IMAGE=$(get_env pipeline-operator-image)
158+ # Build amd64 image
159+ make build-pipeline-releases
160+ # Build ppc64le and s390x images
161+ #./scripts/pipeline/launch-travis.sh -t $(get_env travis-token) -r "https://github.com/application-stacks/runtime-component-operator" -b $(get_env branch) -l
162+ # Build manifest
163+ make build-pipeline-manifest
164+ # Build bundle image
165+ # ./scripts/pipeline/launch-catalog-build.sh -t $(get_env travis-token) -r "https://github.com/application-stacks/runtime-component-operator" -b $(get_env branch) -l
166+ make install-opm
167+ make bundle-pipeline-releases RELEASE_TARGET=${RELEASE_TARGET}
172168 # Save artifacts
173- declare -a tags=("daily-amd64 " "daily-ppc64le" "daily-s390x ")
169+ declare -a tags=("${RELEASE_TARGET} " "${RELEASE_TARGET}-amd64 ")
174170 for i in "${tags[@]}"
175171 do
176172 IMAGE=$PIPELINE_REGISTRY/$PIPELINE_OPERATOR_IMAGE:$i
@@ -179,7 +175,7 @@ containerize:
179175 echo "Saving artifact $i name=$IMAGE digest=$DIGEST"
180176 save_artifact $i type=image name="$IMAGE" "digest=$DIGEST" "arch=$ARCH"
181177 done
182- declare -a catalogs=("catalog-daily ")
178+ declare -a catalogs=("catalog-${RELEASE_TARGET} ")
183179 for i in "${catalogs[@]}"
184180 do
185181 IMAGE=$PIPELINE_REGISTRY/$PIPELINE_OPERATOR_IMAGE:$i
@@ -190,9 +186,9 @@ containerize:
190186 save_artifact $i type=image name="$IMAGE" "digest=$DIGEST" "arch=$ARCH"
191187 done
192188
193- echo "whitesource scan"
194- chmod +x "${COMMONS_PATH}/whitesource/whitesource_unified_agent_scan.sh"
195- source "${COMMONS_PATH}/whitesource/ whitesource_unified_agent_scan.sh"
189+ # echo "whitesource scan"
190+ # #source "${COMMONS_PATH}/whitesource/whitesource_unified_agent_scan.sh"
191+ # source ./scripts/pipeline/ whitesource_unified_agent_scan.sh
196192
197193sign-artifact :
198194 abort_on_failure : false
@@ -201,87 +197,151 @@ sign-artifact:
201197 #!/usr/bin/env bash
202198 echo "sign-artifact"
203199
200+ PERIODIC_SCAN=$(get_env periodic-rescan)
201+ PERIODIC_SCAN="$(echo "$PERIODIC_SCAN" | tr '[:upper:]' '[:lower:]')"
202+
203+ if [[ ! -z "$PERIODIC_SCAN" && "$PERIODIC_SCAN" != "false" && "$PERIODIC_SCAN" != "no" ]]; then
204+ echo "Skipping sign-artifact. This is a periodic run that is only meant to produce CVE information."
205+ exit 0
206+ fi
207+
204208deploy :
205- image : icr.io/continuous-delivery/pipeline/pipeline-base-image:2.12@sha256:ff4053b0bca784d6d105fee1d008cfb20db206011453071e86b69ca3fde706a4
209+ image : icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
210+
206211 script : |
207212 #!/usr/bin/env bash
208213
214+
215+ PERIODIC_SCAN=$(get_env periodic-rescan)
216+ PERIODIC_SCAN="$(echo "$PERIODIC_SCAN" | tr '[:upper:]' '[:lower:]')"
217+
218+ if [[ ! -z "$PERIODIC_SCAN" && "$PERIODIC_SCAN" != "false" && "$PERIODIC_SCAN" != "no" ]]; then
219+ echo "Skipping deploy. This is a periodic run that is only meant to produce CVE information."
220+ exit 0
221+ fi
222+
209223 if [[ "$PIPELINE_DEBUG" == 1 ]]; then
210224 trap env EXIT
211225 env
212226 set -x
213227 fi
214228 echo "deploy"
215229
216- dynamic-scan :
230+ dynamic-scan :
217231 abort_on_failure : false
218- image : icr.io/continuous-delivery/pipeline/pipeline-base-image:2 .12@sha256:ff4053b0bca784d6d105fee1d008cfb20db206011453071e86b69ca3fde706a4
232+ image : icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3 .12
219233 script : |
220234 #!/usr/bin/env bash
221235 echo "dynamic-scan"
236+ PERIODIC_SCAN=$(get_env periodic-rescan)
237+ PERIODIC_SCAN="$(echo "$PERIODIC_SCAN" | tr '[:upper:]' '[:lower:]')"
238+
239+ if [[ ! -z "$PERIODIC_SCAN" && "$PERIODIC_SCAN" != "false" && "$PERIODIC_SCAN" != "no" ]]; then
240+ echo "Skipping dynamic-scan. This is a periodic run that is only meant to produce CVE information."
241+ exit 0
242+ fi
243+
244+ #export APP_URL=$(cat ../app-url)
245+ # feature preview this until evidence locker v2 usage is full feature ready
246+ # can be triggered, and owasp will run for preview purposes
247+ #source scripts/zap/trigger_api_scan.sh
222248
223249acceptance-test :
224- dind : true
250+ dind : true
225251 abort_on_failure : true
226- image : icr.io/continuous-delivery/pipeline/pipeline-base-image:2 .12@sha256:ff4053b0bca784d6d105fee1d008cfb20db206011453071e86b69ca3fde706a4
252+ image : icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3 .12
227253 script : |
228254 #!/usr/bin/env bash
229255 echo "acceptance-test"
230-
231256 PERIODIC_SCAN=$(get_env periodic-rescan)
232257 PERIODIC_SCAN="$(echo "$PERIODIC_SCAN" | tr '[:upper:]' '[:lower:]')"
233-
234258 if [[ ! -z "$PERIODIC_SCAN" && "$PERIODIC_SCAN" != "false" && "$PERIODIC_SCAN" != "no" ]]; then
235- echo "Skipping e2e-tests . This is a periodic run that is only meant to produce CVE information."
259+ echo "Skipping acceptance-test . This is a periodic run that is only meant to produce CVE information."
236260 exit 0
237261 fi
238-
262+ SKIP_KIND_E2E_TEST=$(get_env SKIP_KIND_E2E_TEST)
263+ SKIP_KIND_E2E_TEST="$(echo "$SKIP_KIND_E2E_TEST" | tr '[:upper:]' '[:lower:]')"
264+ if [[ ! -z "$SKIP_KIND_E2E_TEST" && "$SKIP_KIND_E2E_TEST" != "false" && "$SKIP_KIND_E2E_TEST" != "no" ]]; then
265+ echo "Skipping acceptance-test, SKIP_KIND_E2E_TEST=$SKIP_KIND_E2E_TEST"
266+ exit 0
267+ fi
268+ # Download and configure golang
239269 GO_VERSION=$(get_env go-version)
240270 if [[ -z "${GO_VERSION}" ]]; then
241271 GO_VERSION="$(grep '^go [0-9]\+.[0-9]\+' go.mod | cut -d ' ' -f 2)"
242272 fi
273+ export GO_VERSION
274+ # OCP test
275+ export PIPELINE_USERNAME=$(get_env ibmcloud-api-user)
276+ export PIPELINE_PASSWORD=$(get_env ibmcloud-api-key-staging)
277+ export PIPELINE_REGISTRY=$(get_env pipeline-registry)
278+ export PIPELINE_OPERATOR_IMAGE=$(get_env pipeline-operator-image)
279+ export DOCKER_USERNAME=$(get_env docker-username)
280+ export DOCKER_PASSWORD=$(get_env docker-password)
281+ export CLUSTER_URL=$(get_env test-cluster-url)
282+ export CLUSTER_USER=$(get_env test-cluster-user kubeadmin)
283+ export CLUSTER_TOKEN=$(get_env test-cluster-token)
284+ export RELEASE_TARGET=$(get_env branch)
285+ export DEBUG_FAILURE=$(get_env debug-failure)
286+ # Kind test
287+ export FYRE_USER=$(get_env fyre-user)
288+ export FYRE_KEY=$(get_env fyre-key)
289+ export FYRE_PASS=$(get_env fyre-pass)
290+ export FYRE_PRODUCT_GROUP_ID=$(get_env fyre-product-group-id)
291+ scripts/acceptance-test.sh
292+
243293
244- export SKIP_KIND_E2E_TEST=$(get_env SKIP_KIND_E2E_TEST)
245- if [[ $SKIP_KIND_E2E_TEST != "true" ]]; then
246-
247- # Download and configure golang
248- rm -rf /usr/local/go && wget --no-verbose --header "Accept: application/octet-stream" "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" -O - | tar -xz -C /usr/local/
249- export PATH=$PATH:/usr/local/go/bin
250-
251- apt-get update
252- apt-get -y install build-essential
253- export PIPELINE_USERNAME=$(get_env ibmcloud-api-user)
254- export PIPELINE_PASSWORD=$(get_env ibmcloud-api-key-staging)
255- export DOCKER_USERNAME=$(get_env docker-username)
256- export DOCKER_PASSWORD=$(get_env docker-password)
257- export CLUSTER_URL=$(get_env test-cluster-url)
258- export CLUSTER_TOKEN=$(get_env test-cluster-token)
259- export TRAVIS_BUILD_NUMBER=$BUILD_NUMBER
260- make setup
261- make test-pipeline-e2e
262- else
263- echo "skipping Acceptance test"
264- fi
265294
266295scan-artifact :
267296 abort_on_failure : false
268- image : icr.io/continuous-delivery/pipeline/pipeline-base-image:2.15
297+ image : icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
269298 script : |
270299 #!/usr/bin/env bash
300+ # echo "twistlock-scan"
301+ # ./scripts/pipeline/twistlock-scan.sh
302+ # echo "VA scan"
303+ # . scripts/pipeline/va_scan
304+ # if which list_artifacts >/dev/null; then
305+ # list_artifacts | while IFS= read -r artifact; do
306+ # image="$(load_artifact "$artifact" "name")"
307+ # type="$(load_artifact "$artifact" "type")"
308+ # digest="$(load_artifact "$artifact" "digest")"
309+ # name="$(echo "$artifact" | awk '{print $1}')"
310+ # if [[ "$type" == "image" ]]; then
311+ # if [[ "$image" == *"icr.io"* ]]; then
312+ # echo "Starting VA scan for $image"
313+ # start_va_scan "$name" "$image" "$digest"
314+ # else
315+ # echo "Skipping VA scan for $image"
316+ # fi
317+ # fi
318+ # done
319+ # fi
320+
321+ # echo "aqua scan"
322+ # # install docker
323+ # curl -fsSL https://get.docker.com -o get-docker.sh
324+ # sudo sh get-docker.sh
325+ # # get aqua scan executables
326+ # git clone https://$(get_env git-token)@github.ibm.com/CICD-CPP/cpp-pipelines.git
327+ # chmod -R +x cpp-pipelines
328+ # # setup and execute aqua scan
329+ # cd cpp-pipelines
330+ # export CUSTOM_SCRIPTS_PATH=/workspace/app/one-pipeline-config-repo/cpp-pipelines
331+ # ./commons/aqua/aqua-local-scan
271332 # ========== Security Scanner ==========
272333 ./scripts/pipeline/ci_to_secure_pipeline_scan.sh
273334
274335release :
275336 abort_on_failure : false
276- image : icr.io/continuous-delivery/pipeline/pipeline-base-image:2 .12@sha256:ff4053b0bca784d6d105fee1d008cfb20db206011453071e86b69ca3fde706a4
337+ image : icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3 .12
277338 script : |
278339 #!/usr/bin/env bash
279-
280340 PERIODIC_SCAN=$(get_env periodic-rescan)
281341 PERIODIC_SCAN="$(echo "$PERIODIC_SCAN" | tr '[:upper:]' '[:lower:]')"
282342
283343 if [[ ! -z "$PERIODIC_SCAN" && "$PERIODIC_SCAN" != "false" && "$PERIODIC_SCAN" != "no" ]]; then
284- echo "Skipping release stage . This is a periodic run that is only meant to produce CVE information."
344+ echo "Skipping release. This is a periodic run that is only meant to produce CVE information."
285345 exit 0
286346 fi
287347
0 commit comments