-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
53 lines (50 loc) · 2.13 KB
/
Jenkinsfile
File metadata and controls
53 lines (50 loc) · 2.13 KB
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
node {
final scmVars = checkout(scm)
//checkout scm
env.PATH = "${tool 'Maven3'}/bin:${env.PATH}"
stage ("Running Unit Tests") {
try {
echo "scmVars: ${scmVars}"
echo "scmVars.GIT_COMMIT: ${scmVars.GIT_COMMIT}"
echo "scmVars.GIT_BRANCH: ${scmVars.GIT_BRANCH}"
//echo sh(returnStdout: true, script: 'env')
sh 'cp service.example.envs service.envs'
sh 'mvn clean test'
//slackSend color: "good", message: "Build Succeeded: ${env.JOB_NAME} ${env.BUILD_NUMBER} \nGit Commit: ${scmVars.GIT_COMMIT} \nGit Branch: ${scmVars.GIT_BRANCH}"
} catch (error) {
//slackSend color: "danger", message: "Build Failed Running Unit Tests: ${env.JOB_NAME} ${env.BUILD_NUMBER} \nGit Commit: ${scmVars.GIT_COMMIT} \nGit Branch: ${scmVars.GIT_BRANCH}"
} finally {
junit '**/target/surefire-reports/*.xml'
}
}
// stage ('Building Docker Images') {
// try {
// sh 'docker-compose up -d --build'
// } catch (error) {
// slackSend color: "danger", message: "Build Failed Building Docker Images: ${env.JOB_NAME} ${env.BUILD_NUMBER}"
// }
// }
//
// stage ('Wait for Docker Containers Init Prior Testing') {
// //waitUntil {
// // sh 'wget --retry-connrefused --tries=120 --waitretry=1 -q localhost:8110/status/resources/v1/status -O /dev/null'
// //}
// try {
// echo "Waiting 20 seconds for Docker Containers initialize prior to testing"
// sleep 20 // seconds
// } catch (error) {
// }
// }
//
// stage('Running Integration Tests') {
// try {
// sh 'mvn test -Parq-wildfly-remote'
// sh 'docker-compose down'
// slackSend color: "good", message: "Build Succeeded: ${env.JOB_NAME} ${env.BUILD_NUMBER}"
// } catch (error) {
// slackSend color: "danger", message: "Build Failed Running Integration Tests: ${env.JOB_NAME} ${env.BUILD_NUMBER}"
// } finally {
// junit '**/target/surefire-reports/*.xml'
// }
// }
}