Django automated deployment script

Source: Internet
Author: User
Tags coresite
while read line;do    echo‘kill ‘$line;    kill $line;done < /tmp/celeryd.pidwhile read line;do    echo‘kill ‘$line;    kill $line;done < /tmp/runserver.pidps -ef | grep runserver | awk ‘{print $2;}‘ | xargs -i -t kill {}git pullpip install -r requirements.txt -i http://pypi.douban.com/simplecur_time=$(date +%Y%m%d%H%M%s)db_name=/tmp/db/dkhs_${cur_time}.jsonecho ${db_name}if [ -d /tmp/db ]then     echo ‘/tmp/db exists‘else    mkdir /tmp/db     echo ‘/tmp/db create success‘fi# backup database dkhspython coresite/manage.py dumpdata --format=json accounts conference socialgraph portfolio statuses > ${db_name}# drop all table except finace tablemysql -h 192.168.107.253 -udkhs_data -pdkhs_data -e "use dkhs; show tables;" | egrep -v "finance|Tables_in_dkhs" | xargs -i -t mysql -h 192.168.107.253 -udkhs_data -pdkhs_data -e "use dkhs;SET foreign_key_checks = 0;drop table if exists {}"# syncdb without init datapython coresite/manage.py syncdb --noinput --migrate --no-initial-data # syncdb with init data#python coresite/manage.py syncdb --noinput --migrate# use backupdata recover databasepython coresite/manage.py loaddata ${db_name}# insert local client idpython coresite/manage.py loaddata coresite/coresite/fixtures/initial_data.json##mysql -uroot -proot -e "drop database if exists dkhs ;create database dkhs character set utf8;"##python coresite/manage.py syncdb --noinput --migrate##mysql -uroot -proot dkhs < ~/init_stock.sql##echo "from accounts.models import User; User.objects.create_superuser(‘dkhs‘, ‘[email protected]‘, ‘dkhs‘)" | coresite/manage.py shellexport C_FORCE_ROOT="1"python coresite/manage.py celeryd -l info -f /tmp/celeryd.log --pidfile=/tmp/celeryd.pid &python coresite/manage.py runserver 0.0.0.0:8000 &echo $! > /tmp/runserver.pid

 

Django automated deployment script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.