Fix: Nom des produits doivent être unique
Some checks failed
Organisation/sgl/pipeline/head There was a failure building this commit
Some checks failed
Organisation/sgl/pipeline/head There was a failure building this commit
This commit is contained in:
51
Jenkinsfile
vendored
Normal file
51
Jenkinsfile
vendored
Normal 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
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user