-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
executable file
·50 lines (45 loc) · 1.23 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
pipeline {
agent any
options {
disableConcurrentBuilds()
timeout(time: 1, unit: 'HOURS')
}
tools {
maven 'Maven 3.6.2'
}
environment {
SLACK_TOKEN = credentials('Slacktoken')
}
stages {
stage('build') {
steps {
sh 'mvn compile'
}
}
stage('test') {
steps{
copyArtifacts filter: 'gym/Linux/bin/**', fingerprintArtifacts: true, projectName: 'UnityPipeline/Develop'
sh 'mvn test'
}
}
stage('package') {
steps{
sh 'mvn package'
}
}
}
post {
always {
echo 'Stages complete..'
junit 'target/surefire-reports/**/*.xml'
}
success {
echo 'It ran succesfully'
slackSend (channel: '#jenkins-notifications', color: '#00FF00', message: "It ran succesfully! View results at: ${env.BUILD_URL} \n")
}
failure {
echo 'There was an error'
slackSend (channel: '#jenkins-notifications', color: '#FF0000', message: "It failed... View errors at: ${env.BUILD_URL}\n ")
}
}
}