Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report all missing commands rather than just the first one #21

Open
aweakley opened this issue Nov 4, 2019 · 1 comment
Open

Report all missing commands rather than just the first one #21

aweakley opened this issue Nov 4, 2019 · 1 comment
Assignees

Comments

@aweakley
Copy link
Member

aweakley commented Nov 4, 2019

Cameron has suggested this change, please can you review:

[~/PM/ixc-django-docker(git:entrypoint-multiwarning)]fleet*> diff
diff --git a/ixc_django_docker/bin/entrypoint.sh b/ixc_django_docker/bin/entrypoint.sh
index c4a1386..b77655c 100755
--- a/ixc_django_docker/bin/entrypoint.sh
+++ b/ixc_django_docker/bin/entrypoint.sh
@@ -76,11 +76,13 @@ else
        # packages, and we also verify that required environment variables and
        # programs are available.

+    ok=1
+
        # Fail loudly when required environment variables are missing.
        for var in PROJECT_DIR PROJECT_VENV_DIR; do
                eval [[ -z \${$var+1} ]] && {
                        >&2 echo "ERROR: Missing environment variable: $var"
-                       exit 1
+                       ok=
                }
        done

@@ -88,11 +90,15 @@ else
        for cmd in dockerize md5sum nginx npm psql python pv redis-server supervisord supervisorctl transcrypt yarn; do  # TODO: elasticsearch
                hash $cmd 2>/dev/null || {
                        >&2 echo "ERROR: Missing program: $cmd"
-                       >&2 echo 'See: https://github.com/ixc/ixc-django-docker/blob/master/README.rst#system-requirements-when-running-without-docker'
-                       exit 1
+            ok=
                }
        done

+    [ $ok ] || {
+        >&2 echo 'See: https://github.com/ixc/ixc-django-docker/blob/master/README.rst#system-requirements-when-running-without-docker'
+        exit 1
+    }
+
        # Add virtualenv bin directory to PATH.
        export PATH="$PROJECT_VENV_DIR/bin:$PATH"
 fi
@cameron-simpson
Copy link

PR here: #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants