-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrelease-branch-pipeline.yml
80 lines (69 loc) · 2.06 KB
/
release-branch-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
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
trigger:
- release
pr: none
pool:
vmImage: 'ubuntu-latest'
variables:
VERSION:
steps:
# Checks if the release notes file is populated. Exits if it is not.
- bash: |
if [ -s RELEASE_NOTES.md ]
then
echo "RELEASE_NOTES.md has data, proceeding to next step."
else
echo "Your RELEASE_NOTES.md file is empty. Please provide release notes before creating a release."
exit 1
fi
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: Gradle@3
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'build'
publishJUnitResults: false
javaHomeOption: 'JDKVersion'
sonarQubeRunAnalysis: false
jdkVersionOption: 1.11
displayName: 'gradle build'
# We need the project version to tag the docker image correctly.
# This is done through a helper function within the gradle.kts file.
- bash: |
gradle wrapper --gradle-version=6.7
echo "##vso[task.setvariable variable=current_version]$(./gradlew -q printVersion)"
echo "$(current_version)"
# Executes docker build and push to publish our build container image
# to the docker registry
- task: Docker@2
displayName: 'docker build'
inputs:
containerRegistry: 'dockerhub connection'
repository: 'markiantorno/validator-wrapper'
command: 'build'
Dockerfile: '**/Dockerfile'
arguments: --build-arg PROJECT_VERSION=$(current_version)
tags: '$(current_version)'
- task: Docker@2
inputs:
containerRegistry: 'dockerhub connection'
repository: 'markiantorno/validator-wrapper'
command: 'push'
tags: '$(current_version)'
- task: Docker@2
displayName: 'docker build'
inputs:
containerRegistry: 'dockerhub connection'
repository: 'markiantorno/validator-wrapper'
command: 'build'
Dockerfile: '**/Dockerfile'
arguments: --build-arg PROJECT_VERSION=$(current_version)
tags: 'latest'
- task: Docker@2
inputs:
containerRegistry: 'dockerhub connection'
repository: 'markiantorno/validator-wrapper'
command: 'push'
tags: 'latest'