Skip to content

Commit

Permalink
Moving sample-app-jenkinsfile
Browse files Browse the repository at this point in the history
In order to be accessed by context directory
  • Loading branch information
ChrisHoban committed Jul 22, 2019
1 parent e055601 commit a46c59b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions jrcc-access-spring-boot-sample-app/jenkins/sample-app-jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
try {
timeout(time: 20, unit: 'MINUTES') {

node {
stage("Initialize") {
project = env.BUILD
}
}

node('maven') {

stage("Checkout") {
git url: "${GIT_SOURCE_URL}", branch: "${GIT_SOURCE_REF}"
}

stage("Build JARs") {
sh "mvn clean package -Psample-app -Dmaven.test.skip=true"
sh "ls"

//stash name:"jars", includes:"target/*.jar"
}

stage('Push to Nexus'){
// Read POM xml file using 'readMavenPom' step , this step 'readMavenPom' is included in: https://plugins.jenkins.io/pipeline-utility-steps
pom = readMavenPom file: "pom.xml";
// Find built artifact under target folder
filesByGlob = findFiles(glob: "**/target/*.jar");

echo "Found ${filesByGlob.length} files"
for(file in filesByGlob){
echo "${file.name} ${file.path} ${file.directory} ${file.length} ${file.lastModified}"
}
}

}
}
} catch (err) {
echo "in catch block"
echo "Caught: ${err}"
currentBuild.result = 'FAILURE'
throw err
}

0 comments on commit a46c59b

Please sign in to comment.