Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions .github/scripts/deploy_api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,31 +150,31 @@ else
echo "Would call ${instance_put_lambda}"
fi

# if [[ "${APIGEE_ENVIRONMENT}" == "int" ]]; then
# echo
# echo "Deploy the API spec to prod catalogue as it is int environment"
# if [[ "${DRY_RUN}" == "false" ]]; then
# jq -n --argfile spec "${SPEC_PATH}" \
# --arg apiName "${apigee_api}" \
# --arg apiClient "${apigee_client}" \
# --arg environment "prod" \
# --arg instance "${instance}" \
# --arg kid "${PROXYGEN_KID}" \
# --arg proxygenSecretName "${proxygen_private_key_arn}" \
# '{apiName: $apiName, apiClient: $apiClient, environment: $environment, specDefinition: $spec, instance: $instance, kid: $kid, proxygenSecretName: $proxygenSecretName}' > payload.json

# aws lambda invoke --function-name "${spec_publish_lambda}" --cli-binary-format raw-in-base64-out --payload file://payload.json out.txt > response.json

# if eval "cat response.json | jq -e '.FunctionError' >/dev/null"; then
# echo 'Error calling lambda'
# cat out.txt
# exit 1
# fi
# echo "Spec deployed"
# else
# echo "Would call ${spec_publish_lambda}"
# fi
# fi
if [[ "${APIGEE_ENVIRONMENT}" == "int" ]]; then
echo
echo "Deploy the API spec to prod catalogue as it is int environment"
if [[ "${DRY_RUN}" == "false" ]]; then
jq -n --argfile spec "${SPEC_PATH}" \
--arg apiName "${apigee_api}" \
--arg apiClient "${apigee_client}" \
--arg environment "prod" \
--arg instance "${instance}" \
--arg kid "${PROXYGEN_KID}" \
--arg proxygenSecretName "${proxygen_private_key_arn}" \
'{apiName: $apiName, apiClient: $apiClient, environment: $environment, specDefinition: $spec, instance: $instance, kid: $kid, proxygenSecretName: $proxygenSecretName}' > payload.json

aws lambda invoke --function-name "${spec_publish_lambda}" --cli-binary-format raw-in-base64-out --payload file://payload.json out.txt > response.json

if eval "cat response.json | jq -e '.FunctionError' >/dev/null"; then
echo 'Error calling lambda'
cat out.txt
exit 1
fi
echo "Spec deployed"
else
echo "Would call ${spec_publish_lambda}"
fi
fi

if [[ "${APIGEE_ENVIRONMENT}" == "internal-dev" && "${IS_PULL_REQUEST}" == "false" ]]; then
echo
Expand Down