feat: add plugin trigger for checking if an app has code

This will allow us to short-circuit build processes that would otherwise be triggered due to various commands in Dokku.
This commit is contained in:
Jose Diaz-Gonzalez
2022-04-03 13:20:50 -04:00
parent 68c0d7e964
commit 1b6861cdbb
3 changed files with 48 additions and 0 deletions

18
plugins/git/git-has-code Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
source "$PLUGIN_AVAILABLE_PATH/git/internal-functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-git-git-has-code() {
declare desc="checks if there is code at a specific branch"
declare trigger="git-has-code"
declare APP="$1" BRANCH_NAME="$2"
if fn-git-has-code "$APP" "$BRANCH_NAME"; then
return 0
fi
return 1
}
trigger-git-git-has-code "$@"