templatize the deployment job so that it can be reused in a release pipeline

This commit is contained in:
Jack Quincy 2020-03-27 14:45:43 -07:00
Родитель 52be9641ff
Коммит fb2f6d52b8
2 изменённых файлов: 59 добавлений и 41 удалений

Просмотреть файл

@ -2,45 +2,12 @@
trigger: none
pr: none
variables:
- template: vars.yml
jobs:
- job: "Deploy"
pool:
vmImage: "ubuntu-latest"
steps:
- template: ./templates/template-setup-golang-env.yml
parameters:
gobin: ${{ variables.GOBIN }}
gopath: ${{ variables.GOPATH }}
goroot: ${{ variables.GOROOT }}
modulePath: ${{ variables.modulePath }}
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'specific'
project: '5d69ab04-7ded-49dc-84d5-bbbcac4add8d'
pipeline: '129296'
buildVersionToDownload: 'latestFromBranch'
branchName: 'refs/heads/master'
downloadType: 'specific'
downloadPath: '$(System.ArtifactsDirectory)/config'
displayName: "Download Config"
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'specific'
project: '5d69ab04-7ded-49dc-84d5-bbbcac4add8d'
pipeline: '120903'
buildVersionToDownload: 'latestFromBranch'
branchName: 'refs/heads/master'
downloadType: 'specific'
downloadPath: '$(System.ArtifactsDirectory)/deployer'
displayName: "Download Deployer"
- template: ./templates/template-deploy-azure-env.yml
parameters:
workingDirectory: $(system.defaultWorkingDirectory)
configDirectory: '$(System.ArtifactsDirectory)/config/drop/deploy'
deployerDirectory: '$(System.ArtifactsDirectory)/deployer/drop'
configFileName: $(CONFIG_FILE_NAME)
location: $(LOCATION)
azureDevOpsJSONSPN: $(aro-v4-ci-devops-spn)
- template: ./templates-job-deploy-azure-env.yml
parameters:
LOCATION: $(LOCATION)
CONFIG_FILE_NAME: $(CONFIG_FILE_NAME)
aro-v4-ci-devops-spn: $(aro-v4-ci-devops-spn)
vso-project-id: $(vso-project-id)
vso-config-build-id: $(vso-config-build-id)
vso-deployer-build-id: $(vso-deployer-build-id)

Просмотреть файл

@ -0,0 +1,51 @@
# Azure DevOps Job deploying rp
parameters:
LOCATION: ""
CONFIG_FILE_NAME: ""
aro-v4-ci-devops-spn: ""
vso-project-id: ""
vso-config-pipeline-id: ""
vso-deployer-pipeline-id: ""
variables:
- template: vars.yml
jobs:
- job: "Deploy"
pool:
vmImage: "ubuntu-latest"
steps:
- template: ./templates/template-setup-golang-env.yml
parameters:
gobin: ${{ variables.GOBIN }}
gopath: ${{ variables.GOPATH }}
goroot: ${{ variables.GOROOT }}
modulePath: ${{ variables.modulePath }}
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'specific'
project: ${{ parameters.vso-project-id }}
pipeline: ${{ parameters.vso-config-pipeline-id }}
buildVersionToDownload: 'latestFromBranch'
branchName: 'refs/heads/master'
downloadType: 'specific'
downloadPath: '$(System.ArtifactsDirectory)/config'
displayName: "Download Config"
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'specific'
project: ${{ parameters.vso-project-id }}
pipeline: ${{ parameters.vso-deployer-pipeline-id }}
buildVersionToDownload: 'latestFromBranch'
branchName: 'refs/heads/master'
downloadType: 'specific'
downloadPath: '$(System.ArtifactsDirectory)/deployer'
displayName: "Download Deployer"
- template: ./templates/template-deploy-azure-env.yml
parameters:
workingDirectory: $(system.defaultWorkingDirectory)
configDirectory: '$(System.ArtifactsDirectory)/config/drop/deploy'
deployerDirectory: '$(System.ArtifactsDirectory)/deployer/drop'
configFileName: ${{ parameters.CONFIG_FILE_NAME }}
location: ${{ parameters.LOCATION }}
azureDevOpsJSONSPN: ${{ parameters.aro-v4-ci-devops-spn }}