This repository was archived by the owner on Dec 2, 2024. It is now read-only.
Conversation
gjtempleton
reviewed
Aug 27, 2020
| @@ -0,0 +1,7 @@ | |||
| #!/bin/bash | |||
|
|
|||
| echo $PLUGIN_IMAGE_ALIASES | jq -r 'to_entries[] | [.key, .value] | @tsv' | while read ORIGINAL NEW; do | |||
There was a problem hiding this comment.
It's been a while since I did drone plugin dev work, does Drone inject the dict variables as JSON formatted text for the env var? (I did try digging through the Drone docs and couldn't see any mention of how this is handled.)
There was a problem hiding this comment.
Managed to demo the answer to my own question, it does indeed.
Member
Author
There was a problem hiding this comment.
Yeah, it's weirdly inconsistent about it though:
- for a single value drone parameter, it comes through as a single plain env var
- for a list parameter, it comes through comma-separated (with no usable escaping AFAICT 😱)
- for a dict parameter, it comes as a JSON dict
I honestly have no idea why, but it is what it is 🤷♂️
Member
Author
|
Thanks @gjtempleton |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is intended to provide a crude solution to testcontainers/testcontainers-java#3099 for teams using Drone CI.
It allows users to specify a set of images that should be pulled and retagged, and exposes a hook script mechanism so that more custom implementations can be developed.
Note that I believe testcontainers/testcontainers-java#3102 is by far the better solution, but I believe this provides another option for Drone users who cannot use that approach.
Example usage from README: