Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hello-world-spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fernando Vazquez
hello-world-spring-boot
Commits
4e540ef3
Commit
4e540ef3
authored
Jun 17, 2022
by
Fernando Vazquez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored Jenkinsfile
parent
ddcc8cec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
7 deletions
+1
-7
Jenkinsfile
Jenkinsfile
+0
-7
README.md
README.md
+1
-0
No files found.
Jenkinsfile
View file @
4e540ef3
...
@@ -60,15 +60,10 @@ pipeline {
...
@@ -60,15 +60,10 @@ pipeline {
stage
(
"Publish to Nexus"
)
{
stage
(
"Publish to Nexus"
)
{
steps
{
steps
{
script
{
script
{
// 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"
;
pom
=
readMavenPom
file:
"pom.xml"
;
// Find built artifact under target folder
filesByGlob
=
findFiles
(
glob:
"target/*.${pom.packaging}"
);
filesByGlob
=
findFiles
(
glob:
"target/*.${pom.packaging}"
);
// Print some info from the artifact found
echo
"${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
echo
"${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
// Extract the path from the File found
artifactPath
=
filesByGlob
[
0
].
path
;
artifactPath
=
filesByGlob
[
0
].
path
;
// Assign to a boolean response verifying If the artifact name exists
artifactExists
=
fileExists
artifactPath
;
artifactExists
=
fileExists
artifactPath
;
if
(
artifactExists
)
{
if
(
artifactExists
)
{
...
@@ -83,13 +78,11 @@ pipeline {
...
@@ -83,13 +78,11 @@ pipeline {
repository:
NEXUS_REPOSITORY
,
repository:
NEXUS_REPOSITORY
,
credentialsId:
NEXUS_CREDENTIAL_ID
,
credentialsId:
NEXUS_CREDENTIAL_ID
,
artifacts:
[
artifacts:
[
// Artifact generated such as .jar, .ear and .war files.
[
artifactId:
pom
.
artifactId
,
[
artifactId:
pom
.
artifactId
,
classifier:
''
,
classifier:
''
,
file:
artifactPath
,
file:
artifactPath
,
type:
pom
.
packaging
],
type:
pom
.
packaging
],
// Lets upload the pom.xml file for additional information for Transitive dependencies
[
artifactId:
pom
.
artifactId
,
[
artifactId:
pom
.
artifactId
,
classifier:
''
,
classifier:
''
,
file:
"pom.xml"
,
file:
"pom.xml"
,
...
...
README.md
View file @
4e540ef3
...
@@ -13,3 +13,4 @@
...
@@ -13,3 +13,4 @@
-
REMOTE_AGENT
-
REMOTE_AGENT
-
IMAGE_NAME
-
IMAGE_NAME
-
DOCKER_HUB_CRED
-
DOCKER_HUB_CRED
-
-Dsonar.projectKey
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment