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
|
Django==1.9.4
|
||||||
simplejson
|
simplejson
|
||||||
chardet
|
chardet
|
||||||
celery==3.1.20
|
celery==3.1.23
|
||||||
django-celery==3.1.17
|
django-celery==3.1.17
|
||||||
django-extensions==1.6.1
|
django-extensions==1.6.1
|
||||||
gunicorn==19.4.5
|
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('\tsudo service %s start' % service)
|
||||||
print('')
|
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):
|
def run_git(path, *args):
|
||||||
cmd = ['git'] + list(args)
|
cmd = ['git'] + list(args)
|
||||||
env = {'GIT_DIR': '%s/.git' % path}
|
env = {'GIT_DIR': '%s/.git' % path}
|
||||||
|
@ -185,14 +194,7 @@ if __name__ == "__main__":
|
||||||
shutil.rmtree('contrib')
|
shutil.rmtree('contrib')
|
||||||
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
||||||
run('./pandora/manage.py', 'migrate', '--fake-initial', '--noinput')
|
run('./pandora/manage.py', 'migrate', '--fake-initial', '--noinput')
|
||||||
service = 'pandora'
|
update_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)
|
|
||||||
if old <= 5432:
|
if old <= 5432:
|
||||||
import pandora.settings
|
import pandora.settings
|
||||||
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
||||||
|
@ -209,14 +211,11 @@ if __name__ == "__main__":
|
||||||
if '0.0.0.0:2620' in data:
|
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)
|
run('sed', '-i', 's/127.0.0.1:2620/0.0.0.0:2620/g', gunicorn_config)
|
||||||
if old > 5389:
|
if old > 5389:
|
||||||
service = 'pandora'
|
update_service('pandora')
|
||||||
print('Please install new init script for "%s" service:' % service)
|
if old < 5452:
|
||||||
if os.path.exists('/etc/init/%s.conf'%service):
|
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
||||||
print('\tsudo cp %s/etc/init/%s.conf /etc/init/' % (base, service))
|
update_service('pandora-encoding')
|
||||||
if os.path.exists('/bin/systemctl'):
|
update_service('pandora-tasks')
|
||||||
print('\tsudo cp %s/etc/systemd/%s.service /lib/systemd/system/' % (base, service))
|
|
||||||
print('\tsudo systemctl daemon-reload')
|
|
||||||
print('\tsudo service %s restart' % service)
|
|
||||||
else:
|
else:
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
release = get_release()
|
release = get_release()
|
||||||
|
|
Loading…
Reference in a new issue