fix: automatically clear the git source-image property when changing deployment methodologies

This ensures users don't have issues with cached state in regards to files pulled from the repo/image.

Also add missing docs for deploy-source-set trigger.

Closes #5963
This commit is contained in:
Jose Diaz-Gonzalez
2023-07-08 17:12:23 -04:00
parent 11d9ed6724
commit b8680f7de7
4 changed files with 34 additions and 26 deletions

18
plugins/git/deploy-source-set Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-git-deploy-source-set() {
declare desc="clears the source-image if the source type is not docker"
declare trigger="deploy-source-set"
declare APP="$1" SOURCE_TYPE="$2"
if [[ "$SOURCE_TYPE" == "docker-image" ]]; then
return
fi
fn-plugin-property-write "git" "$APP" "source-image"
}
trigger-git-deploy-source-set "$@"