mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 14:05:50 +00:00
Fixed merge conflicts
This commit is contained in:
commit
40bb225616
3 changed files with 26 additions and 11 deletions
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
|
@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
22
script.sh
Normal file
22
script.sh
Normal file
|
@ -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 '(?<=<version>).*(?=</version>)')
|
||||
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 '(?<=<artifactId>).*(?=</artifactId>)')
|
||||
VALUE=$(cat maven-metadata.xml | grep -m 1 -oP '(?<=<value>).*(?=</value>)')
|
||||
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
|
2
test.sh
Normal file
2
test.sh
Normal file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
echo 'TESTING JF' >> jfile.txt
|
Loading…
Reference in a new issue