forked from beaglesecurity/repository-permissions-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
39 lines (32 loc) · 1.18 KB
/
Jenkinsfile
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
/* Only keep the 10 most recent builds. */
properties([[$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', numToKeepStr: '100']]])
try {
node('linux') {
stage 'Clean workspace'
deleteDir()
sh 'ls -lah'
stage 'Checkout source'
checkout scm
stage 'Build tool'
def mvnHome = tool 'mvn'
env.JAVA_HOME = tool 'jdk8'
stage 'Build'
sh "${mvnHome}/bin/mvn clean verify"
stage 'Run Permissions Updater'
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'artifactoryAdmin',
usernameVariable: 'ARTIFACTORY_USERNAME', passwordVariable: 'ARTIFACTORY_PASSWORD']]) {
sh '${JAVA_HOME}/bin/java' +
' -DdefinitionsDir=$WORKSPACE/permissions' +
' -DartifactoryApiTempDir=$WORKSPACE/json' +
' -jar target/repository-permissions-updater-*-bin/repository-permissions-updater.jar'
}
}
} catch (Exception e) {
// TODO handle error
} finally {
// Mark the archive 'stage'....
stage 'Archive'
archive 'permissions/*.yml'
archive 'json/*.json'
}