Skip to content

Commit f7c81fa

Browse files
author
Sean Sundberg
committed
Updates verify logic:
1 parent 1879196 commit f7c81fa

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.github/scripts/validate-deploy.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,38 @@ VPC_NAME="${PREFIX_NAME}-vpc"
99

1010
ibmcloud login -r "${TF_VAR_region}" -g "${TF_VAR_resource_group_name}" --apikey "${TF_VAR_ibmcloud_api_key}"
1111

12-
set -e
13-
12+
echo "Retrieving VPC_ID for name: ${VPC_NAME}"
1413
VPC_ID=$(ibmcloud is vpcs | grep "${VPC_NAME}" | sed -E "s/^([A-Za-z0-9-]+).*/\1/g")
1514

1615
if [[ -z "${VPC_ID}" ]]; then
1716
echo "VPC id not found: ${VPC_NAME}"
1817
exit 1
1918
fi
2019

21-
ibmcloud is vpc "${VPC_ID}"
20+
echo "Retrieving VPC info for id: ${VPC_ID}"
21+
if ! ibmcloud is vpc "${VPC_ID}"; then
22+
echo "Unable to find vpc for id: ${VPC_ID}"
23+
exit 1
24+
fi
2225

26+
echo "Retrieving VPC subnets for VPC: ${VPC_NAME}"
2327
SUBNETS=$(ibmcloud is subnets | grep "${VPC_NAME}")
2428

2529
if [[ -z "${SUBNETS}" ]]; then
2630
echo "Subnets not found: ${VPC_NAME}"
2731
exit 1
2832
fi
2933

30-
if [[ "${PUBLIC_GATEWAY}" == "true" ]]; then
31-
PGS=$(ibmcloud is pubgws | grep "${VPC_NAME}")
34+
echo "Retrieving public gateways for VPC: ${VPC_NAME}"
35+
ibmcloud is pubgws | grep "${VPC_NAME}"
36+
PGS=$(ibmcloud is pubgws | grep "${VPC_NAME}")
3237

33-
if [[ -z "${PGS}" ]]; then
34-
echo "Public gateways not found: ${VPC_NAME}"
35-
exit 1
36-
fi
37-
else
38-
PGS=$(ibmcloud is pubgws | grep "${VPC_NAME}")
39-
40-
if [[ -n "${PGS}" ]]; then
41-
echo "Public gateways found: ${VPC_NAME}"
42-
exit 1
43-
fi
38+
if [[ "${PUBLIC_GATEWAY}" == "true" ]] && [[ -z "${PGS}" ]]; then
39+
echo "Public gateways not found: ${VPC_NAME}"
40+
exit 1
41+
elif [[ "${PUBLIC_GATEWAY}" == "false" ]] && [[ -n "${PGS}" ]]; then
42+
echo "Public gateways found: ${VPC_NAME}"
43+
exit 1
4444
fi
4545

4646
exit 0

.github/workflows/verify.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
prefix-name: [garage-module-test]
2222
apply: [true, false]
2323
public-gateway: [true, false]
24-
max-parallel: 1
24+
#max-parallel: 1
2525
fail-fast: true
2626

2727
env:

0 commit comments

Comments
 (0)