forked from baloise/rocket-chat-notifier
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Jenkinsfile_dev
43 lines (34 loc) · 927 Bytes
/
Jenkinsfile_dev
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
#!groovy
// only 20 builds
properties([
disableConcurrentBuilds(),
buildDiscarder(logRotator(artifactNumToKeepStr: '20', numToKeepStr: '20'))
])
@Library('mare-build-library')
def maven = new de.mare.ci.jenkins.Maven()
node('docker') {
def buildNumber = env.BUILD_NUMBER
def workspace = env.WORKSPACE
def buildUrl = env.BUILD_URL
// PRINT ENVIRONMENT TO JOB
echo "workspace directory is $workspace"
echo "build URL is $buildUrl"
echo "build Number is $buildNumber"
echo "PATH is $env.PATH"
try {
stage('Checkout') {
checkout scm
}
stage('Build and Test') {
sh "./mvnw clean install -U"
}
stage('Deploy') {
sshagent(credentials: ['github-hypery2k']) {
sh "./mvnw deploy -DskipTests=true"
}
}
} catch (e) {
mail subject: 'Error on build', to: 'github@martinreinhardt-online.de', body: "Please go to ${env.BUILD_URL}."
throw e
}
}