forked from niadak/Sample-Yaml-Pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sample-DownloadArtifact-Pipeline.Yaml
96 lines (85 loc) · 2.97 KB
/
Sample-DownloadArtifact-Pipeline.Yaml
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
stages:
- stage: Build
displayName: Build stage
jobs:
- job: Build
displayName: Build job
pool: default
steps:
- script: echo Hello, world! This is CI job
displayName: 'Run a one-line script'
- task: PublishPipelineArtifact@0
displayName: Create Artifact
inputs:
artifactName: Artifact1
targetPath: 'Sample-DownloadArtifact-Pipeline.Yaml'
- task: PublishPipelineArtifact@0
displayName: Create Artifact2
inputs:
artifactName: Artifact2
targetPath: 'Test'
- stage: QA
displayName: QA stage
jobs:
- job: dummyJob
pool: default
steps:
- script: echo Hello, world! This is dummy job
displayName: 'Run a one-line script'
- powershell: ls $(Pipeline.Workspace) -r #Check the content of the workspace directory
- powershell: |
Remove-Item $(Pipeline.Workspace)\Artifact1 -Recurse -Force
Remove-Item $(Pipeline.Workspace)\Artifact2 -Recurse -Force
displayName: Scorch workspace
- stage: Deploy
displayName: Deploy stage
jobs:
- deployment: Deploy
displayName: Deploy job
pool: default
environment: Environment01
strategy:
runOnce:
deploy:
steps:
- script: echo Hello, world! This is deploy job
displayName: 'Run a one-line script'
- powershell: ls $(Pipeline.Workspace) -r #Check the content of the workspace directory
displayName: Explore workspace
- powershell: |
Remove-Item $(Pipeline.Workspace)\Artifact1 -Recurse -Force
Remove-Item $(Pipeline.Workspace)\Artifact2 -Recurse -Force
displayName: Scorch workspace
- task: PublishPipelineArtifact@0
displayName: Create Artifact
inputs:
artifactName: Artifact3
targetPath: 'Sample-pipeline.yaml'
- deployment: Deploy2
displayName: Deploy2 job
pool: default
environment: Environment01
dependsOn: Deploy
strategy:
runOnce:
deploy:
steps:
- script: echo Hello, world! This is deploy job
displayName: 'Run a one-line script'
- powershell: ls $(Pipeline.Workspace) -r #Check the content of the workspace directory
displayName: Explore workspace
- powershell: |
Remove-Item $(Pipeline.Workspace)\Artifact1 -Recurse -Force
Remove-Item $(Pipeline.Workspace)\Artifact2 -Recurse -Force
displayName: Scorch workspace
- deployment: DeployOnServer
displayName: Deploy job
pool: server
environment: Environment01
strategy:
runOnce:
deploy:
steps:
- task: Delay@1
inputs:
delayForMinutes: '1'