From c793dca61aca2efe1b8ca908557c549c032ad72c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 24 Oct 2015 00:20:54 -0400 Subject: [PATCH] Add documentation for pre-receive-app trigger [ci skip] --- docs/development/plugin-triggers.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index 50e7fdb35..b0e77bded 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -587,6 +587,25 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x nginx -t ``` +### `pre-receive-app` + +- Description: Allows you to customize the contents of an application directory before they are processed for deployment. The `IMAGE_SOURCE_TYPE` can be any of `[herokuish, dockerfile]` +- Invoked by: `dokku git-hook`, `dokku tar-build-locked` +- Arguments: `$APP $IMAGE_SOURCE_TYPE $TMP_WORK_DIR` +- Example: + +```shell +#!/usr/bin/env bash +# Adds a file called `dokku-is-awesome` to the repository +# the contents will be the application name + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x + +APP="$1"; IMAGE_SOURCE_TYPE="$2"; TMP_WORK_DIR="$3" + +echo "$APP" > "$TMP_WORK_DIR/dokku-is-awesome" +``` + ### `receive-app` - Description: Allows you to customize what occurs when an app is received. Normally just triggers an application build.