Merge pull request #4141 from dokku/always-initialize-repo
feat: always initialize git repository
This commit is contained in:
@@ -172,9 +172,14 @@ git_build() {
|
|||||||
local REF="$REV"
|
local REF="$REV"
|
||||||
else
|
else
|
||||||
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
||||||
REF=$(<"$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH")
|
if [[ -f "$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH" ]]; then
|
||||||
|
REF=$(<"$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH")
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$REF" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git_build_app_repo $APP $REF
|
git_build_app_repo $APP $REF
|
||||||
}
|
}
|
||||||
|
|||||||
14
plugins/git/post-create
Executable file
14
plugins/git/post-create
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -eo pipefail
|
||||||
|
[[ $DOKKU_TRACE ]] && set -x
|
||||||
|
source "$PLUGIN_AVAILABLE_PATH/git/functions"
|
||||||
|
|
||||||
|
trigger-git-post-create() {
|
||||||
|
declare desc="initializes an app with the correct git repository structure"
|
||||||
|
declare trigger="post-create"
|
||||||
|
declare APP="$1"
|
||||||
|
|
||||||
|
fn-git-create-hook "$APP"
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger-git-post-create "$@"
|
||||||
@@ -52,7 +52,7 @@ teardown() {
|
|||||||
run /bin/bash -c "test -d $DOKKU_ROOT/$TEST_APP/refs"
|
run /bin/bash -c "test -d $DOKKU_ROOT/$TEST_APP/refs"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_failure
|
assert_success
|
||||||
|
|
||||||
run /bin/bash -c "dokku git:initialize $TEST_APP"
|
run /bin/bash -c "dokku git:initialize $TEST_APP"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
@@ -69,7 +69,7 @@ teardown() {
|
|||||||
run /bin/bash -c "test -d $DOKKU_ROOT/$TEST_APP/refs"
|
run /bin/bash -c "test -d $DOKKU_ROOT/$TEST_APP/refs"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_failure
|
assert_success
|
||||||
|
|
||||||
deploy_app
|
deploy_app
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user