kopia lustrzana https://github.com/piku/piku
Create app DATA_ROOT
rodzic
fb54058f12
commit
c05a3a875b
8
piku.py
8
piku.py
|
@ -1590,15 +1590,19 @@ def cmd_git_hook(app):
|
||||||
app = sanitize_app_name(app)
|
app = sanitize_app_name(app)
|
||||||
repo_path = join(GIT_ROOT, app)
|
repo_path = join(GIT_ROOT, app)
|
||||||
app_path = join(APP_ROOT, app)
|
app_path = join(APP_ROOT, app)
|
||||||
|
data_path = join(DATA_ROOT, app)
|
||||||
|
|
||||||
for line in stdin:
|
for line in stdin:
|
||||||
# pylint: disable=unused-variable
|
# pylint: disable=unused-variable
|
||||||
oldrev, newrev, refname = line.strip().split(" ")
|
oldrev, newrev, refname = line.strip().split(" ")
|
||||||
# Handle pushes
|
# Handle pushes
|
||||||
if not exists(app_path):
|
if not exists(app_path):
|
||||||
echo("-----> Creating app '{}'".format(app), fg='green')
|
echo(f"-----> Creating app '{app}'", fg='green')
|
||||||
makedirs(app_path)
|
makedirs(app_path)
|
||||||
call('git clone --quiet {} {}'.format(repo_path, app), cwd=APP_ROOT, shell=True)
|
# The data directory may already exist, since this may be a full redeployment (we never delete data since it may be expensive to recreate)
|
||||||
|
if not exists(data_path):
|
||||||
|
makedirs(data_path)
|
||||||
|
call(f"git clone --quiet {repo_path} {app}", cwd=APP_ROOT, shell=True)
|
||||||
do_deploy(app, newrev=newrev)
|
do_deploy(app, newrev=newrev)
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue