Skip to content

Commit

Permalink
Fix cancellation handling (#7430)
Browse files Browse the repository at this point in the history
* Adjust conditions to better handle cancellations.

* Reacting to Mike's feedback.
  • Loading branch information
mitchdenny authored Jan 16, 2020
1 parent fb3937a commit 3c3900a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 43 deletions.
18 changes: 9 additions & 9 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- script: |
echo "##vso[build.addbuildtag]Scheduled"
displayName: 'Tag scheduled builds'
condition: and(eq(variables['Build.SourceBranchName'],'master'),eq(variables['Build.Reason'],'Schedule'))
condition: and(succeeded(), eq(variables['Build.SourceBranchName'],'master'),eq(variables['Build.Reason'],'Schedule'))
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
Expand All @@ -74,13 +74,13 @@ jobs:
- script: |
python3 --version
python3 eng/versioning/set_versions.py --build-type ${{parameters.SDKType}} --build-qualifier dev.$(Build.BuildNumber) --artifact-id ${{artifact.name}} --group-id ${{artifact.groupId}}
condition: eq(variables['SetDevVersion'],'true')
condition: and(succeeded(), eq(variables['SetDevVersion'],'true'))
displayName: Append dev package version suffix for ${{artifact.name}}
- script: |
python3 --version
python3 eng/versioning/update_versions.py --update-type library --build-type ${{parameters.SDKType}}
condition: eq(variables['SetDevVersion'],'true')
condition: and(succeeded(), eq(variables['SetDevVersion'],'true'))
displayName: Apply version settings to repository
- script: |
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
artifact: repository

- job: 'Analyze'
condition: ne(variables['Skip.Analyze'], 'true')
condition: and(succeeded(), ne(variables['Skip.Analyze'], 'true'))

variables:
- template: ../variables/globals.yml
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
artifact: reports

- job: 'Test'
condition: ne(variables['Skip.Test'], 'true')
condition: and(succeeded(), ne(variables['Skip.Test'], 'true'))

variables:
- template: ../variables/globals.yml
Expand All @@ -253,7 +253,7 @@ jobs:

- task: Maven@3
displayName: 'Start Jetty'
condition: ne('${{ parameters.SDKType }}', 'client')
condition: and(succeeded(), ne(variables['SdkType'], 'client'))
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions)'
Expand All @@ -270,7 +270,7 @@ jobs:
displayName: 'Use Python 3.6'
inputs:
versionSpec: '3.6'
condition: and(eq('${{ parameters.SDKType }}', 'client'), eq(variables['TestFromSource'],'true'))
condition: and(succeeded(), eq('${{ parameters.SDKType }}', 'client'), eq(variables['TestFromSource'],'true'))

- pwsh: |
python --version
Expand All @@ -287,12 +287,12 @@ jobs:
exit 1
}
displayName: 'Set versions for source build'
condition: and(eq('${{ parameters.SDKType }}', 'client'), eq(variables['TestFromSource'],'true'))
condition: and(succeeded(), eq('${{ parameters.SDKType }}', 'client'), eq(variables['TestFromSource'],'true'))
- script: |
python --version
python eng/versioning/update_versions.py --update-type library --build-type client
condition: eq(variables['ShouldRunSourceTests'],'true')
condition: and(succeeded(), eq(variables['ShouldRunSourceTests'],'true'))
displayName: 'Update versions for source build'
- task: Maven@3
Expand Down
30 changes: 0 additions & 30 deletions eng/pipelines/templates/jobs/archetype-sdk-tests-pre-sdk.yml

This file was deleted.

2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
-ProvisionerApplicationSecret '$(provisioner-aad-secret)'
-Force
-Verbose
condition: ne(variables['AZURE_RESOURCEGROUP_NAME'], '')
condition: and(always(), ne(variables['AZURE_RESOURCEGROUP_NAME'], ''))
continueOnError: true
displayName: Remove Test Resources
Expand Down
6 changes: 3 additions & 3 deletions eng/pipelines/templates/steps/cache-maven-repository.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
steps:
- script: |
echo "##vso[task.setvariable variable=Maven.RepositoryPath;]%USERPROFILE%\.m2\repository"
condition: eq(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
displayName: Detecting Maven repository on Windows
- script: |
echo "##vso[task.setvariable variable=Maven.RepositoryPath;]$HOME/.m2/repository"
condition: ne(variables['Agent.OS'], 'Windows_NT')
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
displayName: Detecting Maven repository on Linux and macOS
- task: CacheBeta@0
inputs:
key: $(Agent.JobName)|$(CacheSalt)|$(Build.SourcesDirectory)/sdk/**/pom.xml|$(Build.SourcesDirectory)/pom*.xml|$(Build.SourcesDirectory)/parent/pom.xml
path: $(Maven.RepositoryPath)
displayName: 'Download/upload cache'
condition: ne(variables['EnableCaching'], 'false')
condition: and(succeeded(), ne(variables['EnableCaching'], 'false'))

0 comments on commit 3c3900a

Please sign in to comment.