Skip to content

Commit b94d161

Browse files
davco01aidlewisyongja79
authored
Multi arch support (#485)
* gara sign * cd pipeline and mult-arch * jenkins file updates * rco updates * rco updates * delete unneeded files * test branch * review and fix * fix * to rco * replace from main * fix from Melissa * fix * rco demand ID * linter * Sync scripts, Makefile and Dockerfile with WLO With modifications to work with RCO * ocp cluster sync * quoted * comment out problem line * Add supported architecture labels to CSV * Add node affinity for manager deployment * Changes to all multi arch automated testing * Missing env added * Final makefile tweaks * change Z plan * debug * not needed use UA now * remove cat of private key --------- Co-authored-by: ilewis <[email protected]> Co-authored-by: Jason Yong <[email protected]>
1 parent 63075c4 commit b94d161

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1851
-2802
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
type: pipeline_definition
2+
product: Liberty
3+
name: Runtime Componet Operator Docker Build
4+
description: A build to run the websphere-liberty operator docker container build
5+
triggers:
6+
- type: manual
7+
triggerName: "rcodocker"
8+
propertyDefinitions:
9+
- name: RELEASE_TARGET
10+
defaultValue: "main"
11+
- name: command
12+
defaultValue: "make build-operator-pipeline REGISTRY=cp.stg.icr.io"
13+
14+
steps:
15+
- stepName: Z Build
16+
workType: Jenkins
17+
projectName: ebcDockerBuilderRCO
18+
timeoutInMinutes: 1440
19+
# Need properties for Makefile or build script for WLO
20+
properties:
21+
ebcPlan: svl-dockerJenkins-ubuntu20_s390x.yml
22+
23+
24+
- stepName: P Build
25+
workType: Jenkins
26+
projectName: ebcDockerBuilderRCO
27+
timeoutInMinutes: 1440
28+
# Need properties for Makefile or build script for WLO
29+
properties:
30+
ebcPlan: svl-dockerJenkins-ubuntu20_ppcle.yml

.one-pipeline-cd.yaml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Documentation on available configuration
2+
# https://pages.github.ibm.com/one-pipeline/docs/custom-scripts.html
3+
4+
version: "1"
5+
6+
setup:
7+
dind: true
8+
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
9+
script: |
10+
#!/usr/bin/env bash
11+
echo "setup stage"
12+
skopeo --version || exit 1
13+
INVENTORY_PATH="$(get_env inventory-path)"
14+
INVENTORY_ENTRIES_PATH="$WORKSPACE/$(get_env INVENTORY_ENTRIES_PATH)"
15+
INVENTORY_ENTRIES=$(cat "${INVENTORY_ENTRIES_PATH}")
16+
echo "$(get_env ibmcloud-api-key-staging)" | docker login "$(get_env staging-registry)" -u "$(get_env ibmcloud-api-user)" --password-stdin
17+
for INVENTORY_ENTRY in $(echo "${INVENTORY_ENTRIES}" | jq -r '.[] '); do
18+
APP=$(cat "${INVENTORY_PATH}/${INVENTORY_ENTRY}")
19+
ARTIFACT=$(echo "${APP}" | jq -r '.artifact')
20+
DIGEST=$(echo "${APP}" | jq -r '.sha256' )
21+
22+
echo "${ARTIFACT}"
23+
echo "${DIGEST}"
24+
echo "${APP}" | jq '.'
25+
26+
SAVED_DIGEST="$(skopeo inspect docker://$ARTIFACT | grep Digest | grep -o 'sha[^\"]*')"
27+
if [[ ${DIGEST} == ${SAVED_DIGEST} ]]; then
28+
echo "Image, $ARTIFACT, passes validation"
29+
else
30+
echo "Image, $ARTIFACT, does not exist or digests do not match"
31+
exit 1
32+
fi
33+
done
34+
35+
deploy:
36+
dind: true
37+
image: icr.io/continuous-delivery/pipeline/pipeline-base-ubi:3.12
38+
script: |
39+
#!/usr/bin/env bash
40+
if [[ "$PIPELINE_DEBUG" == 1 ]]; then
41+
trap env EXIT
42+
env
43+
set -x
44+
fi
45+
echo "deploy stage"
46+
skopeo --version || exit 1
47+
TARGET_ENVIRONMENT="$(get_env environment)"
48+
INVENTORY_PATH="$(get_env inventory-path)"
49+
INVENTORY_ENTRIES_PATH="$WORKSPACE/$(get_env INVENTORY_ENTRIES_PATH)"
50+
INVENTORY_ENTRIES=$(cat "${INVENTORY_ENTRIES_PATH}")
51+
52+
echo "Target environment: ${TARGET_ENVIRONMENT}"
53+
echo "Inventory entries"
54+
echo ""
55+
56+
echo "$INVENTORY_ENTRIES" | jq '.'
57+
58+
echo ""
59+
echo "Inventory content"
60+
echo ""
61+
62+
ls -la ${INVENTORY_PATH}
63+
64+
for INVENTORY_ENTRY in $(echo "${INVENTORY_ENTRIES}" | jq -r '.[] '); do
65+
APP=$(cat "${INVENTORY_PATH}/${INVENTORY_ENTRY}")
66+
ARTIFACT=$(echo "${APP}" | jq -r '.artifact')
67+
NAME=$(echo "${APP}" | jq -r '.name')
68+
DIGEST=$(echo "${APP}" | jq -r '.sha256' )
69+
TYPE=$(echo "${APP}" | jq -r '.type' )
70+
REPO=$(echo "${APP}" | jq -r '.repository_url' ).git
71+
COMMIT=$(echo "${APP}" | jq -r '.commit_sha' )
72+
echo "${ARTIFACT}"
73+
#echo "${ARTIFACT##*/}"
74+
IMAGE_NAME="${ARTIFACT##*/}"
75+
echo "Image name: $IMAGE_NAME"
76+
PRODUCTION_IMAGE=$(get_env production-registry)/$(get_env production-namespace)/$IMAGE_NAME
77+
echo "Production image: $PRODUCTION_IMAGE"
78+
echo "skopeo copy --all --src-creds $(get_env source-user):$(get_env source-key) --dest-creds $(get_env dest-user):$(get_env dest-key) docker://${ARTIFACT} docker://${PRODUCTION_IMAGE}"
79+
skopeo copy --all --src-creds $(get_env source-user):$(get_env source-key) --dest-creds $(get_env dest-user):$(get_env dest-key) docker://${ARTIFACT} docker://${PRODUCTION_IMAGE}
80+
save_artifact $NAME type=$TYPE name="${PRODUCTION_IMAGE}" digest="$DIGEST" source="${REPO}#${COMMIT}"
81+
done
82+
83+
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
85+
script: |
86+
#!/usr/bin/env bash
87+
echo "sign-artifact stage"
88+
# image-signing
89+
set_env IMAGE_SIGNING_TASK_NAME "build-sign-artifact"
90+
set_env IMAGE_SIGNING_STEP_NAME "run-stage"
91+
"${COMMONS_PATH}"/ciso/sign_icr.sh
92+
fingerprint=$(/opt/Garantir/bin/gpg --homedir $HOME/.gnupggrs/ --fingerprint --with-colons | grep fpr | tr -d 'fpr:')
93+
echo "GNUPGHOME="$GNUPGHOME
94+
gpg2 --homedir $HOME/.gnupggrs --output rco.pub --armor --export $fingerprint
95+
save_file pub_file rco.pub
96+
cat rco.pub
97+
98+
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
100+
script: |
101+
#!/usr/bin/env bash
102+
echo "acceptance-test stage"
103+
load_file pub_file > rco.pub
104+
gpg2 --import rco.pub
105+
export fingerprint=$(gpg --fingerprint --with-colons | grep fpr | tr -d 'fpr:')
106+
echo "fingerprint=$fingerprint"
107+
mkdir -p images
108+
if which list_artifacts >/dev/null; then
109+
list_artifacts | while IFS= read -r artifact; do
110+
image_name="$(load_artifact "$artifact" "name")"
111+
type="$(load_artifact "$artifact" "type")"
112+
echo "type="$type
113+
if [[ "$type" == "image" ]]; then
114+
echo "Verifying image ${image_name}"
115+
skopeo copy --src-creds $(get_env dest-user):$(get_env dest-key) docker://${image_name} dir:./images
116+
skopeo standalone-verify ./images/manifest.json ${image_name} ${fingerprint} ./images/signature-1
117+
if [[ $? != 0 ]]; then
118+
exit 1
119+
fi
120+
rm images/*
121+
else
122+
echo "Skipping image ${image_name}"
123+
fi
124+
done
125+
fi
126+
127+
finish:
128+
image: icr.io/continuous-delivery/toolchains/devsecops/baseimage@sha256:2132bf3187b63496d119f61d375bbb656d0b3e4a664970478c44b527c4c058c5
129+
script: |
130+
#!/usr/bin/env bash
131+
echo "finish stage"
132+
./scripts/pipeline/cd_finish

0 commit comments

Comments
 (0)