Handle secret generation in multiple compose files?
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
3wc 2023-01-20 23:34:12 -08:00
parent 768c48ddf9
commit 69df540680

View File

@ -31,7 +31,8 @@ generate_secrets() {
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq &&\
chmod +x /usr/bin/yq
for SECRET in $(yq r "$PLUGIN_COMPOSE" 'secrets.*.name'); do
# shellcheck disable=SC2086
for SECRET in $(yq r ${PLUGIN_COMPOSE//:/ } 'secrets.*.name'); do
SECRET=$(eval echo "$SECRET")
if docker -H "$REMOTE_DOCKER_HOST" secret ls | grep -q "$SECRET"; then
echo "Skipping existing secret $SECRET"