-
Notifications
You must be signed in to change notification settings - Fork 644
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 logic to specify exec commands during postStart and preStop #272
Conversation
Thanks for the PR, I just did a quick review. Looks real good overall. Some minor remarks:
A general principle I try to follow is to implement only what is needed (and don't fall in the trap we might need it sometime as I did to often and frankly nearly never happened) and even when I think things like |
Signed-off-by: Dennis Leon <dennis.leon39@gmail.com>
Thanks for the feedback! wrt Optional, I figured it was ok to use since guava was on the classpath and was only a private helper method. But I agree looking back now it looks out of place considering null checks are mainly used. :-) |
Hey Rhuss, |
Ooops, didn't get any update by GitHub that the PR was changed. Will have a look ASAP. |
Thanks again ! I'm going to cleanup the duplicate code in |
Cool Thanks heaps Rhuss |
Can I use this to run more than one command? I cant seam to get it working. I have tried with two commands separated by ; or && (as &&). Only one command is ran.I can see both commands getting sent over rest interface as a "Cmd": "[]" but I get errors related to it and it does not look like its interpreted as two commands correctly. Any ideas? As i believe the first answer will be "put the commands in a script and execute that in one command" I want to also add some background to the problem. My setup runs well on Linux, but not on Windows. The command is supposed to run a script file with several commands in. On Windows this file looses its permissions somehow during transfer to the docker container and this is why I need to run two commands. One to restore +x and one to execute the script. |
There is a known issue with Windows which looses the execution permission. For a complete discussion please refer to #477, but in short with 0.15.9 you have the following options:
Does this help ? As a workaround you could also use 'sh /path/to/my/script' as command to explicitly call your script, too, so you dont have to rely on the execution bit. |
@rhuss Thank you very much! That worked well. I can now run the script because the execute permissions are kept on windows as well after changing the assembly mode to 'tar' in the pom-file. |
My configuration
/opt/postStart.sh return 1 exit code. |
Currently the exit status of a If you think this would be a useful addition, then please open an extra issue for that, describing your use case. thanks ! |
…rmediate_images_for_circleci Add ability to send --rm param on build (seems needed for CircleCI)
PR for #266
e.g.