-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathJenkinsfile
32 lines (28 loc) · 1.31 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
pipeline {
agent any
stages {
stage ('Get Code') {
steps {
checkout scm
}
}
stage ('Build') {
steps {
echo 'Build starting'
sh 'cd lab-app'
sh 'mvn -f lab-app/pom.xml -Dmaven.test.failure.ignore=true install'
snDevOpsArtifact(artifactsPayload: """{"artifacts": [{"name": "labapp-web.jar", "version": "2.${currentBuild.number}.0","semanticVersion": "2.${currentBuild.number}.0","repositoryName": "ServiceNowLabAppRepo"}], "branchName": "main"}""")
snDevOpsPackage(name: "lab-app-package", artifactsPayload: """{"artifacts":[{"name": "labapp-web.jar", "version": "2.${currentBuild.number}.0", "repositoryName": "ServiceNowLabAppRepo"}], "branchName": "main"}""")
junit 'lab-app/target/surefire-reports/**/*.xml'
echo 'Build ended'
}
}
stage ('Deployment') {
steps {
echo 'Deployment starting'
snDevOpsChange(ignoreErrors: true, changeRequestDetails:"""{setCloseCode:true,attributes:{"category":"DevOps", "priority":"1", "work_notes": "This update is from the Jenkinsfile"}}""")
echo 'Deployment ended'
}
}
}
}