Download yq instead of running it via docker
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2020-09-25 19:51:30 +02:00
parent 6c3aa39a76
commit 3ff306e037
1 changed files with 6 additions and 2 deletions

View File

@ -9,8 +9,12 @@ PLUGIN_USER=${PLUGIN_USER:-drone}
generate_secrets() {
echo "--- start secrets ---"
docker run --rm -v "${PWD}":/workdir mikefarah/yq ls
for SECRET in $(docker run --rm -v "${PWD}":/workdir mikefarah/yq yq r "$PLUGIN_COMPOSE" 'secrets.*.name'); do
# FIXME 3wc: use the yq docker image instead; couldn't easily get it working
VERSION=3.4.0
BINARY=yq_linux_amd64
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
eval "echo \"generating $SECRET\""
PW=$(</dev/urandom tr -dc 'A-Za-z0-9' | head -c 40; echo)
eval "echo \"$PW\" | docker secret create \"$SECRET\" -";