Skip to content

Commit 8e249c8

Browse files
authored
Merge branch 'main' into add-operator-related-image
2 parents 33d5827 + 65e1dc9 commit 8e249c8

File tree

4 files changed

+118
-12
lines changed

4 files changed

+118
-12
lines changed

.one-pipeline-cd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ deploy:
8181
done
8282
8383
sign-artifact:
84-
image: docker-eu-public.artifactory.swg-devops.com/wcp-compliance-automation-team-docker-local/csso-image-sign:6.0.0@sha256:3499f75eb669416536f0d680104e7e9e37147c168459152d716a1fbf9b1af5a2
84+
image: icr.io/continuous-delivery/toolchains/devsecops/csso-image-sign:7.0.0@sha256:e818a62c54f328752a94fd37f73b133e6586d9eb0271afb97ffc6a3faf77fede
8585
script: |
8686
#!/usr/bin/env bash
8787
echo "sign-artifact stage"
@@ -96,7 +96,7 @@ sign-artifact:
9696
cat wlo.pub
9797
9898
acceptance-test:
99-
image: docker-eu-public.artifactory.swg-devops.com/wcp-compliance-automation-team-docker-local/csso-image-sign:6.0.0@sha256:3499f75eb669416536f0d680104e7e9e37147c168459152d716a1fbf9b1af5a2
99+
image: icr.io/continuous-delivery/toolchains/devsecops/csso-image-sign:7.0.0@sha256:e818a62c54f328752a94fd37f73b133e6586d9eb0271afb97ffc6a3faf77fede
100100
script: |
101101
#!/usr/bin/env bash
102102
echo "acceptance-test stage"

