Updated RT and Xray version and republished modules

This commit is contained in:
Giridharan Ramasamy
2021-12-10 22:58:14 +05:30
parent b07ed9caf7
commit 5db36fbe8b
3 changed files with 268 additions and 226 deletions

View File

@@ -15,39 +15,38 @@ trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT
regions=( us-east-1 us-east-2 us-west-1 us-west-2 sa-east-1 ca-central-1 eu-central-1 eu-west-1 eu-west-2 eu-west-3 eu-north-1 ap-northeast-3 ap-northeast-2 ap-northeast-1 ap-south-1 ap-southeast-1 ap-southeast-2 )
folders=( JFrog__Artifactory__ExistingVpc__MODULE JFrog__Artifactory__NewVpc__MODULE )
modules=( JFrog::Artifactory::ExistingVpc::MODULE JFrog::Artifactory::NewVpc::MODULE )
PROFILE=seller
for i in "${!regions[@]}"; do
export REGION="${regions[$i]}"
for j in "${!folders[@]}"; do
export FOLDER="${folders[$j]}"
export MODULE="${modules[$j]}"
export VERSION=$( aws cloudformation list-type-versions --profile $PROFILE --type MODULE --type-name $MODULE --region $REGION | jq .TypeVersionSummaries[-1].VersionId | tr -d "\"")
export VERSION=$( aws cloudformation list-type-versions --type MODULE --type-name $MODULE --region $REGION | jq '.TypeVersionSummaries[-1].VersionId' | tr -d "\"")
printf "1. start : %s:%s:%s\n" "$REGION" "$MODULE" "$VERSION"
cd /mnt/c/ddrive/projects/JFrog-Cloud-Installers/Amazon/cloudformation-modules/$FOLDER
cd Amazon/cloudformation-modules/$FOLDER
printf "2. submitting : %s:%s:%s\n" "$REGION" "$MODULE" "$VERSION"
cfn submit --set-default --region $REGION
export VERSION=$( aws cloudformation list-type-versions --profile $PROFILE --type MODULE --type-name $MODULE --region $REGION | jq .TypeVersionSummaries[-1].VersionId | tr -d "\"")
export VERSION=$( aws cloudformation list-type-versions --type MODULE --type-name $MODULE --region $REGION | jq '.TypeVersionSummaries[-1].VersionId' | tr -d "\"")
printf "3. submit done : %s:%s:%s\n" "$REGION" "$MODULE" "$VERSION"
ARN=$(echo arn:aws:cloudformation:$REGION:595206835686:type/module/$MODULE | sed 's/::/-/g')
printf "4. starting test: %s:%s:%s:%s\n" "$REGION" "$MODULE" "$VERSION" "$ARN"
aws Uno test-type --profile $PROFILE --region $REGION --type MODULE --arn $ARN # --public-version-number OPTIONAL_READ_NOTE_ABOVE
echo $(aws cloudformation test-type --region $REGION --type MODULE --arn $ARN) # --public-version-number OPTIONAL_READ_NOTE_ABOVE
typeTestStatus=""
while [ "$typeTestStatus" != "\"PASSED\"" ]
do
# aws Uno describe-type --profile $PROFILE --region $REGION --type MODULE --arn $ARN/$VERSION
typeTestStatus=$(aws Uno describe-type --profile $PROFILE --type MODULE --region $REGION --arn $ARN/$VERSION | jq .TypeTestsStatus)
typeTestStatus=$(aws cloudformation describe-type --type MODULE --region $REGION --arn $ARN/$VERSION | jq '.TypeTestsStatus')
echo "typeTestStatus : $typeTestStatus"
sleep 5
done
printf "5. publishing : %s:%s:%s\n" "$REGION" "$MODULE" "$VERSION"
aws Uno publish-type --profile $PROFILE --region $REGION --type MODULE --arn $ARN # --public-version-number OPTIONAL_READ_NOTE_ABOVE
echo $(aws cloudformation publish-type --region $REGION --type MODULE --arn $ARN) # --public-version-number OPTIONAL_READ_NOTE_ABOVE
printf "6. published : %s:%s:%s\n" "$REGION" "$MODULE" "$VERSION"
cd ../../..
done
done
done