From d3846c436ab6e41d9addb10102bb0723db7e2f34 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Mon, 13 Apr 2020 09:52:26 +0200 Subject: [PATCH] Wire up the bash -> python pass through --- functions | 25 +++++++++++++++++++++---- scripts/postdelete.py | 10 ++++++++++ scripts/postdeploy.py | 10 ++++++++++ scripts/predeploy.py | 10 ++++++++++ 4 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 scripts/postdelete.py create mode 100644 scripts/postdeploy.py create mode 100644 scripts/predeploy.py diff --git a/functions b/functions index 3d8d19b..c1d05ed 100755 --- a/functions +++ b/functions @@ -89,14 +89,31 @@ dokku-ansible-deploy-pre-deploy() { declare desc="run the pre-deploy hook to setup an app" declare APP="$1" + declare PREDEPLOY="$PLUGIN_CORE_AVAILABLE_PATH/ansible-deploy/scripts/predeploy.py" + + dokku_col_log_info1_quiet "Running pre-deployment steps" + /usr/bin/python3 "$PREDEPLOY" - # steps are as follows... all from a python script - # if deploy.d/config.yml exists, then yaml load that sucka up - # run the ansible-playbook command with all the options and vars passed in } dokku-ansible-deploy-post-deploy() { # shellcheck disable=SC2034 declare desc="run the post-deploy hook to finish an app setup" - dokku_col_log_info1_quiet "TODO: Implement post-deploy..." + + declare APP="$1" + declare POSTDEPLOY="$PLUGIN_CORE_AVAILABLE_PATH/ansible-deploy/scripts/postdeploy.py" + + dokku_col_log_info1_quiet "Running post-deploy steps" + /usr/bin/python3 "$POSTDEPLOY" "$APP" +} + +dokku-ansible-deploy-post-delete() { + # shellcheck disable=SC2034 + declare desc="run the post-delete hook to remove an app" + + declare APP="$1" + declare POSTDELETE="$PLUGIN_CORE_AVAILABLE_PATH/ansible-deploy/scripts/postdelete.py" + + dokku_col_log_info1_quiet "Running post-delete steps" + /usr/bin/python3 "$POSTDELETE" "$APP" } diff --git a/scripts/postdelete.py b/scripts/postdelete.py new file mode 100644 index 0000000..aa1d221 --- /dev/null +++ b/scripts/postdelete.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + + +def postdelete(): + """Post-delete steps.""" + pass + + +if __name__ == '__main__': + postdelete() diff --git a/scripts/postdeploy.py b/scripts/postdeploy.py new file mode 100644 index 0000000..b39832a --- /dev/null +++ b/scripts/postdeploy.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + + +def postdeploy(): + """Post-deploy steps.""" + pass + + +if __name__ == '__main__': + postdeploy() diff --git a/scripts/predeploy.py b/scripts/predeploy.py new file mode 100644 index 0000000..feb6944 --- /dev/null +++ b/scripts/predeploy.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + + +def predeploy(): + """Pre-deploy steps.""" + pass + + +if __name__ == '__main__': + predeploy()