Wire up the bash -> python pass through

This commit is contained in:
Luke Murphy 2020-04-13 09:52:26 +02:00
parent 61445600d3
commit d3846c436a
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
4 changed files with 51 additions and 4 deletions

View File

@ -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"
}

10
scripts/postdelete.py Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python3
def postdelete():
"""Post-delete steps."""
pass
if __name__ == '__main__':
postdelete()

10
scripts/postdeploy.py Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python3
def postdeploy():
"""Post-deploy steps."""
pass
if __name__ == '__main__':
postdeploy()

10
scripts/predeploy.py Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python3
def predeploy():
"""Pre-deploy steps."""
pass
if __name__ == '__main__':
predeploy()