-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathjava-build-pipeline.yml
More file actions
47 lines (39 loc) · 1.09 KB
/
java-build-pipeline.yml
File metadata and controls
47 lines (39 loc) · 1.09 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
trigger:
- master
pool:
name: javaapp-cicd-pool
vmImage: workstation
steps:
- task: Bash@3
displayName: "Gather artifact version"
inputs:
targetType: 'inline'
script: 'echo "##vso[task.setvariable variable=version]$(grep version pom.xml | grep -v ''<?xml'' | grep ''<version>''|head -n 1|awk ''{print $1}''| cut -d''>'' -f 2 | cut -d''<'' -f 1)"'
- task: Bash@3
inputs:
targetType: 'inline'
script: 'echo $(version)'
- task: Bash@3
displayName: "build artifacts"
inputs:
targetType: 'inline'
script: |
mvn clean package
failOnStderr: true
- task: Bash@3
displayName: "prepare artifact folder structure"
inputs:
targetType: 'inline'
script: |
mkdir /tmp/$(version)
cp ./target/*.jar /tmp/$(version)/app.jar
ls -lrt /tmp/$(version)
- task: UniversalPackages@0
inputs:
command: 'publish'
publishDirectory: '/tmp/$(version)'
feedsToUsePublish: 'internal'
vstsFeedPublish: '25977150-2660-41de-841f-34737f921521'
vstsFeedPackagePublish: 'javaapplication'
versionOption: 'custom'
versionPublish: '$(version)'