Merge pull request #8508 from dokku/8230-renaming-app-clears-the-set-domain
Preserve all domains when renaming an app
This commit is contained in:
@@ -393,6 +393,62 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(domains) app rename preserves all subdomains across multiple global vhosts" {
|
||||
run /bin/bash -c "dokku domains:set-global ${DOKKU_DOMAIN} dokku.test"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku domains:set $TEST_APP $TEST_APP.${DOKKU_DOMAIN} $TEST_APP.dokku.test custom.example.com"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku apps:rename $TEST_APP other-name"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku domains:report other-name --domains-app-vhosts"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "other-name.${DOKKU_DOMAIN} other-name.dokku.test custom.example.com"
|
||||
|
||||
run /bin/bash -c "dokku apps:rename other-name $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(domains) app rename preserves custom domains when no global vhost is set" {
|
||||
run /bin/bash -c "dokku domains:clear-global"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku domains:set $TEST_APP custom.example.com other.example.org"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku apps:rename $TEST_APP other-name"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku domains:report other-name --domains-app-vhosts"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "custom.example.com other.example.org"
|
||||
|
||||
run /bin/bash -c "dokku apps:rename other-name $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(domains) verify warning on ipv4/ipv6 domain name" {
|
||||
touch /etc/nginx/sites-enabled/default
|
||||
rm "$DOKKU_ROOT/VHOST"
|
||||
|
||||
Reference in New Issue
Block a user