diff --git a/abra b/abra index f1aee280..cb8fdb03 100755 --- a/abra +++ b/abra @@ -10,10 +10,10 @@ sub_help(){ echo "Usage: $PROGRAM_NAME [options]" echo "" echo "Subcommands:" - echo " service_run SERVICE [CMD] run a command in the specified service's container" - echo " secret_generate SECRET VERSION generate a secret, store it in pass & as a Docker secret" - echo " deploy [COMPOSE_FILE] let 'em rip" - echo " logs SERVICE tail logs from a deployed service" + echo " service_run SERVICE [CMD] run a command in the specified service's container" + echo " secret_generate SECRET VERSION [CMD] generate a secret, store it in pass & as a Docker secret" + echo " deploy [COMPOSE_FILE] let 'em rip" + echo " logs SERVICE tail logs from a deployed service" echo "" echo "Make sure \$STACK_NAME is set (probably using direnv)" } @@ -21,13 +21,14 @@ sub_help(){ sub_secret_generate(){ SECRET=$1 VERSION=$2 + PW=${3:-pwqgen} if [ -z "$SECRET" ] || [ -z "$VERSION" ]; then echo "Usage: $PROGRAM_NAME secret_generate SECRET VERSION" exit fi - pwqgen | tee \ + $PW | tee \ >(docker secret create "${STACK_NAME}_${SECRET}_${VERSION}" -) \ >(pass insert "hosts/autonomic-swarm/${STACK_NAME}/${SECRET}" -m) }