Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
khylpe committed Aug 22, 2024
1 parent 2c93d35 commit fda32b7
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,33 @@ pipeline {
}
}
}

stage('Deploy the Application') {
steps {
dir('/srv/aio-tools/ressources_relationnelles') {
sh '''
docker-compose down
git fetch
git checkout jenkins
git pull
docker-compose up --build -d
'''
}
}
}
}

post {
success {
echo 'Build and tests succeeded!'
sh 'docker-compose down'

// Deploy the application

dir('/srv/aio-tools/ressources_relationnelles') {
echo 'Build and tests succeeded!'
sh '''
if [ ! -d "/srv/aio-tools/ressources_relationnelles@tmp" ]; then
mkdir -p /srv/aio-tools/ressources_relationnelles@tmp
chown -R jenkins:jenkins /srv/aio-tools/ressources_relationnelles@tmp
fi
'''

sh '''
docker-compose down
git fetch
git checkout jenkins
git pull
docker-compose up --build -d
'''
}

}
failure {
echo 'Build or tests failed.'
Expand Down

0 comments on commit fda32b7

Please sign in to comment.