-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile_liontech_cicd
48 lines (41 loc) · 1.72 KB
/
Jenkinsfile_liontech_cicd
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
node{
def mavenHome = tool name: 'maven3.9.2'
stage('1cloneCode'){
git 'https://github.com/Lion-Technology-Solutions/liontech-welcomeapp-cicd-pipelines.git'
}
stage('2Test&Build'){
sh "${mavenHome}/bin/mvn clean package"
//bat "${mavenHome}/bin/mvn clean package"
}
stage('3codeQuality'){
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4uploadArtifacts'){
sh "${mavenHome}/bin/mvn deploy"
}
stage('5deploy2DEV'){
sh "echo 'deploy to DEV' "
deploy adapters: [tomcat9(credentialsId: 'admin-deploy', path: '', url: 'http://3.99.218.226:8009/')], contextPath: 'dev', war: 'target/*war'
}
stage('6approvalGate'){
sh "echo 'ready for review' "
timeout(time:5, unit:'DAYS') {
input message: 'Application ready for deployment, Please review and approve'
}
}
stage('7deploy2Prod'){
sh "sleep 50"
deploy adapters: [tomcat9(credentialsId: 'admin-deploy', path: '', url: 'http://3.99.218.226:8009/')], contextPath: 'PROD', war: 'target/*war'
}
stage('congratulations') {
echo 'congratulations Lion Tech Engineers'
}
stage ('send MS Teams Notifications'){
office365ConnectorSend message: 'liontech devops engineers, we are unstopable', webhookUrl: 'https://liontechacademy.webhook.office.com/webhookb2/69fa68d2-9fe7-4e6f-975a-7e5715e102a6@b290c85e-0692-4ada-8f25-2a3b60aca73e/JenkinsCI/7f4fa873f74d4def83a01d2a8166ff0b/90dc930a-1d3a-4c50-9c2d-39d010312f55'
}
stage('8emailNotification'){
emailext body: '''Hi All,
Check Build status.
Lion Techologies''', recipientProviders: [buildUser(), developers(), upstreamDevelopers(), brokenBuildSuspects(), brokenTestsSuspects(), contributor()], subject: 'build status', to: '[email protected]'
}
}