From 4e3da952cdb4b642359c524619ad7c8116b547ef Mon Sep 17 00:00:00 2001 From: hblankenship Date: Tue, 24 Dec 2024 11:43:33 -0600 Subject: [PATCH] extract first boot portion of script --- .dryrunsecurity.yaml | 1 + Dockerfile.django-debian | 1 + docker/entrypoint-first-boot.sh | 35 +++++++++++++++++++++++++++++++ docker/entrypoint-initializer.sh | 36 ++------------------------------ 4 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 docker/entrypoint-first-boot.sh diff --git a/.dryrunsecurity.yaml b/.dryrunsecurity.yaml index da92963ddac..cca95d16109 100644 --- a/.dryrunsecurity.yaml +++ b/.dryrunsecurity.yaml @@ -52,6 +52,7 @@ sensitiveCodepaths: - 'docker/entrypoint-celery-beat.sh' - 'docker/entrypoint-celery-worker.sh' - 'docker/entrypoint-initializer.sh' + - 'docker/entrypoint-first-boot.sh' - 'docker/entrypoint-nginx.sh' - 'docker/entrypoint-uwsgi.sh' - 'docker/wait-for-it.sh' diff --git a/Dockerfile.django-debian b/Dockerfile.django-debian index 26c27cad391..663a75e884d 100644 --- a/Dockerfile.django-debian +++ b/Dockerfile.django-debian @@ -71,6 +71,7 @@ COPY \ docker/entrypoint-celery-beat.sh \ docker/entrypoint-celery-worker.sh \ docker/entrypoint-initializer.sh \ + docker/entrypoint-first-boot.sh \ docker/entrypoint-uwsgi.sh \ docker/entrypoint-uwsgi-dev.sh \ docker/entrypoint-unit-tests.sh \ diff --git a/docker/entrypoint-first-boot.sh b/docker/entrypoint-first-boot.sh new file mode 100644 index 00000000000..ffc782b4ccc --- /dev/null +++ b/docker/entrypoint-first-boot.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# called from entrypoint-initializer.sh when no admin user exists (first boot) +cat </dev/null) ; do + echo "Loading $i" + python3 manage.py loaddata "${i%.*}" + done + + echo "Installing watson search index" + python3 manage.py installwatson + + # surveys fixture needs to be modified as it contains an instance dependant polymorphic content id + echo "Migration of textquestions for surveys" + python3 manage.py migrate_textquestions \ No newline at end of file diff --git a/docker/entrypoint-initializer.sh b/docker/entrypoint-initializer.sh index 08e77dc46ca..e5145af0196 100755 --- a/docker/entrypoint-initializer.sh +++ b/docker/entrypoint-initializer.sh @@ -138,40 +138,8 @@ fi if [ -z "${ADMIN_EXISTS}" ] then -cat </dev/null) ; do - echo "Loading $i" - python3 manage.py loaddata "${i%.*}" - done - - echo "Installing watson search index" - python3 manage.py installwatson - - # surveys fixture needs to be modified as it contains an instance dependant polymorphic content id - echo "Migration of textquestions for surveys" - python3 manage.py migrate_textquestions - + ./entrypoint-first-boot.sh + create_announcement_banner initialize_data fi