-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
QUESTION: Graceful way to check for several things on startup #928
Comments
I was working on an installation command that does exactly what you said (except the user part). |
It might need adjustment. And it has a part to check permissions, which is likely not working. |
Thanks! I will give the command a try. It could be good to add the option to create the first super admin during the install (that way its existence would be properly checked as well). Looking at the source of |
The first user that is created through the WebUI gets super_admin permissions automatically, thats why I skipped it for now |
Correct but in the case of an automation (where the deployment requires that no registration is enabled from the getgo) it would be helpful, but I understand not necessarily critical. |
Trying to use the
|
Can you test the changes from #932 ? |
Hey man, sorry I missed this. I am not sure exactly what I was supposed to test on #932, since I am using an LDAP setup and the issue involves non-LDAP environments. I see you merged it tho. I have already rebuilt the images and pushed them to my docker repo. |
Aaah! will check that and get with you. Thanks! |
Tested it. Works for both new installs (empty database pre-created in sql client), and existing database. The only thing I have to do is continue to attempt to create the admin user (get an error if existing but there is no harm). You da man! Awaiting merge. |
@kevinpapst I see that kimai:install is non destructive. It looks like it runs migration if they are needed is that right? Can I run it against existing DBs during start up to check (and run) migrations for me if needed? |
That's what I am doing on the nginx/apache ones. Doesn't seem to affect existing database setups. It instead says it's found existing database/tables, etc, and says it is skipping. But I guess it would be good to get a confirmation (I mean from @kevinpapst, not in the script, hehe, I love it supports non-interactive now). @kevinpapst thanks for merging into master. It makes things way easier in setting up turn-key. |
Nope, unfortunately not. As I didn't knew the This method needs to be adjusted: Change the logic: Wanna send a PR? If not, please open a new feature request. |
Forget the request, I added a PR. Can you test #944 ? |
Will do, I'm in the middle of a massive refactor on the dockers atm. I'll do that later or tomorrow. |
You can test master tomorrow, I needed the change and merged it already |
So this is in master, right? I can just rebuild images to test? |
Exactly |
Everything seems to work OK. Output of my kimai docker container stdout:
|
did you try to re-start once more, when there is no more migration available? |
Yes:
|
Awesome, thanks 👍 |
Thank you, man! This a pretty cool project! |
It just gets better with more input and ideas from the community |
@kevinpapst I have finally implemented kimai2 log (whether dev or prod) to the container's stdout. You can check out the Dockefile/scripts here, for anyone who wants to do the same thing: |
Nice! If that is a general purpose Kimai container, you can send a PR to: |
Since it is not based on a vanilla nginx/apache php image, I am not sure if you'd consider it general purpose, unless what you mean is that it is generic, which that it is. It's based on the webdevops images. I am not using But, if y'all are interested in me making it available on github and PRing the documentation, I can do that. I just don't want to step on anyone's toes. |
Totally forgot about your comment here, sorry @bkraul ! Yes, having multiple options is great. If you want to share it, please do so! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai. |
@kevinpapst I was trying to find a question template for this, as this is not a bug. I am currently working on an nginx-based docker image. However, I want to make the deployment as hassle free as possible, controlled by the docker ENV vars.
I am using a base image that allows me to specify a number of entry point scripts (to be executed on launch of the container). Everything works, but after the first time, as the script tries to create schema, migrations, admin user (specified in docker-compose) it is obviously going to fail. The container works just fine, though.
However, the schema:create command clearly specifies "do not run this on a production environment", I would assume because it might break it?
Therefore, I am looking for a graceful way to check for:
This, using preferable a simple bash script, but I am open to a php script as well.
I think I have also found a way to send the output of the current log (env/prod) to the stdout. The base image I have uses supervisor. If I put the tail of of the log into a supervisor job, it will live for the duration of the container, and will display wherever the container's stdout is shown.
The text was updated successfully, but these errors were encountered: