-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsfile_for_ref
58 lines (55 loc) · 1.65 KB
/
jenkinsfile_for_ref
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
pipeline{
agent any
stages {
stage('Stage I - Clone from github'){
steps {
echo 'Git Cloning Success'
git 'https://github.com/lalithkota/CalcAssign_SPE.git'
}
}
stage('Stage II - Build'){
steps{
sh 'mvn clean package'
}
post{
success{
echo 'Built Successful'
}
}
}
stage('Stage III - Test') {
steps {
sh 'mvn test'
}
post {
success {
echo 'Testing Successful'
}
}
}
stage('Stage IV - Make Docker Image & Push') {
steps{
sh 'cp target/*SNAPSHOT.jar myJar.jar'
script{
def dockerImage=docker.build("lalithkota/calc_assign_server")
docker.withRegistry( '', 'docker-hub-creds') {
dockerImage.push()
}
}
}
}
stage('Stage V - Trigger Rundeck'){
steps{
script {
step([ $class: "RundeckNotifier",
includeRundeckLogs: true,
jobId: "deb9a3fa-f87a-4028-af5c-c48cd729a129",
rundeckInstance: "Rundeck_inst_1",
shouldFailTheBuild: true,
shouldWaitForRundeckJob: false,
tailLog: true])
}
}
}
}
}