diff --git a/Jenkinsfile b/Jenkinsfile
index 3b857dd56..cb4a50378 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -23,8 +23,8 @@ pipeline {
}
}
steps {
- sh 'scp -P 2223 -r test.sh vagrant@192.168.0.18:/home/vagrant/.'
- sh 'ssh -p 2223 vagrant@192.168.0.18 < test.sh'
+ sh 'scp -P 2223 -r script.sh vagrant@192.168.0.18:/home/vagrant/.'
+ sh 'ssh -p 2223 vagrant@192.168.0.18 < script.sh'
}
}
}
diff --git a/script.sh b/script.sh
new file mode 100644
index 000000000..c29f01c30
--- /dev/null
+++ b/script.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+wget http://192.168.0.18:8081/artifactory/libs-snapshot-local/org/springframework/samples/spring-petclinic/maven-metadata.xml
+VERSION=$(cat maven-metadata.xml | grep -m 1 -oP '(?<=).*(?=)')
+rm -f maven-metadata.xml
+wget http://192.168.0.18:8081/artifactory/libs-snapshot-local/org/springframework/samples/spring-petclinic/$VERSION/maven-metadata.xml
+
+AID=$(cat maven-metadata.xml | grep -m 1 -oP '(?<=).*(?=)')
+VALUE=$(cat maven-metadata.xml | grep -m 1 -oP '(?<=).*(?=)')
+echo $AID-$VALUE.war > version
+#echo "curl \"http://192.168.0.56:8081/repository/maven-snapshots/org/springframework/samples/spring-petclinic/$VERSION/" > command
+
+echo "curl \"http://192.168.0.18:8081/artifactory/libs-snapshot-local/org/springframework/samples/spring-petclinic/$VERSION/" > command
+
+paste -d '' command version > firsthalf
+echo "\" -o /usr/share/tomcat/webapps/petclinic.war" > secondhalf
+paste -d '' firsthalf secondhalf > fullcmd
+chmod 755 fullcmd
+./fullcmd
+service tomcat restart
+#rm -f command firsthalf fullcmd maven-metadata.xml secondhalf version
+rm -f command firsthalf maven-metadata.xml secondhalf version