forked from 0x2620/pandora
update celery package and promt to install new init files for workers
This commit is contained in:
parent
7554b0c105
commit
7761cf9ec2
2 changed files with 16 additions and 17 deletions
|
@ -1,7 +1,7 @@
|
|||
Django==1.9.4
|
||||
simplejson
|
||||
chardet
|
||||
celery==3.1.20
|
||||
celery==3.1.23
|
||||
django-celery==3.1.17
|
||||
django-extensions==1.6.1
|
||||
gunicorn==19.4.5
|
||||
|
|
31
update.py
31
update.py
|
@ -79,6 +79,15 @@ def check_services(base):
|
|||
print('\tsudo service %s start' % service)
|
||||
print('')
|
||||
|
||||
def update_service(service):
|
||||
print('Please install new init script for "%s" service:' % service)
|
||||
if os.path.exists('/etc/init/%s.conf'%service):
|
||||
print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service))
|
||||
if os.path.exists('/bin/systemctl'):
|
||||
print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service))
|
||||
print('\tsudo systemctl daemon-reload')
|
||||
print('\tsudo service %s restart' % service)
|
||||
|
||||
def run_git(path, *args):
|
||||
cmd = ['git'] + list(args)
|
||||
env = {'GIT_DIR': '%s/.git' % path}
|
||||
|
@ -185,14 +194,7 @@ if __name__ == "__main__":
|
|||
shutil.rmtree('contrib')
|
||||
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
||||
run('./pandora/manage.py', 'migrate', '--fake-initial', '--noinput')
|
||||
service = 'pandora'
|
||||
print('Please install new init script for "%s" service:' % service)
|
||||
if os.path.exists('/etc/init/%s.conf'%service):
|
||||
print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service))
|
||||
if os.path.exists('/bin/systemctl'):
|
||||
print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service))
|
||||
print('\tsudo systemctl daemon-reload')
|
||||
print('\tsudo service %s restart' % service)
|
||||
update_service('pandora')
|
||||
if old <= 5432:
|
||||
import pandora.settings
|
||||
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
||||
|
@ -209,14 +211,11 @@ if __name__ == "__main__":
|
|||
if '0.0.0.0:2620' in data:
|
||||
run('sed', '-i', 's/127.0.0.1:2620/0.0.0.0:2620/g', gunicorn_config)
|
||||
if old > 5389:
|
||||
service = 'pandora'
|
||||
print('Please install new init script for "%s" service:' % service)
|
||||
if os.path.exists('/etc/init/%s.conf'%service):
|
||||
print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service))
|
||||
if os.path.exists('/bin/systemctl'):
|
||||
print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service))
|
||||
print('\tsudo systemctl daemon-reload')
|
||||
print('\tsudo service %s restart' % service)
|
||||
update_service('pandora')
|
||||
if old < 5452:
|
||||
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
||||
update_service('pandora-encoding')
|
||||
update_service('pandora-tasks')
|
||||
else:
|
||||
if len(sys.argv) == 1:
|
||||
release = get_release()
|
||||
|
|
Loading…
Reference in a new issue