File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ offerings:
99 - name : fully-configurable
1010 mark_ready : true
1111 install_type : fullstack
12+ pre_validation : " tests/scripts/pre-validation-deploy-cloud-logs.sh"
13+ post_validation : " tests/scripts/post-validation-destroy-cloud-logs.sh"
1214 scc :
1315 instance_id : 1c7d5f78-9262-44c3-b779-b28fe4d88c37
1416 region : us-south
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # ############################################################################################################
4+ # This script is used by the catalog pipeline to destroy the COS instance and VPC, which were provisioned #
5+ # as prerequisites for the fully configurable OCP VPC cluster that is published to the catalog. #
6+ # ############################################################################################################
7+
8+ set -e
9+
10+ TERRAFORM_SOURCE_DIR=" tests/resources"
11+ TF_VARS_FILE=" terraform.tfvars"
12+
13+ (
14+ cd " ${TERRAFORM_SOURCE_DIR} "
15+ echo " Destroying pre-requisite Cloud Logs instance..."
16+ terraform destroy -input=false -auto-approve -var-file=" ${TF_VARS_FILE} " || exit 1
17+ rm " ${TF_VARS_FILE} " || exit 1
18+
19+ echo " Post-validation completed successfully."
20+ )
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # ###########################################################################################################
4+ # # This script is used by the catalog pipeline to deploy the Cloud Logs instance
5+ # # which are the prerequisites for the fully-configurable AT Event Routing DA.
6+ # ###########################################################################################################
7+
8+ set -e
9+
10+ DA_DIR=" solutions/fully-configurable"
11+ TERRAFORM_SOURCE_DIR=" tests/resources"
12+ JSON_FILE=" ${DA_DIR} /catalogValidationValues.json"
13+ TF_VARS_FILE=" terraform.tfvars"
14+
15+ (
16+ cwd=$( pwd)
17+ cd ${TERRAFORM_SOURCE_DIR}
18+ echo " Provisioning pre-requisite Cloud Logs instance .."
19+ terraform init || exit 1
20+
21+ # $VALIDATION_APIKEY is available in the catalog runtime
22+ {
23+ echo " ibmcloud_api_key=\" ${VALIDATION_APIKEY} \" "
24+ echo " prefix=\" at-$( openssl rand -hex 2) \" "
25+ } >> ${TF_VARS_FILE}
26+ terraform apply -input=false -auto-approve -var-file=${TF_VARS_FILE} || exit 1
27+
28+ existing_cloud_logs_instance_crn=" existing_cloud_logs_instance_crn"
29+ existing_cloud_logs_instance_value=$( terraform output -state=terraform.tfstate -raw icl_crn)
30+
31+ echo " Appending '${existing_cloud_logs_instance_crn} ' input variable values to ${JSON_FILE} .."
32+
33+ cd " ${cwd} "
34+ jq -r --arg existing_cloud_logs_instance_crn " ${existing_cloud_logs_instance_crn} " \
35+ --arg existing_cloud_logs_instance_value " ${existing_cloud_logs_instance_value} " \
36+ ' . + {($existing_cloud_logs_instance_crn): $existing_cloud_logs_instance_value}' " ${JSON_FILE} " > tmpfile && mv tmpfile " ${JSON_FILE} " || exit 1
37+
38+ echo " Pre-validation completed successfully."
39+ )
You can’t perform that action at this time.
0 commit comments