chore(): fix script variable name

This commit is contained in:
Nicolas Carlier 2020-02-01 09:41:14 +00:00
parent f88d743367
commit d2189cfd6c
3 changed files with 8 additions and 8 deletions

View File

@ -51,7 +51,7 @@ All configuration variables are described in [etc/default/webhookd.env](./etc/de
Webhooks are simple scripts within a directory structure.
By default inside the `./scripts` directory.
You can override the default using the `WHD_SCRIPTS_DIR` environment variable or `-script` parameter.
You can override the default using the `WHD_SCRIPTS` environment variable or `-script` parameter.
*Example:*

View File

@ -9,6 +9,6 @@ services:
ports:
- "8080:8080"
environment:
- WHD_SCRIPTS_DIR=/scripts
- WHD_SCRIPTS=/scripts
volumes:
- ./scripts:/scripts

View File

@ -3,17 +3,17 @@
# Error function
die() { echo "error: $@" 1>&2 ; exit 1; }
if [ ! -z "$APP_SCRIPTS_GIT_URL" ]
if [ ! -z "$WHD_SCRIPTS_GIT_URL" ]
then
[ ! -f "$APP_SCRIPTS_GIT_KEY" ] && die "Git clone key not found."
[ ! -f "$WHD_SCRIPTS_GIT_KEY" ] && die "Git clone key not found."
export APP_SCRIPTS_DIR=${APP_SCRIPTS_DIR:-/opt/scripts-git}
export WHD_SCRIPTS=${WHD_SCRIPTS:-/opt/scripts-git}
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
mkdir -p $APP_SCRIPTS_DIR
mkdir -p $WHD_SCRIPTS
echo "Cloning $APP_SCRIPTS_GIT_URL into $APP_SCRIPTS_DIR ..."
ssh-agent sh -c 'ssh-add ${APP_SCRIPTS_GIT_KEY}; git clone --depth 1 --single-branch ${APP_SCRIPTS_GIT_URL} ${APP_SCRIPTS_DIR}'
echo "Cloning $WHD_SCRIPTS_GIT_URL into $WHD_SCRIPTS ..."
ssh-agent sh -c 'ssh-add ${WHD_SCRIPTS_GIT_KEY}; git clone --depth 1 --single-branch ${WHD_SCRIPTS_GIT_URL} ${WHD_SCRIPTS}'
[ $? != 0 ] && die "Unable to clone repository"
fi