-
Notifications
You must be signed in to change notification settings - Fork 112
Add support for docker load
#254
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 support for docker load
#254
Conversation
|
The example added in the README file is the use case that I was thinking of and that we need. I'm not sure if it makes sense to use |
b4b5a93 to
50bbcef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great PR! I really appreciate your splitting the huge command hook into separate files.
That said, I don't see the use-case for loading an image without actually running anything on it. The very example you show of using the load configuration also contains an image tag. And if it didn't, I'm not sure using the plugin would make sense in the first place as the docker daemon running that load step may very well not be used for anything else so making the run portion of the plugin inconditional anyways.
I would suggest that the load.sh is executed conditionally as it is now, but the run should always run no matter what.
What do you think?
|
Yes I agree with that in the current state, I'll make the run required. Although I do think it can make sense in the future if other commands like |
ec6083c to
b24a21c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor corrections. While I was at it, I also noticed that you added a load example to the plugin but did not document the configuration itself in the Optional section of README.md (make sure to keep the alphabetical order of them when you add it)
896db83 to
bea8101
Compare
|
Thanks for the feedback. Fixed the comments now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch with the shellcheck plugin not including all the new files! 👏
I tend to avoid disabling checks so I provided alternatives for all such instances (plus found that the additional options are not necessary due to a typo)
.buildkite/pipeline.yml
Outdated
| - libs/** | ||
| options: | ||
| - "--color=always" | ||
| - "--external-sources" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After correcting the typo above, this is no longer necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the testing I did it seems that this is still needed. Shellcheck won't follow the source directives if --external-sources is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is really weird, I ran the pipeline without the option and shellcheck did not fail. Can you try removing it so that we can further debug the issue seeing an actual run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @linus345! thanks again for this! are you able to try toote's suggestions so we can see the issue? thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely missed that this comment was made.
Sure I'll try it out tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking such a long time, pushed it without this commit now.
This refactor is done to make it easier to introduce additional commands like `docker load`.
This adds support for providing a `load` argument to load a docker image before running a command.
Two new directories, `commands` and `lib`, were added and they should also be shellchecked.
6f1c21f to
71464d5
Compare
|
Finally got around to fixing the comments. |
Sourcing the shared lib script allows shellcheck to see variables that are defined which is needed to prevent shellcheck from complaining about referencing unassigned variables. [SC2154](https://www.shellcheck.net/wiki/SC2154). `result is referenced but not assigned`
71464d5 to
4a4d2fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 sorry for the delay in getting back around to this
This PR is an attempt to implement support for
docker load.Related issue #253.
It first makes a small refactor by moving out the
runcommand code into its own file and making thehooks/commandfile only the entry point. This is the same structure that buildkite-plugins/docker-compose-buildkite-plugin uses. It then introduces a new file for thedocker loadcommand.