|
|
|
|
|
|
|
|
# Refer: https://aka.ms/yaml |
|
|
# Refer: https://aka.ms/yaml |
|
|
|
|
|
|
|
|
variables: |
|
|
variables: |
|
|
shouldDeploy: > |
|
|
|
|
|
|
|
|
shouldDeploy: >- |
|
|
${{ or( |
|
|
${{ or( |
|
|
eq(variables.Build.SourceBranch, 'refs/heads/develop'), |
|
|
|
|
|
eq(variables.Build.SourceBranch, 'refs/heads/master') |
|
|
|
|
|
|
|
|
eq(variables['Build.SourceBranch'], 'refs/heads/develop'), |
|
|
|
|
|
eq(variables['Build.SourceBranch'], 'refs/heads/master') |
|
|
) }} |
|
|
) }} |
|
|
|
|
|
deployDest: ${{ format('~/{0}/', variables['Build.SourceBranchName']) }} |
|
|
|
|
|
|
|
|
stages: |
|
|
stages: |
|
|
- stage: build_test |
|
|
- stage: build_test |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- stage: deploy_build |
|
|
- stage: deploy_build |
|
|
displayName: Deploy |
|
|
displayName: Deploy |
|
|
condition: eq(variables.shouldDeploy, true) |
|
|
|
|
|
|
|
|
condition: and(succeeded(), eq(variables.shouldDeploy, 'true')) |
|
|
jobs: |
|
|
jobs: |
|
|
- job: deploy |
|
|
- job: deploy |
|
|
displayName: Deploy for ${{variables.Build.SourceBranchName}} |
|
|
|
|
|
condition: succeeded() |
|
|
|
|
|
|
|
|
displayName: Deploy (${{variables['Build.SourceBranch']}}) |
|
|
steps: |
|
|
steps: |
|
|
|
|
|
- checkout: none |
|
|
- task: DownloadPipelineArtifact@2 |
|
|
- task: DownloadPipelineArtifact@2 |
|
|
displayName: Download builds |
|
|
displayName: Download builds |
|
|
inputs: |
|
|
inputs: |
|
|
|
|
|
|
|
|
inputs: |
|
|
inputs: |
|
|
sshEndpoint: dds.pizza |
|
|
sshEndpoint: dds.pizza |
|
|
sourceFolder: art/ |
|
|
sourceFolder: art/ |
|
|
targetFolder: ~/${{variables.Build.SourceBranchName}}/ |
|
|
|
|
|
|
|
|
targetFolder: ${{ variables.deployDest }} |
|
|
failOnEmptySource: true |
|
|
failOnEmptySource: true |
|
|
overwrite: true |
|
|
overwrite: true |
|
|
# - job: deploy |
|
|
|
|
|
# displayName: Deploy Canary |
|
|
|
|
|
# # Only deploy the "canary" build when we are on the 'develop' branch |
|
|
|
|
|
# condition: and(succeeded(), eq(variables.Build.SourceBranchName, 'develop')) |
|
|
|
|
|
# steps: |
|
|
|
|
|
# - task: DownloadPipelineArtifact@2 |
|
|
|
|
|
# displayName: Download builds |
|
|
|
|
|
# inputs: |
|
|
|
|
|
# targetPath: art/ |
|
|
|
|
|
# - task: CopyFilesOverSSH@0 |
|
|
|
|
|
# displayName: Post builds |
|
|
|
|
|
# inputs: |
|
|
|
|
|
# sshEndpoint: dds.pizza |
|
|
|
|
|
# sourceFolder: art/ |
|
|
|
|
|
# targetFolder: ~/canary/ |
|
|
|
|
|
# failOnEmptySource: true |
|
|
|
|
|
# overwrite: true |
|
|
|