File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
cfn-resources/flex-cluster/test Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ set -o nounset
99set -o pipefail
1010
1111function usage {
12- echo " usage:$0 <project_id >"
13- echo " Adjust flex cluster test input files "
12+ echo " usage:$0 <project_name >"
13+ echo " Generates test input files for flex cluster using an existing project "
1414 exit 0
1515}
1616
@@ -27,7 +27,15 @@ if [ ${MONGODB_ATLAS_PROFILE+x} ]; then
2727 profile=${MONGODB_ATLAS_PROFILE}
2828fi
2929
30- projectId=" ${1} "
30+ projectName=" ${1} "
31+ projectId=$( atlas projects list --output json | jq --arg NAME " ${projectName} " -r ' .results[] | select(.name==$NAME) | .id' )
32+ if [ -z " $projectId " ]; then
33+ echo " ERROR: Project \" ${projectName} \" does not exist. Please create the project first."
34+ exit 1
35+ else
36+ echo -e " FOUND project \" ${projectName} \" with id: ${projectId} \n"
37+ fi
38+
3139clusterName=" cfn-test-bot-$(( 1 + RANDOM % 10000 )) "
3240echo " clusterName: $clusterName "
3341
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # cfn-test-delete-inputs.sh
3+ #
4+ # Needs to exist to be called in Publish, but no cleanup is needed.
Original file line number Diff line number Diff line change @@ -13,4 +13,4 @@ projectId=$(atlas projects create "${projectName}" --output=json | jq -r '.id')
1313echo " projectId: $projectId "
1414echo " projectName: $projectName "
1515
16- ./test/cfn-test-create-inputs.sh " $projectId "
16+ ./test/cfn-test-create-inputs.sh " $projectName "
You can’t perform that action at this time.
0 commit comments