-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjenkins_build.sh
23 lines (22 loc) · 917 Bytes
/
jenkins_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -e
export WORKSPACE=`pwd`
# Create/Activate virtualenv
virtualenv venv -p python3
source venv/bin/activate
# Install Requirements
pip install -r requirements.txt
# Run tests
python manage.py test
pytest --cov-report=xml -x -s
codecov
cd /home/nattesharan/django_app/
git pull origin master
source venv/bin/activate
pip install -r requirements.txt
sudo sonar-scanner -Dsonar.projectKey=django_app -Dsonar.sources=. -Dsonar.login=77208f48bdbff3b1855ccfe3db2d24823e6596fe
python manage.py migrate
sudo venv/bin/celery multi restart django_app -A django_app --pidfile="django_app_celery.pid" --loglevel=info --logfile='django_app_celery.log'
sudo venv/bin/celery multi restart django_app_beat -A django_app --beat -c 1 --pidfile="django_app_celery_beat.pid" --loglevel=info logfile="django_beat.log" --scheduler=django_celery_beat.schedulers:DatabaseScheduler
sudo supervisorctl restart django_app
whoami