feat: Ajout du service watchtower

This commit is contained in:
2020-06-01 09:42:46 +02:00
parent afe28be81e
commit a44047d779
4 changed files with 72 additions and 0 deletions

30
watchtower/run Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $DIR/../help.sh
watchtower_help() {
echo "./run config : 🔑 Génération du fichier config.json"
}
watchtower_config() {
script_env
echo "🔑 Génération du fichier config.json"
CONFIG_PATH_DEFAULT="./config.json"
CONFIG_PATH=${CONFIG_PATH:-$CONFIG_PATH_DEFAULT}
echo "{\"auths\":{\"$REGISTRY_DOMAIN\":{\"auth\":\"$(echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64)\"}}}" > $CONFIG_PATH
}
if [ $# -ge 1 ]; then
if [ "${1}" == "config" ]; then
script_start
watchtower_config
script_end
elif [ "${1}" != "--only-source" ]; then
watchtower_help
fi
else
watchtower_help
fi