Set DOCKER_HOST before creating secrets
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2020-09-25 20:32:04 +02:00
parent feba68f11e
commit cd8ef52860
1 changed files with 6 additions and 1 deletions

View File

@ -17,7 +17,12 @@ generate_secrets() {
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
docker secret ls
export DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT"
docker secret ls
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\" -";