Files
sirh/Jenkinsfile
Soriba SYLLA 4ee7dd9fc7
Some checks are pending
Organisation/sirh/pipeline/head This commit looks good
Organisation/sirh/pipeline/pr-main Build queued...
Deploiement automatique
2026-05-04 13:15:38 +00:00

39 lines
969 B
Groovy

pipeline
{
agent any
environment
{
SUDO_PASSWORD = credentials('sudo-password')
}
stages
{
stage ( 'checkout' )
{
steps
{
sh 'echo "Debut du pipeline"'
checkout scm
}
}
stage ( 'Deploiement' )
{
when { branch 'main' }
steps {
sh '''
cd /var/www/sirh
echo $SUDO_PASSWORD | sudo -S chown -R jenkins:jenkins /var/www/sirh
git pull 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 chown -R ssylla:ssylla /var/www/sirh
echo "Deploiement reussi"
'''
}
}
}
}