-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
41 lines (34 loc) · 881 Bytes
/
Jenkinsfile
File metadata and controls
41 lines (34 loc) · 881 Bytes
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
#!/usr/bin/env groovy
pipeline {
agent {
docker {
label 'docker'
image 'maven:3.9.6-eclipse-temurin-17'
args '--privileged'
reuseNode true
}
}
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '5'))
}
triggers { cron('@daily') }
stages {
stage('deploy') {
steps {
configFileProvider([configFile(fileId: 'cnafsd-maven-settings', variable: 'MAVEN_SETTINGS')]) {
withCredentials([usernamePassword(credentialsId: 'jenkins-nexus', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'mvn -Dserver.username=$USERNAME -Dserver.password=$PASSWORD -s $MAVEN_SETTINGS clean deploy'
}
}
}
}
stage('result'){
steps {
script {
currentBuild.result = 'SUCCESS'
}
}
}
}
}