diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index a001ab3fa..57dc999b3 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -803,6 +803,22 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # TODO ``` +### `git-get-property` + +- Description: Return the value for an app's git property +- Invoked by: +- Arguments: `$APP $KEY` +- Example: + +```shell +#!/usr/bin/env bash + +set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x +APP="$1"; PROPERTY="$2" + +# TODO +``` + ### `git-from-archive` - Description: Updates an app's git repository from an archive and then triggers a build diff --git a/plugins/20_events/git-get-property b/plugins/20_events/git-get-property new file mode 120000 index 000000000..5178a749f --- /dev/null +++ b/plugins/20_events/git-get-property @@ -0,0 +1 @@ +hook \ No newline at end of file diff --git a/plugins/git/git-get-property b/plugins/git/git-get-property new file mode 100755 index 000000000..182e9cd8e --- /dev/null +++ b/plugins/git/git-get-property @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -eo pipefail +source "$PLUGIN_AVAILABLE_PATH/git/internal-functions" +[[ $DOKKU_TRACE ]] && set -x + +trigger-git-git-get-property() { + declare desc="return the value for an app's git property" + declare trigger="git-get-property" + declare APP="$1" KEY="$2" + + if [[ "$KEY" == "source-image" ]]; then + fn-git-source-image "$APP" + return + fi + + return 1 +} + +trigger-git-git-get-property "$@"