Created
February 24, 2018 04:19
-
-
Save lox/9a7430aa56ae3a059bb8f8286aa7632f to your computer and use it in GitHub Desktop.
Helpers for Buildkite Plugins
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
# Reads either a value or a list from plugin config | |
function plugin_read_list() { | |
local prefix="BUILDKITE_PLUGIN_GOLANG_BUILD_$1" | |
local parameter="${prefix}_0" | |
if [[ -n "${!parameter:-}" ]]; then | |
local i=0 | |
local parameter="${prefix}_${i}" | |
while [[ -n "${!parameter:-}" ]]; do | |
echo "${!parameter}" | |
i=$((i+1)) | |
parameter="${prefix}_${i}" | |
done | |
elif [[ -n "${!prefix:-}" ]]; then | |
echo "${!prefix}" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment