-
Notifications
You must be signed in to change notification settings - Fork 48
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
Allow user-defined container name #58
Conversation
@alexdlukens Nice addition! Thank you for your contribution! I appreciate your effort. I'm busy today but will review and sort the merge request tomorrow. |
… to start a new container
… multiple docker run commands
bump 😬 we would also like to use this fix for |
@alexdlukens Hey Alex, do you know why the tests are failing? Maybe we can get the test pipeline to succeed and then merge the changes 🙂 |
@marcuspoehls I'm not sure why the tests are failing. I will investigate today |
@marcuspoehls Looks like a test failed because MongoDB did not initialize in 20 seconds. I didn't update anything that would change this behavior, but I could increase the startup timeout on line 59 in https://github.com/supercharge/mongodb-github-action/blob/main/start-mongodb.sh. Please let me know if this solution is acceptable |
Cleanup existing docker container beforehand, if it exists. This only occurs when running GitHub actions in an offline environment (e.g. using act), as there cannot be container conflicts using the GitHub-provided runners.
@alexdlukens I found the issue: the replica set didn’t start on a custom port. MongoDB always started on the default port. Here’s the fixing commit 7ff7ec9 |
Thanks so much @alexdlukens and @marcuspoehls. Our job passes locally in |
@marcuspoehls Final edit here: I see why this works now. I did not know that args after the image name get passed to the process inside the container. Thanks again! |
@alexdlukens Hey Alex, you’re right: all arguments after the image name are arguments for the process inside the Docker container. Basically pass-through arguments. @danyalaytekin Hey Danyal, thank you for confirming that the container name feature works 🙂 That’s nice! |
I ran into #24 when using this action inside a matrix. The workflow was attempting to start multiple mongodb containers, causing all but one to error out.
My solution to this was to allow the container name to be input as a configuration option, and using the matrix to differentiate the container names and ports.
Example:
Edit:
Would like to note that this issue occurred when running the workflow locally via act