-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Expand file tree
/
Copy pathazure-pipelines-2.yml
More file actions
107 lines (98 loc) · 2.81 KB
/
Copy pathazure-pipelines-2.yml
File metadata and controls
107 lines (98 loc) · 2.81 KB
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
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: Build
displayName: 'Build Stage'
jobs:
- job: BuildJob
displayName: 'Build Job'
steps:
- script: |
echo "Restoring project dependencies..."
displayName: 'Restore dependencies'
- script: |
echo "Running unit tests..."
displayName: 'Run unit tests'
- stage: Test
displayName: 'Test Stage'
dependsOn: Build
isSkippable: false
jobs:
- job: TestJob
displayName: 'Test Job'
steps:
- script: |
echo "Running unit tests..."
displayName: 'Run unit tests'
- stage: DeployToStaging
displayName: 'Deploy to Staging'
dependsOn: Test
jobs:
- job: DeployStagingJob
displayName: 'Deploy to Staging Job'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
echo "Build staging job..."
displayName: 'Build and deploy to staging'
- job: DeployStagingJobWithValidation
pool: server
timeoutInMinutes: 4320 # job times out in 3 days
displayName: 'Deploy to Staging Job'
steps:
- task: ManualValidation@1
timeoutInMinutes: 1440 # task times out in 1 day
inputs:
notifyUsers: mukunthanthebest@gmail.com
instructions: 'Please validate the stage configuration and resume'
onTimeout: 'resume'
- stage: DeployToProduction
displayName: 'Deploy to Production'
dependsOn: DeployToStaging
lockBehavior: sequential
condition: and(succeeded(), in(variables['Build.SourceBranch'], 'refs/heads/main', 'refs/heads/release'))
jobs:
- job: DeployProductionJob
displayName: 'Deploy to Production Job'
steps:
- script: |
echo "Deploying to production..."
# Add your deployment commands here
displayName: 'Run deployment commands'
- job: waitForValidation
displayName: Wait for external validation
pool: server
timeoutInMinutes: 4320 # job times out in 3 days
steps:
- task: ManualValidation@1
timeoutInMinutes: 1440 # task times out in 1 day
inputs:
notifyUsers: mukunthanthebest@gmail.com
instructions: 'Please validate the build configuration and resume'
onTimeout: 'resume'
- stage: DeployToAlternateProduction
displayName: 'Deploy to Alternate Production'
condition: succeeded()
trigger: manual
jobs:
- job: DeployAlternateProductionJob
displayName: 'Deploy to Alternate Production Job'
steps:
- script: |
echo "Deploying to alternate production..."
# Add your deployment commands here
displayName: 'Run deployment commands'
- stage: Rollback
displayName: 'Rollback Stage'
trigger: manual
jobs:
- job: RollbackJob
displayName: 'Rollback Job'
steps:
- script: |
echo "Rolling back the deployment..."
# Add your rollback commands here
displayName: 'Run rollback commands'