-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathJenkinsfile
42 lines (39 loc) · 1.65 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
40
41
42
pipeline {
agent { label 'slave1' }
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "MAVEN"
}
stages {
stage('SCM Checkout') {
steps {
// Get some code from a GitHub repository
git 'https://github.com/LoksaiETA/Java-mvn-app2.git'
//git clone git 'https://loksaieta:[email protected]/LoksaiETA/Java-mvn-app2.git'
//git [email protected]:LoksaiETA/Java-mvn-app2.git
}
}
stage('Maven Build') {
steps {
// Run Maven on a Unix agent.
sh "mvn -Dmaven.test.failure.ignore=true clean package"
}
}
stage('Approval Step'){
steps{
//----------------send an approval prompt-------------
script {
env.APPROVED_DEPLOY = input message: 'User input required Choose "yes" | "Abort"'
}
//-----------------end approval prompt------------
}
}
stage('Deploy to QA AppServer') {
steps {
script {
sshPublisher(publishers: [sshPublisherDesc(configName: 'QAServer', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: '', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '.', remoteDirectorySDF: false, removePrefix: 'target/', sourceFiles: 'target/mvn-hello-world.war')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
}
}
}
}
}