Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
pipeline {
agent any
agent none

environment {
MAJOR_VERSION = 1
}
stages {
stage('Unit Tests') {
agent {
label 'master'
}

steps {
sh 'ant -f test.xml -v'
junit 'reports/result.xml'
}
}

stage('build') {
agent {
label 'master'
}

steps {
sh 'ant -f build.xml -v'
}
Expand All @@ -20,10 +30,39 @@ pipeline {
}
}
}

stage('publish') {
agent {
label 'master'
}

steps {
sh "cp dist/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/"
}
}

stage('run on centos'){
agent{
docker 'fabric8/java-centos-openjdk8-jdk:1.4.0'
}

steps{
sh "curl http://18.140.113.66/rectangles/all/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar -o rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar"
sh "java -jar rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar 3 4"
}
}

stage('run on debian'){
agent{
docker 'openjdk:8u252-jre'
}

steps{
sh "curl http://18.140.113.66/rectangles/all/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar -o rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar"
sh "java -jar rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar 3 4"
}
}


}
}