-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
53 lines (46 loc) · 1.77 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
51
52
53
node {
stage('Configure') {
env.PATH = "${tool 'maven-3.3.9'}/bin:${env.PATH}"
version = '1.0.' + env.BUILD_NUMBER
currentBuild.displayName = version
properties([
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
[$class: 'GithubProjectProperty', displayName: '', projectUrlStr: 'https://github.com/taz-jt/simple-java-maven-app/'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
}
stage('Checkout') {
git 'https://github.com/taz-jt/simple-java-maven-app'
}
/*
stage('Version') {
sh "echo \'\ninfo.build.version=\'$version >> src/main/resources/application.properties || true"
sh "mvn -B -V -U -e versions:set -DnewVersion=$version"
}
*/
stage('Build') {
sh 'mvn -B -DskipTests clean package'
}
stage('Test') {
sh 'mvn test'
}
stage('Archive') {
junit allowEmptyResults: true, testResults: '**/target/**/TEST*.xml'
}
/*
stage('Deploy') {
// Depends on the 'Credentials Binding Plugin'
// (https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin)
withCredentials([[$class : 'UsernamePasswordMultiBinding', credentialsId: 'cloudfoundry',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh '''
curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" | tar -zx
./cf api https://api.run.pivotal.io
./cf auth $USERNAME $PASSWORD
./cf target -o bertjan-demo -s development
./cf push
'''
}
}
*/
}