This file contains hidden or 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
node { | |
def mvnHome | |
stage('Preparation') { | |
// Get some code from a Gitlab repository | |
git 'https://gitlab.com/joedayz/ContinuousIntegrationAndContinuousDeliveryApp.git' | |
mvnHome = tool 'M2' | |
} | |
This file contains hidden or 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
FROM java:latest | |
EXPOSE 8090 | |
ADD app.jar myApp.jar | |
ENTRYPOINT ["java","-jar","myApp.jar"] |
This file contains hidden or 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
#!/bin/bash -ex | |
echo "Deploying app.jar to docker folder" | |
packageName=`ls target/continuousintegrationandcontinuousdeliveryapp*.jar` | |
versionid=`echo $packageName | awk -F "-" '{ print $2}'` | |
versionname=`echo $packageName | awk -F "-" '{ print $3}' | awk -F "." '{ print $1}'` | |
version=`echo $versionid-$versionname` | |
echo "version: $version" | |
cp -r $packageName deployment/app.jar | |
dockerImageName=onedaywillcome/myapp | |
dockerpid=`docker ps -a | grep $dockerImageName | grep "Up" | awk -F " " '{ print $1 }'` |