Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

update_latest.sh 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env bash
  2. # Update to latest commit
  3. cd /var/www/oscar/builds/latest
  4. git pull --ff-only 2> /dev/null
  5. [ $? -gt 0 ] && echo "Git pull failed" >&2 && exit 1
  6. # Remove existing pyc files
  7. find . -type f -name "*.pyc" -delete
  8. # Update any dependencies
  9. source ../../virtualenvs/latest/bin/activate
  10. python setup.py develop
  11. pip install -r requirements.txt
  12. # Update sandbox database
  13. cd sites/sandbox
  14. ./manage.py syncdb --noinput
  15. ./manage.py migrate
  16. # Rebuild statics
  17. ./manage.py collectstatic --noinput
  18. ./manage.py thumbnail clear
  19. # Load standard fixtures
  20. ./manage.py loaddata ../_fixtures/promotions.json
  21. # Restart Tomcat (to pick up any Solr schema changes)
  22. /etc/init.d/tomcat7 restart
  23. # Re-compile python code
  24. touch deploy/wsgi/latest.wsgi
  25. # Copy down server config files
  26. cp deploy/nginx/latest.conf /etc/nginx/sites-enabled/latest.oscarcommerce.com
  27. /etc/init.d/nginx configtest 2> /dev/null && /etc/init.d/nginx force-reload 2> /dev/null
  28. cp deploy/supervisord/latest.conf /etc/supervisor/conf.d/latest.conf
  29. supervisorctl reread && supervisorctl reload
  30. # Copy down cronjob file
  31. cp deploy/cron.d/oscar /etc/cron.d/oscar-latest