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

Add new NUXEOCTL_CONSOLE_OPTIONS parameter #4770

Closed
wants to merge 1 commit into from
Closed

Add new NUXEOCTL_CONSOLE_OPTIONS parameter #4770

wants to merge 1 commit into from

Conversation

ffjdm
Copy link
Contributor

@ffjdm ffjdm commented Aug 24, 2018

No description provided.

@tianon
Copy link
Member

tianon commented Aug 24, 2018

cc @dmetzler @akervern

Diff:
diff --git a/nuxeo_10.1/docker-entrypoint.sh b/nuxeo_10.1/docker-entrypoint.sh
index 2fc1b57..0dc404a 100755
--- a/nuxeo_10.1/docker-entrypoint.sh
+++ b/nuxeo_10.1/docker-entrypoint.sh
@@ -69,7 +69,7 @@ EOF
   fi
 
   if [ "$2" = "console" ]; then
-    exec nuxeoctl console
+    exec nuxeoctl console $NUXEOCTL_CONSOLE_OPTIONS
   else
     exec "$@"
   fi
diff --git a/nuxeo_LTS/docker-entrypoint.sh b/nuxeo_LTS/docker-entrypoint.sh
index 2fc1b57..0dc404a 100755
--- a/nuxeo_LTS/docker-entrypoint.sh
+++ b/nuxeo_LTS/docker-entrypoint.sh
@@ -69,7 +69,7 @@ EOF
   fi
 
   if [ "$2" = "console" ]; then
-    exec nuxeoctl console
+    exec nuxeoctl console $NUXEOCTL_CONSOLE_OPTIONS
   else
     exec "$@"
   fi
diff --git a/nuxeo_latest/docker-entrypoint.sh b/nuxeo_latest/docker-entrypoint.sh
index 2fc1b57..0dc404a 100755
--- a/nuxeo_latest/docker-entrypoint.sh
+++ b/nuxeo_latest/docker-entrypoint.sh
@@ -69,7 +69,7 @@ EOF
   fi
 
   if [ "$2" = "console" ]; then
-    exec nuxeoctl console
+    exec nuxeoctl console $NUXEOCTL_CONSOLE_OPTIONS
   else
     exec "$@"
   fi

@tianon
Copy link
Member

tianon commented Aug 24, 2018

Can you elaborate on why this was done as an environment variable instead of simply as additional arguments?

For example, the following is how I'd implement this, which would allow for directly doing docker run ... nuxeo nuxeoctl console --ignore-missing, which IMO is way more natural than an environment variable:

  if [ "$2" = "console" ]; then
    exec nuxeoctl console "${@:2}"
  else
    exec "$@"
  fi

That being said though, in this case, isn't $1 already nuxeoctl? So if $2 is then console, why does this special case exist at all? Why isn't this simply handled by exec "$@" which should DTRT already?

@dmetzler
Copy link
Contributor

I agree on your last comment.... I tried to review the history of that code (which I wrote :-) ) but I don't remember the exact reason for that.

We will modify accordingly, thx for the review.

@ffjdm ffjdm closed this Aug 25, 2018
@tianon
Copy link
Member

tianon commented Aug 25, 2018 via email

@ffjdm
Copy link
Contributor Author

ffjdm commented Aug 27, 2018

Indeed but the image has to be cleaned up first. Please see #4776 for this.

@tianon tianon mentioned this pull request Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants