forked from leereilly/hello-world-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
81 lines (70 loc) · 1.82 KB
/
azure-pipelines.yml
File metadata and controls
81 lines (70 loc) · 1.82 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
name: DevOps
parameters:
- name: environment
type: string
default: production
- name: myMultiString
type: string
default: default
values:
- default
- ubuntu
variables:
var1: 10
staticvar: 'myvalue'
compilevar: ${{ variables.staticvar }}
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
stages:
- stage: A
displayName: "Stage-A Build and Test"
variables:
- name: var2
value: 100
jobs:
- job: A1
displayName: "Job-A1 build deploy to ${{ parameters.environment }}"
steps:
- script: |
echo "Building the application in A1"
echo ${{ variables.staticvar }}
echo $(compilevar)
echo $(isMain)
echo $(Pipeline.Workspace)
displayName: "Build Step"
- job: A2
displayName: "Job A2 Test"
dependsOn: A1
condition: succeeded()
timeoutInMinutes: 10
cancelTimeoutInMinutes: 2
workspace:
clean: all
steps:
- script: echo "Building the application in A2"
displayName: "Test Step"
- job: A3
steps:
- bash: echo "##vso[task.setvariable variable=shouldrun;isOutput=true]true"
# or on Windows:
# - script: echo ##vso[task.setvariable variable=shouldrun;isOutput=true]true
name: printvar
displayName: "defining the varialbe"
- job: A4
condition: and(succeeded(), eq(dependencies.A.outputs['printvar.shouldrun'], 'true'))
dependsOn: A3
steps:
- script: echo hello from A4
- stage: B
displayName: "Stage-B Deploy"
jobs:
- job: B1
displayName: "Stage B1 Deploy"
steps:
- script: echo "Building the application B1"