Skip to content

Commit

Permalink
Add 'deliver.sh' within /jenkins/scripts directory.
Browse files Browse the repository at this point in the history
* This file contains the 'Deliver' stage shell script that will be run
during this stage of the Pipeline.
  • Loading branch information
gilesgas committed Sep 30, 2017
1 parent 8d2a8ba commit 15d1635
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions jenkins/scripts/deliver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

echo 'The following Maven command installs your Maven-built Java application'
echo 'into the local Maven repository, which will ultimately be stored in'
echo 'Jenkins''s local Maven repository (and the "maven-repository" Docker data'
echo 'volume).'
set -x
mvn jar:jar install:install help:evaluate -Dexpression=project.name
set +x

echo 'The following complex command extracts the value of the <name/> element'
echo 'within <project/> of your Java/Maven project''s "pom.xml" file.'
set -x
NAME=`mvn help:evaluate -Dexpression=project.name | grep "^[^\[]"`
set +x

echo 'The following complex command behaves similarly to the previous one but'
echo 'extracts the value of the <version/> element within <project/> instead.'
set -x
VERSION=`mvn help:evaluate -Dexpression=project.version | grep "^[^\[]"`
set +x

echo 'The following command runs and outputs the execution of your Java'
echo 'application (which Jenkins built using Maven) to the Jenkins UI.'
set -x
java -jar target/${NAME}-${VERSION}.jar

0 comments on commit 15d1635

Please sign in to comment.