-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order to be accessed by context directory
- Loading branch information
1 parent
e055601
commit a46c59b
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
jrcc-access-spring-boot-sample-app/jenkins/sample-app-jenkinsfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |