Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: normalize lines for tag_type #2254

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 1 addition & 7 deletions terraform/pipeline/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,12 @@ steps:
workingDirectory: "$(System.DefaultWorkingDirectory)/terraform"
# service connection
environmentServiceNameAzureRM: "${{ parameters.service_connection }}"
- bash: |
echo "REASON is $REASON, INDIVIDUAL_SOURCE is $INDIVIDUAL_SOURCE, SOURCE_BRANCH is $SOURCE_BRANCH"
TAG_TYPE=$(python terraform/pipeline/tag.py)
echo "##vso[task.setvariable variable=tag_type]$TAG_TYPE"
- bash: python terraform/pipeline/tag.py
displayName: Set tag-type variable
env:
REASON: $(Build.Reason)
INDIVIDUAL_SOURCE: $(Build.SourceBranchName)
SOURCE_BRANCH: $(Build.SourceBranch)
- bash: |
echo $(tag_type)
displayName: Display tag-type variable
- task: TerraformTaskV3@3
displayName: Terraform plan
inputs:
Expand Down
8 changes: 7 additions & 1 deletion terraform/pipeline/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@
else:
tag_type = None

print(tag_type)
print(f"REASON: {REASON}")
print(f"INDIVIDUAL_SOURCE: {SOURCE}")
print(f"SOURCE_BRANCH: {SOURCE_BRANCH}")
print(f"Tag type: {tag_type}")

# https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=bash#about-tasksetvariable
print(f"##vso[task.setvariable variable=tag_type]{tag_type}")
Loading