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

Run setup non-interactively? #2388

Open
eyalzek opened this issue Jul 3, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@eyalzek
Copy link

commented Jul 3, 2019

I'm running talk on kubernetes and would like to run the setup using an initContainer. Is there a way at the moment to do this (besides using --defaults) ? It looks like the dynamic set up is updating talk.settings & talk.users. I tried to break it down to commands in order to run it non-interactively, e.g:

  • bin/cli db createIndexes
    bin/cli migrations run -y (not sure this one is necessary)
  • bin/cli setup --defaults

and this is where the problem starts, because editing users and settings using the cli is ALSO an interactive prompt... Trying to echo input to the command works only for the first prompt. I want to avoid using Expect.

It would be great to have a way to set up the app non-interactively but also in an idempotent way (i.e: this can run on any deployment without messing up the DB).

@eyalzek eyalzek changed the title Run set non-interactively? Run setup non-interactively? Jul 3, 2019

@wyattjoh

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

While less idea, we would strongly recommend using the Web/UI to configure Talk, as in v5 we're planning on deprecating the CLI for setup.

@eyalzek

This comment has been minimized.

Copy link
Author

commented Jul 3, 2019

Thanks for the info. Is this use case something that you considered? I can't imagine I'm the first one to run talk on k8s. Reading from environment variables on start up or something similar would be ideal.

Otherwise, what would the recommended flow? Deploying initially, running manual setup, setting TALK_INSTALL_LOCK then restarting the instance?

@kgardnr kgardnr added the question label Jul 3, 2019

@wyattjoh

This comment has been minimized.

Copy link
Member

commented Jul 4, 2019

We've certainly considered k8s (as we deploy to it ourselves!) but expect that anyone setting up a new Talk install will want to go through the installation steps once, sort of how you would go through the wordpress install once on setup.

As a note as well, while the TALK_INSTALL_LOCK does help short circuit any installation attempts, it is not explicitly required. Once an installation has been completed, it will check the database to see if it is already installed before allowing anything.

@eyalzek

This comment has been minimized.

Copy link
Author

commented Jul 5, 2019

I see, thank you. We will go with the manual setup for the moment, but I do think that exposing a way to do this non-interactively would be valuable - even just for the sake of having a full definition of the app in your code base (possibly with different configuration per environment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.