diff --git a/Jenkinsfile b/Jenkinsfile
index 56f78a563..cf849779c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -4,16 +4,6 @@ pipeline {
stages {
- stage('Test') {
- agent {
- node {
- label 'tester'
- }
- }
- steps {
- sh 'mvn test'
- }
- }
stage('Deploy to Artifactory') {
agent {
node {
@@ -32,7 +22,8 @@ pipeline {
}
}
steps {
- 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..9833c9285
--- /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
+sudo chmod 755 fullcmd
+sudo ./fullcmd
+sudo service tomcat restart
+#rm -f command firsthalf fullcmd maven-metadata.xml secondhalf version
+rm -f command firsthalf maven-metadata.xml secondhalf version
diff --git a/test.sh b/test.sh
new file mode 100644
index 000000000..1cd42a7bf
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+echo 'TESTING JF' >> jfile.txt