Tidy up secret generation
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2020-09-25 20:55:07 +02:00
parent 49bf48039b
commit 904c475947
1 changed files with 3 additions and 3 deletions

View File

@ -22,9 +22,9 @@ generate_secrets() {
for SECRET in $(yq r "$PLUGIN_COMPOSE" 'secrets.*.name'); do
SECRET=$(eval echo "$SECRET")
docker secret ls
echo "$SECRET"
if ! docker secret ls | grep -q "$SECRET"; then
if docker secret ls | grep -q "$SECRET"; then
echo "Skipping existing secret $SECRET"
else
eval "echo \"generating $SECRET\""
PW=$(</dev/urandom tr -dc 'A-Za-z0-9' | head -c 40; echo)
eval "echo \"$PW\" | docker secret create \"$SECRET\" -";