mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
This fixes issues where alternative tools that don't trigger the init via sshcommand - such as git-http-backend - are not able to setup applications correctly. Note that those apps could always manually trigger git:initialize if desired, but if the app already exists, then this should already _just work_ without that extra initialization.
81 lines
1.7 KiB
Bash
81 lines
1.7 KiB
Bash
#!/usr/bin/env bats
|
|
|
|
load test_helper
|
|
|
|
setup() {
|
|
global_setup
|
|
create_app
|
|
}
|
|
|
|
teardown() {
|
|
destroy_app
|
|
global_teardown
|
|
}
|
|
|
|
@test "(git) deploy specific branch" {
|
|
run /bin/bash -c "dokku git:set --global deploy-branch global-branch"
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
|
|
GIT_REMOTE_BRANCH=global-branch run deploy_app
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
|
|
run /bin/bash -c "dokku ps:rebuild $TEST_APP"
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
|
|
run deploy_app
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
assert_output_contains "deploy did not complete"
|
|
|
|
run /bin/bash -c "dokku git:set $TEST_APP deploy-branch app-branch"
|
|
GIT_REMOTE_BRANCH=app-branch run deploy_app
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
|
|
run /bin/bash -c "dokku ps:rebuild $TEST_APP"
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
|
|
run /bin/bash -c "dokku git:set --global deploy-branch"
|
|
}
|
|
|
|
@test "(git) git:initialize" {
|
|
run /bin/bash -c "test -d $DOKKU_ROOT/$TEST_APP/refs"
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
|
|
run /bin/bash -c "dokku git:initialize $TEST_APP"
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
|
|
run /bin/bash -c "test -d $DOKKU_ROOT/$TEST_APP/refs"
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
}
|
|
|
|
@test "(git) git:initialize via deploy" {
|
|
run /bin/bash -c "test -d $DOKKU_ROOT/$TEST_APP/refs"
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
|
|
deploy_app
|
|
|
|
run /bin/bash -c "test -d $DOKKU_ROOT/$TEST_APP/refs"
|
|
echo "output: $output"
|
|
echo "status: $status"
|
|
assert_success
|
|
}
|