File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 2727import ipaddress
2828import logging
2929import datetime
30+ from pathlib import Path
3031
3132from urllib .parse import urlparse , urlunparse
3233from invoke import task
@@ -353,7 +354,11 @@ def migrations(ctx):
353354def statics (ctx ):
354355 print ("**************************statics*******************************" )
355356 try :
356- ctx .run ("mkdir -p /mnt/volumes/statics/{static,uploads}" )
357+ static_root = os .environ .get ("STATIC_ROOT" , "/mnt/volumes/statics/static/" )
358+ media_root = os .environ .get ("MEDIA_ROOT" , "/mnt/volumes/statics/uploaded/" )
359+ assets_root = os .environ .get ("ASSETS_ROOT" , "/mnt/volumes/statics/assets/" )
360+
361+ ctx .run (f"mkdir -pv { static_root } { media_root } { assets_root } " )
357362 ctx .run (
358363 f"python manage.py collectstatic --noinput --settings={ _localsettings ()} " ,
359364 pty = True ,
@@ -469,7 +474,9 @@ def collectmetrics(ctx):
469474@task
470475def initialized (ctx ):
471476 print ("**************************init file********************************" )
472- ctx .run ("date > /mnt/volumes/statics/geonode_init.lock" )
477+ static_root = os .environ .get ("STATIC_ROOT" , "/mnt/volumes/statics/static/" )
478+ lockfile_dir = Path (static_root ).parent # quite ugly, we're assuming such dir exists and is writable
479+ ctx .run (f"date > { lockfile_dir } /geonode_init.lock" )
473480
474481
475482def _docker_host_ip ():
You can’t perform that action at this time.
0 commit comments