.one-pipeline.yaml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ test:
9595
exit 0
9696
fi
9797
98+
RELEASE_ACCEPTANCE_TEST=$(get_env release-acceptance-test)
99+
RELEASE_ACCEPTANCE_TEST="$(echo "$RELEASE_ACCEPTANCE_TEST" | tr '[:upper:]' '[:lower:]')"
100+
101+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
102+
echo "Skipping unit-tests. This run is for a release acceptance test only."
103+
exit 0
104+
fi
105+
98106
## Setup required tooling
99107
make setup-go GO_RELEASE_VERSION=$(get_env go-version)
100108
export PATH=$PATH:/usr/local/go/bin
@@ -126,6 +134,14 @@ static-scan:
126134
echo "Skipping static-scan. This is a test run only"
127135
exit 0
128136
fi
137+
138+
RELEASE_ACCEPTANCE_TEST=$(get_env release-acceptance-test)
139+
RELEASE_ACCEPTANCE_TEST="$(echo "$RELEASE_ACCEPTANCE_TEST" | tr '[:upper:]' '[:lower:]')"
140+
141+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
142+
echo "Skipping static-scan. This run is for a release acceptance test only."
143+
exit 0
144+
fi
129145
130146
BRANCH=$(get_env branch)
131147
read -r SONAR_HOST_URL <<< "$(get_env sonarqube | jq -r '.parameters.dashboard_url' | sed 's:/*$::')"
@@ -210,6 +226,8 @@ containerize:
210226
211227
PERIODIC_SCAN=$(get_env periodic-rescan)
212228
PERIODIC_SCAN="$(echo "$PERIODIC_SCAN" | tr '[:upper:]' '[:lower:]')"
229+
RELEASE_ACCEPTANCE_TEST=$(get_env release-acceptance-test)
230+
RELEASE_ACCEPTANCE_TEST="$(echo "$RELEASE_ACCEPTANCE_TEST" | tr '[:upper:]' '[:lower:]')"
213231
# Build images
214232
export PIPELINE_USERNAME=$(get_env ibmcloud-api-user)
215233
export PIPELINE_PASSWORD=$(get_env ibmcloud-api-key-staging)
@@ -234,8 +252,19 @@ containerize:
234252
echo "skopeo version"
235253
skopeo --version || exit 1
236254
255+
BUILD_RELEASE_TARGET_FROM_KNOWN_IMAGES="false"
237256
if [[ ! -z "$PERIODIC_SCAN" && "$PERIODIC_SCAN" != "false" && "$PERIODIC_SCAN" != "no" ]]; then
238-
echo "Skipping containerize, but generating list of images. This is a periodic run that is only meant to produce CVE information."
257+
echo "This is a periodic run that is only meant to produce CVE information."
258+
BUILD_RELEASE_TARGET_FROM_KNOWN_IMAGES="true"
259+
fi
260+
261+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
262+
echo "This run is for a release acceptance test only."
263+
BUILD_RELEASE_TARGET_FROM_KNOWN_IMAGES="true"
264+
fi
265+
266+
if [[ "$BUILD_RELEASE_TARGET_FROM_KNOWN_IMAGES" == "true" ]]; then
267+
echo "Skipping containerize, but generating list of images."
239268
RELEASE_TARGET=$(curl --silent "https://api.github.com/repos/WASdev/websphere-liberty-operator/releases/latest" | jq -r .tag_name)
240269
#RELEASE_TARGET=$(get_env branch)
241270
else
@@ -428,6 +457,16 @@ sign-artifact:
428457
exit 0
429458
fi
430459
460+
RELEASE_ACCEPTANCE_TEST=$(get_env release-acceptance-test)
461+
RELEASE_ACCEPTANCE_TEST="$(echo "$RELEASE_ACCEPTANCE_TEST" | tr '[:upper:]' '[:lower:]')"
462+
463+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
464+
echo "Skipping sign-artifact. This run is for a release acceptance test only."
465+
exit 0
466+
fi
467+
468+
469+
431470
deploy:
432471
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
433472
script: |
@@ -472,6 +511,14 @@ dynamic-scan:
472511
echo "Skipping static-scan. This is a test run only"
473512
exit 0
474513
fi
514+
515+
RELEASE_ACCEPTANCE_TEST=$(get_env release-acceptance-test)
516+
RELEASE_ACCEPTANCE_TEST="$(echo "$RELEASE_ACCEPTANCE_TEST" | tr '[:upper:]' '[:lower:]')"
517+
518+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
519+
echo "Skipping dynamic-scan. This run is for a release acceptance test only."
520+
exit 0
521+
fi
475522
476523
#export APP_URL=$(cat ../app-url)
477524
# feature preview this until evidence locker v2 usage is full feature ready
@@ -536,6 +583,14 @@ scan-artifact:
536583
echo "Skipping static-scan. This is a test run only"
537584
exit 0
538585
fi
586+
587+
RELEASE_ACCEPTANCE_TEST=$(get_env release-acceptance-test)
588+
RELEASE_ACCEPTANCE_TEST="$(echo "$RELEASE_ACCEPTANCE_TEST" | tr '[:upper:]' '[:lower:]')"
589+
590+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
591+
echo "Skipping scan-artifact. This run is for a release acceptance test only."
592+
exit 0
593+
fi
539594
540595
# ========== Security Scanner ==========
541596
./scripts/pipeline/ci_to_secure_pipeline_scan.sh
@@ -564,6 +619,14 @@ release:
564619
exit 0
565620
fi
566621
622+
RELEASE_ACCEPTANCE_TEST=$(get_env release-acceptance-test)
623+
RELEASE_ACCEPTANCE_TEST="$(echo "$RELEASE_ACCEPTANCE_TEST" | tr '[:upper:]' '[:lower:]')"
624+
625+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
626+
echo "Skipping release. This run is for a release acceptance test only."
627+
exit 0
628+
fi
629+
567630
RELEASE_FLAG=$(get_env release "false")
568631
569632
if [[ $RELEASE_FLAG != "true" ]]; then

scripts/acceptance-test.sh

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ declare -A E2E_TESTS=(
2424
--env CLUSTER_TOKEN=${CLUSTER_TOKEN} \
2525
--env TRAVIS_BUILD_NUMBER=${BUILD_NUMBER} \
2626
--env RELEASE_TARGET=${RELEASE_TARGET} \
27-
--env CATALOG_IMAGE=${PIPELINE_REGISTRY}/${PIPELINE_OPERATOR_IMAGE}-catalog:${RELEASE_TARGET} \
27+
--env CATALOG_IMAGE=${CATALOG_IMAGE} \
2828
--env DEBUG_FAILURE=${DEBUG_FAILURE} \
2929
--env INSTALL_MODE=${INSTALL_MODE} \
3030
--env ARCHITECTURE=${ARCHITECTURE} \
@@ -63,10 +63,40 @@ done
6363

6464
echo "****** Waiting for e2e tests to finish"
6565
for test in "${!E2E_TESTS[@]}"; do
66-
until docker ps --all --no-trunc --filter name="^/${test}$" --format='{{.Status}}' | grep -q Exited; do
67-
sleep 60
68-
done
69-
echo "${test} finished"
66+
67+
# Establish monitoring variables
68+
monitorLoop=false
69+
monitorCount=1
70+
monitorMax=240 # Set for 240 minutes, or 4 hours
71+
72+
# wait until we are told to exit the loop either by exceeding runtime or getting an exited notice
73+
until [ "$monitorLoop" = true ]; do
74+
75+
# sleep 60 seconds
76+
sleep 60
77+
78+
# increment counter
79+
((monitorCount++))
80+
81+
# check to see if we've exceeded time
82+
if (($monitorCount>$monitorMax)); then
83+
monitorLoop=true
84+
echo "****** The max time to wait for the e2e tests to finish has elapsed"
85+
fi
86+
87+
# check to see if tests have completed
88+
status="$(docker ps --all --no-trunc --filter name="^/${test}$" --format='{{.Status}}')"
89+
if ( echo "${status}" | grep -q "Exited" ); then
90+
monitorLoop=true
91+
echo "****** The e2e tests have completed"
92+
fi
93+
done
94+
95+
#until docker ps --all --no-trunc --filter name="^/${test}$" --format='{{.Status}}' | grep -q Exited; do
96+
# sleep 60
97+
#done
98+
99+
echo "****** e2e test '${test}' have completed"
70100
docker logs ${test}
71101
done
72102

scripts/pipeline/runTest.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ oc login --insecure-skip-tls-verify $clusterurl -u kubeadmin -p $token
1414
echo "Open Shift Console:"
1515
console=$(oc whoami --show-console)
1616
echo $console
17-
echo "*** after issuing oc login"
18-
operators/scripts/configure-cluster/configure-cluster.sh -p $token -k $(get_env ibmcloud-api-key-staging) --arch $arch -A
17+
echo "*** after issuing oc login"
18+
RELEASE_ACCEPTANCE_TEST=$(get_env release-acceptance-test)
19+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
20+
CLUSTER_CONFIG_OPTIONS=" --skip-create-icsp"
21+
fi
22+
operators/scripts/configure-cluster/configure-cluster.sh -p $token -k $(get_env ibmcloud-api-key-staging) --arch $arch -A $CLUSTER_CONFIG_OPTIONS
1923

2024
export GO_VERSION=$(get_env go-version)
2125
make setup-go GO_RELEASE_VERSION=$GO_VERSION
@@ -45,8 +49,17 @@ export FYRE_PASS=$(get_env fyre-pass)
4549
export FYRE_PRODUCT_GROUP_ID=$(get_env fyre-product-group-id)
4650

4751
echo "${PIPELINE_PASSWORD}" | docker login "${PIPELINE_REGISTRY}" -u "${PIPELINE_USERNAME}" --password-stdin
48-
IMAGE="${PIPELINE_REGISTRY}/${PIPELINE_OPERATOR_IMAGE}:${RELEASE_TARGET}"
49-
echo "one-pipline Image value: ${IMAGE}"
52+
if [[ ! -z "$RELEASE_ACCEPTANCE_TEST" && "$RELEASE_ACCEPTANCE_TEST" != "false" && "$RELEASE_ACCEPTANCE_TEST" != "no" ]]; then
53+
RELEASE_TARGET=$(curl --silent "https://api.github.com/repos/WASdev/websphere-liberty-operator/releases/latest" | jq -r .tag_name)
54+
PIPELINE_PRODUCTION_IMAGE=$(get_env pipeline-production-image)
55+
IMAGE="${PIPELINE_PRODUCTION_IMAGE}:${RELEASE_TARGET}"
56+
export CATALOG_IMAGE="${PIPELINE_PRODUCTION_IMAGE}-catalog:${RELEASE_TARGET}"
57+
else
58+
IMAGE="${PIPELINE_REGISTRY}/${PIPELINE_OPERATOR_IMAGE}:${RELEASE_TARGET}"
59+
export CATALOG_IMAGE="${PIPELINE_REGISTRY}/${PIPELINE_OPERATOR_IMAGE}-catalog:${RELEASE_TARGET}"
60+
fi
61+
echo "one-pipeline Image value: ${IMAGE}"
62+
echo "one-pipeline Catalog Image value: ${CATALOG_IMAGE}"
5063
DIGEST="$(skopeo inspect docker://$IMAGE | grep Digest | grep -o 'sha[^\"]*')"
5164

5265
export DIGEST

0 commit comments

Comments
 (0)