def select(): if not is_running(): log.abort("Vagrant based VM currently NOT running") return config_path = os.path.join(dir.temp_local(), "vagrant_ssh_config") core.local("vagrant ssh-config > %s" % config_path) core.env.hosts = ["default"] core.env.password = "******" core.env.ssh_config_path = config_path core.env.use_ssh_config = True
def deploy(owner, upload_hook=None, revision='HEAD', keep_versions=10): if not user.exists(owner): log.abort('Specified owner does not exists! Deploy aborted') # Ensure some directories paths = _ensure_layout(owner) new_release_dir = _create_new_release_dir(owner, paths['releases']) paths['new_release'] = new_release_dir # Upload the new version and call the after upload hook _upload(owner, new_release_dir, revision) if upload_hook: with ctx.sudo(owner), ctx.cd(new_release_dir): upload_hook(owner, paths) # Activate the new release and _symlink_release(owner, paths['current'], new_release_dir) _clear_old_releases(paths['releases'], keep_versions) return paths
def select(): if not is_running(): log.abort('Vagrant based VM currently NOT running') env.password = '******' env.hosts = ['vagrant@%s' % ip()]
def _get_with_abort(username): username_data = get(username) if username_data is None: log.abort("User '%s' does not exists" % username) return username_data
def home_directory(user): user_data = get(user) if user_data is None: log.abort('User does not exists') return user_data['home']