-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfra_release_pipeline.yml
46 lines (41 loc) · 1.68 KB
/
infra_release_pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
trigger: none
pr: none
# Pipeline resource defined as per https://bit.ly/3PhwhRk
resources:
pipelines:
- pipeline: build_pipeline # Used to reference the pipeline reference from other parts of the code.
source: infra_build_pipeline # This must match the build pipeline name in ADO.
# By default, pipelines are named after the ADO build pipeline name.
trigger:
branches:
- master # Will get triggered whenever the source pipeline runs on master branch.
jobs:
- deployment: infra_deploy_to_nuget
displayName: Deploy to NuGet
environment: production
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- task: PowerShell@2
displayName: 'Create version number'
name: 'CreateVersionNumber'
inputs:
targetType: 'inline'
script: |
$newVersion = "$(resources.pipeline.build_pipeline.runName)"
[string] $buildName = "$($newVersion)"
Write-Host "##vso[build.updatebuildnumber]$buildName"
- download: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
definition: infra_build_pipeline
buildVersionToDownload: 'latest'
artifactName: 'drop'
project: 'SRD.Infrastructure'
downloadPath: '$(Pipeline.Workspace)/drop'
- script: dotnet nuget push $(Pipeline.Workspace)/drop/a/SparkRoseDigital.Infrastructure.$(resources.pipeline.build_pipeline.runName).nupkg --api-key $(nuget_api_key) --source https://api.nuget.org/v3/index.json
displayName: 'dotnet nuget push'