Esempio n. 1
0
 def _simple_deploy():
     _remove_instances()
     sarge_instance = _new()
     instance_dir = env['sarge_home'] / sarge_instance
     with settings(sarge_instance=sarge_instance,
                   instance_dir=instance_dir):
         deployer.install.send(symbol(env['deployer_app_name']))
         _sarge("start {sarge_instance}".format(**env))
         deployer.has_started.send(symbol(env['deployer_app_name']))
         deployer.promote.send(symbol(env['deployer_app_name']))
Esempio n. 2
0
 def _simple_deploy():
     _remove_instances()
     sarge_instance = _new()
     instance_dir = env['sarge_home'] / sarge_instance
     with settings(sarge_instance=sarge_instance,
                   instance_dir=instance_dir):
         deployer.install.send(symbol(env['deployer_app_name']))
         _sarge("start {sarge_instance}".format(**env))
         deployer.has_started.send(symbol(env['deployer_app_name']))
         deployer.promote.send(symbol(env['deployer_app_name']))
Esempio n. 3
0
 def _rolling_deploy():
     sarge_instance = _new()
     instance_dir = env['sarge_home'] / sarge_instance
     with settings(sarge_instance=sarge_instance,
                   instance_dir=instance_dir):
         deployer.install.send(symbol(env['deployer_app_name']))
         _sarge("start {sarge_instance}".format(**env))
         deployer.has_started.send(symbol(env['deployer_app_name']))
         if confirm("Deployed {sarge_instance} - make it live?"
                    .format(**locals())):
             deployer.promote.send(symbol(env['deployer_app_name']))
             _remove_instances(keep=env['sarge_instance'])
         else:
             if confirm("Destroy instance {sarge_instance}?".format(**env)):
                 deployer.will_stop.send(symbol(env['deployer_app_name']))
                 _destroy_instance(env['sarge_instance'])
Esempio n. 4
0
 def _rolling_deploy():
     sarge_instance = _new()
     instance_dir = env['sarge_home'] / sarge_instance
     with settings(sarge_instance=sarge_instance,
                   instance_dir=instance_dir):
         deployer.install.send(symbol(env['deployer_app_name']))
         _sarge("start {sarge_instance}".format(**env))
         deployer.has_started.send(symbol(env['deployer_app_name']))
         if confirm("Deployed {sarge_instance} - make it live?".format(
                 **locals())):
             deployer.promote.send(symbol(env['deployer_app_name']))
             _remove_instances(keep=env['sarge_instance'])
         else:
             if confirm("Destroy instance {sarge_instance}?".format(**env)):
                 deployer.will_stop.send(symbol(env['deployer_app_name']))
                 _destroy_instance(env['sarge_instance'])
Esempio n. 5
0
 def _remove_instances(keep=None):
     for other_instance in _instances():
         if other_instance['id'] == keep:
             continue
         with settings(sarge_instance=other_instance['id']):
             app_name = other_instance['meta']['APPLICATION_NAME']
             deployer.will_stop.send(symbol(app_name))
             _destroy_instance(other_instance['id'])
Esempio n. 6
0
 def _remove_instances(keep=None):
     for other_instance in _instances():
         if other_instance['id'] == keep:
             continue
         with settings(sarge_instance=other_instance['id']):
             app_name = other_instance['meta']['APPLICATION_NAME']
             deployer.will_stop.send(symbol(app_name))
             _destroy_instance(other_instance['id'])
Esempio n. 7
0
 def _destroy_instance(sarge_instance):
     with settings(sarge_instance=sarge_instance):
         deployer.will_stop.send(symbol(env['deployer_app_name']))
         _sarge("destroy {sarge_instance}".format(**env))
Esempio n. 8
0
 def decorator(func):
     def wrapper(*args, **kwargs):
         return func()
     signal.connect(wrapper, symbol(app_name), False)
     return func
Esempio n. 9
0
 def _destroy_instance(sarge_instance):
     with settings(sarge_instance=sarge_instance):
         deployer.will_stop.send(symbol(env['deployer_app_name']))
         _sarge("destroy {sarge_instance}".format(**env))
Esempio n. 10
0
        def decorator(func):
            def wrapper(*args, **kwargs):
                return func()

            signal.connect(wrapper, symbol(app_name), False)
            return func