feat: allow keeping the git directory during builds

It may be desirable to keep the contents of the git directory for the build process. Certain build tools can extract extra information from the .git directory, and some workflows may require that the shipped artifact has the entire source code available locally for later usage.
This commit is contained in:
Jose Diaz-Gonzalez
2019-09-15 19:06:38 -04:00
parent f83a03a3dc
commit 14838de344
4 changed files with 33 additions and 4 deletions

View File

@@ -19,12 +19,12 @@ git-set-cmd() {
local cmd="git:set" argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
declare APP="$1" KEY="$2" VALUE="$3"
local VALID_KEYS=("deploy-branch" "rev-env-var")
local VALID_KEYS=("deploy-branch" "keep-git-dir" "rev-env-var")
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then
dokku_log_fail "Invalid key specified, valid keys include: deploy-branch, rev-env-var"
dokku_log_fail "Invalid key specified, valid keys include: deploy-branch, keep-git-dir, rev-env-var"
fi
if [[ -n "$VALUE" ]]; then