Merge pull request #3861 from dokku/3821-fix-clone-rename

Fix app clone and rename calls
This commit is contained in:
Jose Diaz-Gonzalez
2020-02-18 00:42:25 -05:00
committed by GitHub
33 changed files with 570 additions and 133 deletions

View File

@@ -117,10 +117,67 @@ teardown() {
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku apps:rename $TEST_APP great-test-name"
run /bin/bash -c "dokku buildpacks:add $TEST_APP https://github.com/heroku/heroku-buildpack-ruby.git"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku git:set $TEST_APP deploy-branch SOME_BRANCH_NAME"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku network:set $TEST_APP attach-post-create test-network"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv4 127.0.0.1"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku resource:limit --memory 100 $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku scheduler-docker-local:set $TEST_APP disable-chown true"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku --trace apps:rename $TEST_APP great-test-name"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku buildpacks:report great-test-name --buildpacks-list"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "https://github.com/heroku/heroku-buildpack-ruby.git"
run /bin/bash -c "dokku git:report great-test-name --git-deploy-branch"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "SOME_BRANCH_NAME"
run /bin/bash -c "dokku network:report great-test-name --network-attach-post-create"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "test-network"
run /bin/bash -c "dokku nginx:report great-test-name --nginx-bind-address-ipv4"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "127.0.0.1"
run /bin/bash -c "dokku resource:report great-test-name --resource-_default_.limit.memory"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "100"
run /bin/bash -c "dokku scheduler-docker-local:report great-test-name --scheduler-docker-local-disable-chown"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "true"
run /bin/bash -c "dokku --force apps:destroy great-test-name"
echo "output: $output"
echo "status: $status"
@@ -160,6 +217,83 @@ teardown() {
assert_success
}
@test "(apps) apps:clone (no app)" {
run /bin/bash -c "dokku apps:create $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku buildpacks:add $TEST_APP https://github.com/heroku/heroku-buildpack-ruby.git"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku git:set $TEST_APP deploy-branch SOME_BRANCH_NAME"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku network:set $TEST_APP attach-post-create test-network"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv4 127.0.0.1"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku resource:limit --memory 100 $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku scheduler-docker-local:set $TEST_APP disable-chown true"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku apps:clone $TEST_APP great-test-name"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku apps:list | grep $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku buildpacks:report great-test-name --buildpacks-list"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "https://github.com/heroku/heroku-buildpack-ruby.git"
run /bin/bash -c "dokku git:report great-test-name --git-deploy-branch"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "SOME_BRANCH_NAME"
run /bin/bash -c "dokku network:report great-test-name --network-attach-post-create"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "test-network"
run /bin/bash -c "dokku nginx:report great-test-name --nginx-bind-address-ipv4"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "127.0.0.1"
run /bin/bash -c "dokku resource:report great-test-name --resource-_default_.limit.memory"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "100"
run /bin/bash -c "dokku scheduler-docker-local:report great-test-name --scheduler-docker-local-disable-chown"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "true"
run /bin/bash -c "dokku --force apps:destroy great-test-name"
echo "output: $output"
echo "status: $status"
assert_success
}
@test "(apps) apps:clone ssl-app" {
run /bin/bash -c "dokku config:set --no-restart $TEST_APP DOKKU_PROXY_PORT_MAP=https:443:5000 DOKKU_PROXY_SSL_PORT=443"
deploy_app

View File

@@ -85,32 +85,32 @@ teardown() {
}
@test "(network) network management" {
run /bin/bash -c "dokku network:list | grep test-network"
run /bin/bash -c "dokku network:list | grep $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_failure
run /bin/bash -c "dokku network:exists test-network"
run /bin/bash -c "dokku network:exists $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_failure
run /bin/bash -c "dokku network:create test-network"
run /bin/bash -c "dokku network:create $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku network:list | grep test-network"
run /bin/bash -c "dokku network:list | grep $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku network:create test-network"
run /bin/bash -c "dokku network:create $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_failure
run /bin/bash -c "dokku network:exists test-network"
run /bin/bash -c "dokku network:exists $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_success
@@ -125,22 +125,22 @@ teardown() {
echo "status: $status"
assert_failure
run /bin/bash -c "dokku --force network:destroy test-network"
run /bin/bash -c "dokku --force network:destroy $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku --force network:destroy test-network"
run /bin/bash -c "dokku --force network:destroy $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_failure
run /bin/bash -c "dokku network:exists test-network"
run /bin/bash -c "dokku network:exists $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_failure
run /bin/bash -c "dokku network:list | grep test-network"
run /bin/bash -c "dokku network:list | grep $TEST_NETWORK"
echo "output: $output"
echo "status: $status"
assert_failure