From 483ecd885cb423f13f0fe830ebd038075b82a2b4 Mon Sep 17 00:00:00 2001 From: Chris McCormick Date: Sat, 31 Aug 2019 16:38:14 +0800 Subject: [PATCH] Allow purely shell based deploys. (#98) This PR modifies Piku such that if the user has a `web` and a `release` worker defined it will allow the deploy to continue. This is useful in cases where the user wants to run some binary server. An example is the gitea deploy. Without this change it needs a superfluous requirements.txt file exists before it will deploy. If/when this is merged I'll update the deploy-gitea repo to remove that superfluous file. Another fun thing this would allow is tiny web services written with bash/netcat etc. --- piku.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piku.py b/piku.py index d5d2408..4668cb1 100755 --- a/piku.py +++ b/piku.py @@ -342,6 +342,8 @@ def do_deploy(app, deltas={}, newrev=None): elif (exists(join(app_path, 'Godeps')) or len(glob(join(app_path,'*.go')))) and check_requirements(['go']): echo("-----> Go app detected.", fg='green') settings.update(deploy_go(app, deltas)) + elif 'release' in workers and 'web' in workers: + echo("-----> Generic app detected.", fg='green') elif 'static' in workers: echo("-----> Static app detected.", fg='green') settings.update(deploy_identity(app, deltas)) @@ -539,12 +541,14 @@ def deploy_python(app, deltas={}): call('pip install -r {}'.format(requirements), cwd=virtualenv_path, shell=True) return spawn_app(app, deltas) + def deploy_identity(app, deltas={}): env_path = join(ENV_ROOT, app) if not exists(env_path): makedirs(env_path) return spawn_app(app, deltas) - + + def spawn_app(app, deltas={}): """Create all workers for an app"""