Delete secrets if using `generate_secrets`
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2020-09-25 20:37:43 +02:00
parent d9b0724a19
commit 1fb6799b10
1 changed files with 1 additions and 2 deletions

View File

@ -18,11 +18,10 @@ generate_secrets() {
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq &&\
chmod +x /usr/bin/yq
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 "docker secret rm \"$SECRET\" - || true";
eval "echo \"generating $SECRET\""
PW=$(</dev/urandom tr -dc 'A-Za-z0-9' | head -c 40; echo)
eval "echo \"$PW\" | docker secret create \"$SECRET\" -";