maven
This commit is contained in:
40
proiect-nutritie-java/Jenkinsfile
vendored
Normal file
40
proiect-nutritie-java/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
tools {
|
||||
maven 'MVN-WSL'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Maven Analysis') {
|
||||
steps {
|
||||
sh 'mvn --version'
|
||||
echo 'Maven a fost integrat cu succes în pipeline-ul de Python!'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Docker Image') {
|
||||
steps {
|
||||
dir('proiect-nutritie') {
|
||||
sh 'docker build -t dieta-app-jenkins .'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sh '''
|
||||
docker stop test-dieta || true
|
||||
docker rm test-dieta || true
|
||||
docker run -d -p 8085:5000 --name test-dieta dieta-app-jenkins
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user