forked from mamun7025/spring-boot-tomcat-cicd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
56 lines (48 loc) · 1.32 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
pipeline {
agent any
environment {
registryCredential = 'DockerCredential'
}
triggers {
pollSCM('* * * * *') //polling for changes, here once a minute
}
stages {
stage('S-1: Starting Job') {
steps {
echo 'Starting job, cleaning workspace'
deleteDir()
}
}
stage('S-2: Checkout code') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/mamun7025/spring-boot-tomcat-cicd.git']]])
}
}
stage('S-3: Gradle build') {
steps {
bat 'gradlew.bat clean build'
}
}
stage('S-3: Test') {
steps {
echo 'Starting test'
}
}
stage('S-4: Deploy to Tomcat') {
steps {
echo 'Start deploy...'
deploy adapters: [tomcat9(credentialsId: 'TomcatCreds', path: '', url: 'http://localhost:8080/')], contextPath: 'tm-app', war: '**/*.war'
}
}
stage('S-5: Finished Job') {
steps {
echo 'Finished Job'
}
}
}
post {
always {
echo 'Finished CI/CD Job'
}
}
}