fixing volumes and mysql connection

This commit is contained in:
hllvc 2021-07-10 23:57:03 +02:00
parent 5f384351ca
commit 9f0baac9d6

14
Jenkinsfile vendored
View file

@ -1,6 +1,6 @@
pipeline { pipeline {
agent any agent none
stages { stages {
@ -9,7 +9,7 @@ pipeline {
dockerfile { dockerfile {
filename 'Dockerfile.build' filename 'Dockerfile.build'
dir '.' dir '.'
args '-v $HOME/.m2:/root/.m2 -v ./app:/root/app' args '-v $HOME/.m2:/root/.m2 -v $HOME/app:/root/app'
} }
} }
steps { steps {
@ -17,15 +17,21 @@ pipeline {
} }
} }
stage('MySQL setup') {
steps {
sh 'docker run --network petclinic -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:5.7.8'
}
}
stage('Run') { stage('Run') {
agent { agent {
dockerfile { dockerfile {
filename 'Dockerfile.run' filename 'Dockerfile.run'
args '-v $HOME/.m2:/root/.m2 -v ./app:/root/app' args '-v $HOME/.m2:/root/.m2 -v $HOME/app:/root/app --network petclinic'
} }
} }
steps { steps {
echo 'App Running'
} }
} }