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

Commit

Permalink
Merge branch 'master' into abrig-vg-create
Browse files Browse the repository at this point in the history
  • Loading branch information
andrebriggs authored Apr 18, 2020
2 parents 5f30525 + 93ccc14 commit 266cb84
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/commands/infra/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export const generateClusterDefinition = (
vartfData: string
): { [key: string]: string | { [key: string]: string } } => {
const fields = parseVariablesTf(vartfData);
const defaultVariables: string[] = [];
// map of string to string or map of string to string
const def: { [key: string]: string | { [key: string]: string } } = {
name: values.name,
Expand All @@ -252,9 +253,18 @@ export const generateClusterDefinition = (
Object.keys(fieldDict).forEach((key) => {
if (fieldDict[key] !== DEFAULT_VAR_VALUE) {
delete fieldDict[key];
defaultVariables.push(key);
}
});
def.variables = fieldDict;

if (defaultVariables.length > 0) {
logger.info(
`Default values will be used for these variables:\n${defaultVariables.join(
"\n"
)}. \nCustom values can be set for these variables in the definition.yaml file.`
);
}
}
return def;
};
Expand Down
5 changes: 4 additions & 1 deletion tests/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,11 @@ function approve_pull_request () {
exit 1
fi
fi
real_title=$(echo $all_prs | jq -r --arg pr_title "$pr_title" 'select(.[].title | startswith($pr_title)) | .[].title' | head -n 1)
real_title=$(echo $all_prs | jq -r --arg pr_title "$pr_title" '.[] | select(.title | startswith($pr_title)) | .title' | head -n 1)
pull_request_id=$(echo $all_prs | jq -r --arg pr_title "$pr_title" 'select(.[0].title | startswith($pr_title)) | .[0].pullRequestId')
if [ "$pull_request_id" == "" ]; then
pull_request_id=$(echo $all_prs | jq -r --arg pr_title "$pr_title" '.[] | select(.title | startswith($pr_title)) | .pullRequestId' | head -n 1)
fi
echo "Found pull request starting with phrase '$pr_title'"
echo "Pull request id $pull_request_id is '$real_title'"

Expand Down
1 change: 1 addition & 0 deletions tests/validations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ git push -u origin --all

# Wait for the lifecycle pipeline to finish and approve the pull request
mono_repo_commit_id=$(git log --format="%H" -n 1)
verify_pipeline_with_poll_and_source_version $AZDO_ORG_URL $AZDO_PROJECT $frontend_pipeline_name 500 15 $mono_repo_commit_id
verify_pipeline_with_poll_and_source_version $AZDO_ORG_URL $AZDO_PROJECT $lifecycle_pipeline_name 300 15 $mono_repo_commit_id
echo "Finding pull request that $lifecycle_pipeline_name pipeline created..."
approve_pull_request $AZDO_ORG_URL $AZDO_PROJECT "Reconciling HLD"
Expand Down

0 comments on commit 266cb84

Please sign in to comment.