31 lines
696 B
Plaintext
31 lines
696 B
Plaintext
|
#!/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
|