feat: Ajout du service watchtower
This commit is contained in:
30
watchtower/run
Executable file
30
watchtower/run
Executable 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
|
Reference in New Issue
Block a user