Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
resolve vg creation bug in smoke tests (#22)
Browse files Browse the repository at this point in the history
* add vg creation in rings smoketests

* add check for vg existence

* update functions.sh, and small clean up
  • Loading branch information
yradsmikham authored Apr 22, 2020
1 parent c188261 commit dcc828f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tests/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ function variable_group_exists () {
echo "The variable group $vg_name does not exist"
if [ "$action" == "fail" ]; then
exit 1
else
echo "Unable to $action variable group $vg_name".
fi
fi
}
Expand Down
8 changes: 4 additions & 4 deletions tests/infra-validations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ git commit -m "inital commit for TF Template Repo"
git tag "$tf_template_version"

# git remote rm origin
source=https://infra_account:$ACCESS_TOKEN_SECRET@$repo_url
source=https://infra_account:$ACCESS_TOKEN_SECRET@$repo_url
git remote add origin "$source"
echo "git push"
git push -u origin --all
Expand Down Expand Up @@ -137,7 +137,7 @@ sed -ri 's/^(\s*)(storage_account_name\s*:\s*<storage account name>\s*$)/\1stora

# Create remote repo for Infra HLD ------------------
# Add pipeline yml fo generation verification
echo "Copying generate pipeline validation yml to Infra HLD repo from $generate_pipeline_path"
echo "Copying generate pipeline validation yml to Infra HLD repo from $generate_pipeline_path"
# Copy from current directory (pipeline) otherwise copy from azure-pipelines/templates (local)
cp $generate_pipeline_path . || cp $generate_pipeline_path_local .
git init
Expand All @@ -161,7 +161,7 @@ git commit -m "inital commit for HLD Infra Repo"
git tag "$infra_hld_version"

# git remote rm origin
infra_source=https://infra_account:$ACCESS_TOKEN_SECRET@$repo_url
infra_source=https://infra_account:$ACCESS_TOKEN_SECRET@$repo_url
git remote add origin "$infra_source"
echo "git push"
git push -u origin --all
Expand Down Expand Up @@ -192,7 +192,7 @@ git commit -m "inital commit for Generated Infra Repo"
git tag "$infra_generated_version"

# git remote rm origin
source=https://infra_account:$ACCESS_TOKEN_SECRET@$repo_url
source=https://infra_account:$ACCESS_TOKEN_SECRET@$repo_url
git remote add origin "$source"
echo "git push"
git push -u origin --all
Expand Down
8 changes: 7 additions & 1 deletion tests/validations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,14 @@ acr_name=$ACR_NAME
create_helm_chart_v2 $TEST_WORKSPACE
cd "$TEST_WORKSPACE/$mono_repo_dir"

# Commented code below is for external repo helm charts. Currently doesn't work.
# Check to see if 'bedrock-cli-vg-test' exists, if so, delete it and recreate.
variable_group_exists $AZDO_ORG_URL $AZDO_PROJECT bedrock-cli-vg-test "delete"
az pipelines variable-group create --name "bedrock-cli-vg-test" --authorize true --organization $AZDO_ORG_URL --project $AZDO_PROJECT --variables "FOO=BAR" "BAR=BAZ"

# Verify the variable group was created. Fail if not
variable_group_exists $AZDO_ORG_URL $AZDO_PROJECT bedrock-cli-vg-test "fail"

# Commented code below is for external repo helm charts. Currently doesn't work.
# helm_repo_url="$AZDO_ORG_URL/$AZDO_PROJECT/_git/$helm_charts_dir"
local_repo_url="$AZDO_ORG_URL/$AZDO_PROJECT/_git/$mono_repo_dir"
spk service create $FrontEnd $FrontEnd -d $services_dir -p "chart" -g $local_repo_url -b master --service-build-vg bedrock-cli-vg-test --service-build-variables FOO,BAR >> $TEST_WORKSPACE/log.txt
Expand Down

0 comments on commit dcc828f

Please sign in to comment.