Skip to content

Commit 15d1635

Browse files
committed
Add 'deliver.sh' within /jenkins/scripts directory.
* This file contains the 'Deliver' stage shell script that will be run during this stage of the Pipeline.
1 parent 8d2a8ba commit 15d1635

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

jenkins/scripts/deliver.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
echo 'The following Maven command installs your Maven-built Java application'
4+
echo 'into the local Maven repository, which will ultimately be stored in'
5+
echo 'Jenkins''s local Maven repository (and the "maven-repository" Docker data'
6+
echo 'volume).'
7+
set -x
8+
mvn jar:jar install:install help:evaluate -Dexpression=project.name
9+
set +x
10+
11+
echo 'The following complex command extracts the value of the <name/> element'
12+
echo 'within <project/> of your Java/Maven project''s "pom.xml" file.'
13+
set -x
14+
NAME=`mvn help:evaluate -Dexpression=project.name | grep "^[^\[]"`
15+
set +x
16+
17+
echo 'The following complex command behaves similarly to the previous one but'
18+
echo 'extracts the value of the <version/> element within <project/> instead.'
19+
set -x
20+
VERSION=`mvn help:evaluate -Dexpression=project.version | grep "^[^\[]"`
21+
set +x
22+
23+
echo 'The following command runs and outputs the execution of your Java'
24+
echo 'application (which Jenkins built using Maven) to the Jenkins UI.'
25+
set -x
26+
java -jar target/${NAME}-${VERSION}.jar

0 commit comments

Comments
 (0)