Skip to content

Commit 35b8b7c

Browse files
fix: update DA to claim fscloud 1.6.0 profile (#8)
1 parent 534aca2 commit 35b8b7c

File tree

7 files changed

+100
-60
lines changed

7 files changed

+100
-60
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ offerings:
99
- name: banking
1010
mark_ready: true
1111
install_type: fullstack
12+
pre_validation: "tests/scripts/pre-validation.sh"
13+
post_validation: "tests/scripts/post-validation.sh"
1214
scc:
1315
instance_id: 1c7d5f78-9262-44c3-b779-b28fe4d88c37
1416
region: us-south
15-
scc:
16-
instance_id: 1c7d5f78-9262-44c3-b779-b28fe4d88c37
17-
region: us-south

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Primary owner should be listed first in list of global owners, followed by any secondary owners
2-
* @SirSpidey @ocofaigh
2+
* @brendankellyibm @ajainghub

ibm_catalog.json

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,68 +16,16 @@
1616
}
1717
],
1818
"flavors": [
19-
{
20-
"label": "Insurance Application",
21-
"name": "insurance",
22-
"working_directory": "./",
23-
"compliance": {
24-
"authority": "scc-v3",
25-
"controls": [
26-
{
27-
"profile": {
28-
"name": "IBM Cloud for Financial Services",
29-
"version": "1.4.0"
30-
},
31-
"names": [
32-
"SA-4(b)"
33-
]
34-
}
35-
]
36-
},
37-
"iam_permissions": [
38-
{
39-
"service_name": "iam-groups",
40-
"role_crns": [
41-
"crn:v1:bluemix:public:iam::::role:Administrator"
42-
]
43-
}
44-
],
45-
"architecture":[
46-
{
47-
"diagrams": [
48-
{
49-
"diagram": {
50-
"url_proxy": {
51-
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-rag-sample-da/main/reference-architecture/ce_da_architecture_diagram.drawio.svg"
52-
},
53-
"caption": "Diagram",
54-
"type": "image/svg+xml"
55-
},
56-
"description": "{Placeholder diagram}"
57-
}
58-
]
59-
}
60-
],
61-
"release_notes_url": "RELEASE NOTES URL",
62-
"outputs": [
63-
],
64-
"install_type": "fullstack"
65-
},
6619
{
6720
"label": "Banking Application",
6821
"name": "banking",
6922
"working_directory": "solutions/banking",
7023
"compliance": {
7124
"authority": "scc-v3",
72-
"controls": [
25+
"profiles": [
7326
{
74-
"profile": {
75-
"name": "IBM Cloud for Financial Services",
76-
"version": "1.4.0"
77-
},
78-
"names": [
79-
"SA-4(b)"
80-
]
27+
"profile_name": "IBM Cloud Framework for Financial Services",
28+
"profile_version": "1.6.0"
8129
}
8230
]
8331
},

tests/pr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
const bankingSolutionsDir = "solutions/banking"
21-
const region = "us-south" // Binding all the resources to the us-south locaiton.
21+
const region = "us-south" // Binding all the resources to the us-south location.
2222

2323
const resourceGroup = "geretain-test-resources"
2424

tests/resources/existing-resources/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ resource "ibm_resource_instance" "discovery_instance" {
4949
# Pipeline resources
5050
########################################################################################################################
5151

52+
resource "ibm_resource_instance" "cd_instance" {
53+
name = "${var.prefix}-cd-instance"
54+
service = "continuous-delivery"
55+
plan = "professional"
56+
location = var.region
57+
resource_group_id = module.resource_group.resource_group_id
58+
}
59+
5260
resource "ibm_cd_toolchain" "cd_toolchain_instance" {
61+
depends_on = [ibm_resource_instance.cd_instance]
5362
name = "${var.prefix}-toolchain-instance"
5463
resource_group_id = module.resource_group.resource_group_id
5564
}

tests/scripts/post-validation.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#! /bin/bash
2+
3+
########################################################################################################################
4+
## This script is used by the catalog pipeline to destroy the RAG DA resources. ##
5+
########################################################################################################################
6+
7+
set -e
8+
9+
TERRAFORM_SOURCE_DIR="tests/resources/existing-resources"
10+
TF_VARS_FILE="terraform.tfvars"
11+
12+
(
13+
cd ${TERRAFORM_SOURCE_DIR}
14+
echo "Destroying prerequisite RAG DA resources..."
15+
terraform destroy -input=false -auto-approve -var-file=${TF_VARS_FILE} || exit 1
16+
17+
echo "Post-validation complete successfully"
18+
)

tests/scripts/pre-validation.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#! /bin/bash
2+
3+
########################################################################################################################
4+
## This script is used by the catalog pipeline to deploy the RAG DA resources. #
5+
########################################################################################################################
6+
7+
set -e
8+
9+
DA_DIR="solutions/banking"
10+
TERRAFORM_SOURCE_DIR="tests/resources/existing-resources"
11+
JSON_FILE="${DA_DIR}/catalogValidationValues.json"
12+
REGION="us-south"
13+
TF_VARS_FILE="terraform.tfvars"
14+
15+
(
16+
cwd=$(pwd)
17+
cd ${TERRAFORM_SOURCE_DIR}
18+
echo "Provisioning prerequisite RAG DA resources..."
19+
terraform init || exit 1
20+
{
21+
# $VALIDATION_APIKEY is available in the catalog runtime
22+
echo "ibmcloud_api_key=\"${VALIDATION_APIKEY}\""
23+
echo "region=\"${REGION}\""
24+
} >> ${TF_VARS_FILE}
25+
terraform apply -input=false -auto-approve -var-file=${TF_VARS_FILE} || exit 1
26+
27+
toolchain_region_var_name="toolchain_region"
28+
ci_pipeline_id_var_name="ci_pipeline_id"
29+
cd_pipeline_id_var_name="cd_pipeline_id"
30+
watson_assistant_instance_id_var_name="watson_assistant_instance_id"
31+
watson_assistant_region_var_name="watson_assistant_region"
32+
watson_discovery_instance_id_var_name="watson_discovery_instance_id"
33+
watson_discovery_region_var_name="watson_discovery_region"
34+
35+
ci_pipeline_id_value=$(terraform output -state=terraform.tfstate -raw ci_pipeline_id)
36+
cd_pipeline_id_value=$(terraform output -state=terraform.tfstate -raw cd_pipeline_id)
37+
watson_assistant_instance_id_value=$(terraform output -state=terraform.tfstate -raw watson_assistant_instance_id)
38+
watson_discovery_instance_id_value=$(terraform output -state=terraform.tfstate -raw watson_discovery_instance_id)
39+
40+
echo "Appending required input variable values to ${JSON_FILE}.."
41+
42+
cd "${cwd}"
43+
jq -r --arg toolchain_region_var_name "${toolchain_region_var_name}" \
44+
--arg toolchain_region_value "${REGION}" \
45+
--arg ci_pipeline_id_var_name "${ci_pipeline_id_var_name}" \
46+
--arg ci_pipeline_id_value "${ci_pipeline_id_value}" \
47+
--arg cd_pipeline_id_var_name "${cd_pipeline_id_var_name}" \
48+
--arg cd_pipeline_id_value "${cd_pipeline_id_value}" \
49+
--arg watson_assistant_instance_id_var_name "${watson_assistant_instance_id_var_name}" \
50+
--arg watson_assistant_instance_id_value "${watson_assistant_instance_id_value}" \
51+
--arg watson_assistant_region_var_name "${watson_assistant_region_var_name}" \
52+
--arg watson_assistant_region_value "${REGION}" \
53+
--arg watson_discovery_instance_id_var_name "${watson_discovery_instance_id_var_name}" \
54+
--arg watson_discovery_instance_id_value "${watson_discovery_instance_id_value}" \
55+
--arg watson_discovery_region_var_name "${watson_discovery_region_var_name}" \
56+
--arg watson_discovery_region_value "${REGION}" \
57+
'. + {($toolchain_region_var_name): $toolchain_region_value,
58+
($ci_pipeline_id_var_name): $ci_pipeline_id_value,
59+
($cd_pipeline_id_var_name): $cd_pipeline_id_value,
60+
($watson_assistant_instance_id_var_name): $watson_assistant_instance_id_value,
61+
($watson_assistant_region_var_name): $watson_assistant_region_value,
62+
($watson_discovery_instance_id_var_name): $watson_discovery_instance_id_value,
63+
($watson_discovery_region_var_name): $watson_discovery_region_value}' "${JSON_FILE}" > tmpfile && mv tmpfile "${JSON_FILE}" || exit 1
64+
65+
echo "Pre-validation complete successfully"
66+
)

0 commit comments

Comments
 (0)