Fix: Nom des produits doivent être unique
Some checks failed
Organisation/sgl/pipeline/head There was a failure building this commit

This commit is contained in:
2026-09-18 09:31:46 +00:00
parent 827a164cbd
commit 165894c92b
6 changed files with 56 additions and 3 deletions

51
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,51 @@
pipeline
{
agent any
options {
skipDefaultCheckout(true)
}
environment
{
SUDO_PASSWORD = credentials('sudo-password')
}
stages
{
stage ( 'checkout' )
{
steps
{
sh 'echo "Debut du pipeline"'
cleanWs()
checkout scm
}
}
stage ( 'Deploiement' )
{
when { branch 'main' }
steps {
sh '''
cd /var/www/sgl
echo $SUDO_PASSWORD | sudo -S chown -R jenkins:jenkins /var/www/sgl
git fetch origin main
git reset --hard origin/main
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
echo $SUDO_PASSWORD | sudo -S rm -r staticfiles
python manage.py collectstatic --noinput
echo $SUDO_PASSWORD | sudo -S chown -R www-data:www-data /var/www/sgl
echo "Deploiement reussi"
echo $SUDO_PASSWORD | sudo -S supervisorctl restart sgl
'''
}
}
}
}