-
Notifications
You must be signed in to change notification settings - Fork 2
/
jenkinsfileAnindita
62 lines (58 loc) · 1.29 KB
/
jenkinsfileAnindita
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
/*node
{
def mvnHome
stage('Preparation')
{
git 'https://github.com/AninditaMajumdar/DevopsRepository.git'
}
stage ('mvn clean install command'){
sh 'mvn clean install -Dv=${BUILD_NUMBER}'
}
stage('Sonar Running'){
withSonarQubeEnv('sonarqube')
{
sh 'mvn sonar:sonar -Dsonar.host.url=http://my62862dns.eastus2.cloudapp.azure.com'
}
}
stage('SonarQube quality gate')
{
def qg=waitForQualityGate()
if(qg.status!='OK'){
error "pipeline aborted due to quality gate failure : ${qg.status}"
}
}
stage ('deploying artifact'){
def server =Artifactory.server 'ArtifactoryID'
def uploadSpec="""{
"files":[
{
"pattern":"target/BookStore-SNAPSHOT-0.0.${BUILD_NUMBER}.war",
"target":"repo/"
}
]
}"""
server.upload(uploadSpec)
}
stage('confirmation for build')
{
input message:'Do you want to send it to production?',ok:'YES'
}
stage('downloading artifact')
{
def server =Artifactory.server 'ArtifactoryID'
def downloadSpec="""{
"files":[
{
"pattern":"repo/BookStore-SNAPSHOT-0.0.${BUILD_NUMBER}.war",
"target":"/var/lib/jenkins/workspace/DownloadingArtifact/"
}
]
}"""
server.download(downloadSpec)
}
stage ('Final deploy'){
sh 'scp /var/lib/jenkins/workspace/DownloadingArtifact/BookStore-SNAPSHOT-0.0.${BUILD_NUMBER}.war [email protected]:/home/vmadmin123/webapps'
}
}
*/
/*echo "hello"*/