diff --git a/packages/deployer/test/records/application-deployment-removal-request.yml b/packages/deployer/test/records/application-deployment-removal-request.yml new file mode 100644 index 0000000..b0082da --- /dev/null +++ b/packages/deployer/test/records/application-deployment-removal-request.yml @@ -0,0 +1,4 @@ +record: + deployment: + type: ApplicationDeploymentRemovalRequest + version: 1.0.0 diff --git a/packages/deployer/test/test-webapp-deployment.sh b/packages/deployer/test/test-webapp-deployment.sh index a05cfd8..8bb2ac6 100755 --- a/packages/deployer/test/test-webapp-deployment.sh +++ b/packages/deployer/test/test-webapp-deployment.sh @@ -123,10 +123,11 @@ while true; do fi done -fetched_application_record_id=$(echo $deployment_records_response | jq -r '.[0].attributes.application') -fetched_url=$(echo $deployment_records_response | jq -r '.[0].attributes.url') +DEPLOYMENT_RECORD_ID=$(echo $deployment_records_response | jq -r '.[0].id') +echo $DEPLOYMENT_RECORD_ID # Check if ApplicationDeploymentRecord has the correct record id +fetched_application_record_id=$(echo $deployment_records_response | jq -r '.[0].attributes.application') if [ "$fetched_application_record_id" = "$RECORD_ID" ]; then echo "ApplicationRecord id matched" else @@ -135,6 +136,7 @@ else fi # Check if url present in ApplicationDeploymentRecord active +fetched_url=$(echo $deployment_records_response | jq -r '.[0].attributes.url') url_response=$(curl -s -o /dev/null -I -w "%{http_code}" "$fetched_url") if [ "$url_response" = "200" ]; then echo "Deployment URL $fetched_url is active" @@ -142,3 +144,54 @@ else echo "Deployment URL $fetched_url is not active, received code $url_response" exit 1 fi + +# Generate application-deployment-request.yml +REMOVAL_REQUEST_RECORD_FILE=packages/deployer/test/records/application-deployment-request.yml + +cat > $REMOVAL_REQUEST_RECORD_FILE <