-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathazure-pipelines.yml
72 lines (67 loc) · 2.19 KB
/
azure-pipelines.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
variables:
- group: credentials
trigger:
batch: true
branches:
include:
- master
- features/*
- fix/*
exclude:
- features/experimental/*
paths:
exclude:
- README.md
pr: none
stages:
- stage: 'Build'
displayName: Build
jobs:
- job: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- script: sbt clean
displayName: 'Running $ sbt clean'
- script: sbt update
displayName: 'Running $ sbt update'
- script: sbt compile
displayName: 'Running $ sbt compile'
- task: DownloadSecureFile@1
displayName: 'Getting test data'
inputs:
secureFile: 'anthillTestData.zip'
- task: ExtractFiles@1
displayName: 'Extracting test data'
inputs:
archiveFilePatterns: '$(Agent.TempDirectory)/anthillTestData.zip'
destinationFolder: '$(Build.SourcesDirectory)'
cleanDestinationFolder: false
- script: sbt test
displayName: 'Running $ sbt test'
- stage: 'Publish'
displayName: Publish
#condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
condition: succeeded()
jobs:
- job: Publish
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Bash@3
displayName: 'Replacing build number'
inputs:
targetType: 'inline'
script: |
BRANCH=`echo $(Build.SourceBranch) | rev | cut -d / -f1 | rev`
BUILD=$(Build.BuildNumber)
echo ${BRANCH}
echo ${BUILD}
sed -i "s/{xxbuildversionxx}/${BRANCH}_${BUILD}/g" build.sbt
cat build.sbt
- script: "printf 'realm=https://pkgsprodcus1.pkgs.visualstudio.com/\n host=pkgs.dev.azure.com \n user=dh-platforms-devops \n password=$(maven_password)' > ~/credentials.txt"
displayName: 'Generate credentials file'
- script: sbt publish
displayName: 'Running $ sbt publish'
- script: "rm ~/credentials.txt"
displayName: 'Remove credentials file'