Files
sirh/Jenkinsfile
Soriba SYLLA bda80fae85
Some checks are pending
Organisation/sirh/pipeline/head This commit looks good
Organisation/sirh/pipeline/pr-main Build queued...
utilisation des credentials
2026-05-04 09:51:25 +00:00

39 lines
932 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 '''
echo $SUDO_PASSWORD
cd /jenkins_test/sirh
echo $SUDO_PASSWORD | sudo -S chown -R jenkins:jenkins /jenkins_test/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 "Deploiement reussi"
'''
}
}
}
}