diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2458a71dcf..a2f5d627fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -442,7 +442,8 @@ jobs: needs: - docker_build_setup - docker_build - + env: + RUN_SETUP_CONFIG: "False" # Disable running the setup_configuration name: Simulate upgrading instances runs-on: ubuntu-latest strategy: diff --git a/bin/setup_configuration.sh b/bin/setup_configuration.sh index 319d2e08c6..fe1a1edf58 100755 --- a/bin/setup_configuration.sh +++ b/bin/setup_configuration.sh @@ -5,10 +5,18 @@ set -e -# wait for required services -${SCRIPTPATH}/wait_for_db.sh +if [[ "${RUN_SETUP_CONFIG,,}" =~ ^(true|1|yes)$ ]]; then + # wait for required services + ${SCRIPTPATH}/wait_for_db.sh -src/manage.py migrate -src/manage.py setup_configuration \ - --yaml-file data/services.yaml \ - --yaml-file data/objects_api.yaml + if [[ "${SKIP_SELFTEST,,}" =~ ^(true|1|yes)$ ]]; then + NO_SELFTEST_FLAG="--no-selftest" + else + NO_SELFTEST_FLAG="" + fi + + src/manage.py migrate + src/manage.py setup_configuration $NO_SELFTEST_FLAG \ + --yaml-file data/services.yaml \ + --yaml-file data/objects_api.yaml +fi diff --git a/docker-compose.yml b/docker-compose.yml index e3b1630814..6d808a0157 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -85,6 +85,9 @@ services: - ENVIRONMENT_LABEL=docker-compose - ENVIRONMENT_BACKGROUND_COLOR=#1d63ed - ENVIRONMENT_FOREGROUND_COLOR=white + # Django-setup-configuration + - RUN_SETUP_CONFIG=${RUN_SETUP_CONFIG:-True} + - SKIP_SELFTEST=${SKIP_SELFTEST:-False} volumes: &web_volumes - media:/app/media - private_media:/app/private_media