Skip to content

Commit 84a19bc

Browse files
committed
WS-2609: Initial cut of an additional Jenkinsfile.
1 parent 93181c6 commit 84a19bc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

CI.Jenkinsfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
node ("docker-light") {
2+
def sourceDir = pwd()
3+
try {
4+
stage("Clean up") {
5+
step([$class: 'WsCleanup'])
6+
}
7+
stage("Checkout Code") {
8+
checkout scm
9+
}
10+
stage("Maven Build") {
11+
echo "${env.ALT_URL}"
12+
def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}"
13+
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) {
14+
sh "docker run --rm \
15+
--pull always \
16+
--env API_KEY=${API_KEY} \
17+
--env ALT_URL=${ALT_URL} \
18+
--volume ${sourceDir}:/source maven/eclipse-temurin-17-focal \
19+
bash -c \"pushd /source; mvn -B clean install\""
20+
}
21+
}
22+
slack(true)
23+
} catch (e) {
24+
currentBuild.result = "FAILED"
25+
slack(false)
26+
throw e
27+
}
28+
}
29+
30+
def slack(boolean success) {
31+
def color = success ? "#00FF00" : "#FF0000"
32+
def status = success ? "SUCCESSFUL" : "FAILED"
33+
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
34+
slackSend(color: color, channel: "#p-n-c_jenkins", message: message)
35+
}

0 commit comments

Comments
 (0)