From 15d1635fbc6f50ddd91cd5958672a1ef9956a1e7 Mon Sep 17 00:00:00 2001 From: Giles Gaskell Date: Sat, 30 Sep 2017 23:25:56 +1000 Subject: [PATCH] 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. --- jenkins/scripts/deliver.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 jenkins/scripts/deliver.sh diff --git a/jenkins/scripts/deliver.sh b/jenkins/scripts/deliver.sh new file mode 100644 index 0000000000..25b27dc795 --- /dev/null +++ b/jenkins/scripts/deliver.sh @@ -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 element' +echo 'within 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 element within 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