From 04353d1b0bd65d5dda0a30be331f607374d63c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Ezr?= Date: Fri, 21 Jul 2023 07:58:29 +0200 Subject: [PATCH] ci: Include IB frontend and stub an image (#282) Add deployment of Image builder to ephemeral during our PR checks Add a stubbed Image into database directly. For now this image is static, rebuilding it will be a followup PR. --- .rhcicd/pr_check.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.rhcicd/pr_check.sh b/.rhcicd/pr_check.sh index dc135f09..cf5584a6 100755 --- a/.rhcicd/pr_check.sh +++ b/.rhcicd/pr_check.sh @@ -36,8 +36,35 @@ CICD_URL=https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd curl -s $CICD_URL/bootstrap.sh > .cicd_bootstrap.sh && source .cicd_bootstrap.sh # Run ui tests +export EXTRA_DEPLOY_ARGS="image-builder-crc" source "${CICD_ROOT}/deploy_ephemeral_env.sh" export COMPONENT_NAME="provisioning-backend" + +oc project $NAMESPACE + +# ADD the image stubs +orgID="0369233" +accountID="3340851" + +dbPod=$(oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep 'image-builder-db') + +# AWS stub +imageID="6c0cd30a-d306-4105-aae6-0548c20b9a0a" # created on 2023-07-19 +imageName="pipeline-aws" + +composeRequestAWSJson='{"image_name": "'$imageName'", "distribution": "rhel-92", "customizations": {}, "image_requests": [{"image_type": "aws", "architecture": "x86_64", "upload_request": {"type": "aws", "options": {"share_with_accounts": ["093942615996"]}}}]}' +oc exec $dbPod -- psql -d image-builder -c "INSERT INTO public.composes (job_id, request, created_at, account_number, org_id, image_name, deleted) VALUES +('$imageID', '$composeRequestAWSJson', '$(date +"%Y-%m-%d %T")', '$orgID', '$accountID', '$imageName', false);" + +# GCP stub +imageID="90be7a52-24d5-4bf1-97e7-cb2b8b2f482b" # created on 2023-07-18 +imageName="pipeline-gcp" + +composeRequestGCPJson='{"image_name": "'$imageName'", "distribution": "rhel-92", "customizations": {}, "image_requests": [{"image_type": "gcp", "architecture": "x86_64", "upload_request": {"type": "gcp", "options": {"share_with_accounts": ["user:oezr@redhat.com"]}}}]}' +oc exec $dbPod -- psql -d image-builder -c "INSERT INTO public.composes (job_id, request, created_at, account_number, org_id, image_name, deleted) VALUES +('$imageID', '$composeRequestGCPJson', '$(date +"%Y-%m-%d %T")', '$orgID', '$accountID', '$imageName', false);" + + source "${CICD_ROOT}/cji_smoke_test.sh" source "${CICD_ROOT}/post_test_results.sh"