mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
dockersetup: move superuser account creation to the end
If we move the superuser account creation to the end, it's practical to Ctrl+C it in case you already have a superuser in the data that got imported. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
b99143d2e3
commit
604330f41a
|
@ -541,13 +541,6 @@ if not updatemode:
|
|||
finally:
|
||||
os.remove(sqlscriptfile)
|
||||
|
||||
## For a fresh database, create an admin account
|
||||
print("Creating database superuser. Input user name, email, and password when prompted.")
|
||||
return_code = subprocess.call("docker-compose run --rm layersapp /opt/layerindex/manage.py createsuperuser", shell=True)
|
||||
if return_code != 0:
|
||||
print("Creating superuser failed")
|
||||
sys.exit(1)
|
||||
|
||||
## Set the volume permissions using debian:stretch since we recently fetched it
|
||||
return_code = subprocess.call("docker run --rm -v layerindexweb_layersmeta:/opt/workdir debian:stretch chown 500 /opt/workdir && \
|
||||
docker run --rm -v layerindexweb_layersstatic:/usr/share/nginx/html debian:stretch chown 500 /usr/share/nginx/html", shell=True)
|
||||
|
@ -561,6 +554,15 @@ if return_code != 0:
|
|||
print("Collecting static files failed")
|
||||
sys.exit(1)
|
||||
|
||||
if not updatemode:
|
||||
## For a fresh database, create an admin account
|
||||
print("Creating database superuser. Input user name, email, and password when prompted.")
|
||||
return_code = subprocess.call("docker-compose run --rm layersapp /opt/layerindex/manage.py createsuperuser", shell=True)
|
||||
if return_code != 0:
|
||||
print("Creating superuser failed")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if updatemode:
|
||||
print("Update complete")
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user