This repository has been archived by the owner on Jul 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines.yml
81 lines (78 loc) · 2.4 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
73
74
75
76
77
78
79
80
81
trigger:
branches:
include:
- master
tags:
include:
- v*
variables:
buildConfiguration: 'Release'
isGitHubTag: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/v')]
stages:
- stage: Build
jobs:
- job: Bulid_Package
condition: ne(variables['isGitHubTag'], 'true')
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: Maven@3
inputs:
mavenPomFile: 'sdk/pom.xml'
options: '--no-transfer-progress -DperformRelease=true'
publishJUnitResults: false
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
goals: 'clean package'
- stage: Deploy
dependsOn:
- Build
condition: and(succeeded(), eq(variables['isGitHubTag'], 'true'))
jobs:
- job: Deploy_Sonatype
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
VERSION_TAG=${BUILD_SOURCEBRANCHNAME:1} && echo "##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG"
echo $VERSION_TAG
- task: DownloadSecureFile@1
name: settingsSecurityXml
displayName: 'Download maven security settings file'
inputs:
secureFile: 'settings-security.xml'
- task: DownloadSecureFile@1
name: settingsXml
displayName: 'Download maven settings file'
inputs:
secureFile: 'settings.xml'
- task: DownloadSecureFile@1
name: key
displayName: 'Download private key file'
inputs:
secureFile: 'freee.private.asc'
- script: |
gpg --import $(key.secureFilePath)
mkdir -p ~/.m2
cp -v $(settingsSecurityXml.secureFilePath) ~/.m2/
cp -v $(settingsXml.secureFilePath) ~/.m2/
- task: Maven@3
inputs:
mavenPomFile: 'sdk/pom.xml'
publishJUnitResults: false
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: false
goals: 'clean deploy'
options: '--no-transfer-progress -DperformRelease=true -DskipTests=true -Dchangelist= -Drevision=$(VERSION_TAG)'