1
0
Fork 0

add secrets for username and password

master
Hanjo Meinhardt 7 years ago
parent 7c3070f327
commit 427cbc7af8

@ -1,11 +1,14 @@
#!/bin/sh #!/bin/sh
: ${PLUGIN_USERNAME?"missing username"} # set username from secret if not supplied
: ${PLUGIN_JSERVER?"missing jserver"} [ -z $PLUGIN_USERNAME ] && [ -n $SENDXMPP_USERNAME ] && PLUGIN_USERNAME="${SENDXMPP_USERNAME}"
: ${PLUGIN_PASSWORD?"missing password"} [ -z $PLUGIN_PASSWORD ] && [ -n $SENDXMPP_PASSWORD ] && PLUGIN_PASSWORD="${SENDXMPP_PASSWORD}"
: ${PLUGIN_RECIPIENT?"missing recipient"}
env | grep DRONE # check if all required fields are set
[ -z "$PLUGIN_USERNAME" ] && echo "missing username or sendxmpp_username secret" && exit 1
[ -z "$PLUGIN_PASSWORD" ] && echo "missing password or sendxmpp_password secret" && exit 1
[ -z "$PLUGIN_JSERVER" ] && echo "missing jserver" && exit 1
[ -z "$PLUGIN_RECIPIENT" ] && echo "missing recipient" && exit 1
MSG="drone ist da" MSG="drone ist da"

Loading…
Cancel
Save