-
Notifications
You must be signed in to change notification settings - Fork 40
/
azure-pipelines.yml
111 lines (103 loc) · 3.13 KB
/
azure-pipelines.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
trigger:
- chef-docker-webinar
stages:
- stage: Build
jobs:
- job: plan
pool:
# If you are building a Windows package, you'll need to swap this to a windows image.
# name: Hosted VS2017
vmImage: 'ubuntu-18.04'
steps:
- task: vsts-habitat-install@3
displayName: 'Install Habitat'
- task: vsts-habitat-signing-key@3
displayName: 'Signing Origin Key: install'
inputs:
habitatOrigin: bldr
- task: vsts-habitat-build@3
inputs:
habitatOrigin: bldr
habitatSrcPath: '$(Build.SourcesDirectory)'
habitatPlanContext: 'habitat'
env:
HAB_LICENSE: accept-no-persist
displayName: "Habitat: Build Package"
- task: vsts-habitat-expose-habitat-build-vars@3
displayName: 'Expose Habitat Build Variables'
inputs:
habitatSetBuildNumber: true
- publish: $(System.DefaultWorkingDirectory)/results
artifact: hart
- stage: Publish_Dev
jobs:
- deployment: plan
pool:
vmImage: 'ubuntu-18.04'
environment: 'dev'
strategy:
runOnce:
deploy:
steps:
- task: vsts-habitat-install@3
displayName: 'Install Habitat'
- task: vsts-habitat-signing-key@3
displayName: 'Signing Origin Key: install'
inputs:
habitatOrigin: bldr
- script: |
source $(Pipeline.Workspace)/hart/last_build.env
echo "##vso[task.setvariable variable=pkg_artifact]$pkg_artifact"
displayName: 'Publish Artifact Name'
- task: vsts-habitat-pkg-upload@3
displayName: 'Package Upload'
inputs:
habitatOrigin: bldr
habitatPackagePath: '$(Pipeline.Workspace)/hart/$(pkg_artifact)'
habitatPackageChannel: dev
env:
HAB_LICENSE: accept-no-persist
- stage: Promote_Stg
jobs:
- deployment: plan
pool:
vmImage: 'ubuntu-18.04'
environment: 'stg'
strategy:
runOnce:
deploy:
steps:
- task: vsts-habitat-install@3
displayName: 'Install Habitat'
- task: vsts-habitat-signing-key@3
displayName: 'Signing Origin Key: install'
inputs:
habitatOrigin: bldr
- script: |
source $(Pipeline.Workspace)/hart/last_build.env
/tmp/hab pkg promote $pkg_ident stage
displayName: 'Promote to Stage'
env:
HAB_LICENSE: accept-no-persist
- stage: Promote_Prod
jobs:
- deployment: plan
pool:
vmImage: 'ubuntu-18.04'
environment: 'prod'
strategy:
runOnce:
deploy:
steps:
- task: vsts-habitat-install@3
displayName: 'Install Habitat'
- task: vsts-habitat-signing-key@3
displayName: 'Signing Origin Key: install'
inputs:
habitatOrigin: bldr
- script: |
source $(Pipeline.Workspace)/hart/last_build.env
/tmp/hab pkg promote $pkg_ident prod
displayName: 'Promote to Prod'
env:
HAB_LICENSE: accept-no-persist