-
Notifications
You must be signed in to change notification settings - Fork 23
/
Jenkinsfile
74 lines (69 loc) · 1.82 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
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
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Initiating maven build'
sh 'mvn clean install -Dlicense.skip=true'
echo 'Maven build complete'
}
}
stage('Testing') {
parallel {
stage('SonarQube Test') {
steps {
echo 'Initiating SonarQube test'
sh 'mvn sonar:sonar -Dsonar.host.url=http://<IP address>:8081 -Dlicense.skip=true'
echo 'SonarQube test Complete'
}
}
stage('Print Tester credentials') {
steps {
sleep 10
echo "The tester is ${TESTER}"
}
}
stage('Print Build Number') {
steps {
sleep 20
echo "This is build number ${BUILD_ID}"
}
}
}
}
stage('JFrog Push') {
steps {
echo 'Starting JFrog push'
script {
def server = Artifactory.server "artifactory"
def buildInfo = Artifactory.newBuildInfo()
def rtMaven = Artifactory.newMavenBuild()
rtMaven.tool = 'maven'
rtMaven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local'
buildInfo = rtMaven.run pom: 'pom.xml', goals: "clean install -Dlicense.skip=true"
buildInfo.env.capture = true
buildInfo.name = 'jpetstore-6'
server.publishBuildInfo buildInfo
}
echo 'JFrog push complete'
}
}
stage('Deploy prompt') {
steps {
input 'Deploy to Production?'
}
}
stage('Deploy') {
steps {
echo 'Initiating Deployment'
echo 'Deployment Complete'
}
}
}
tools {
maven 'maven'
}
environment {
TESTER = 'placeholder'
}
}