feat: implement application cloning

Application cloning can be used to setup review applications based on an existing application. This is useful in CI/CD pipelines where a developer may wish to verify code in a custom environment without overwriting a shared staging environment.
This commit is contained in:
Jose Diaz-Gonzalez
2017-01-22 21:39:30 -07:00
parent 83bf99c8d0
commit a564eae9f1
4 changed files with 96 additions and 0 deletions

View File

@@ -90,3 +90,36 @@ teardown () {
echo "status: "$status
assert_success
}
@test "(apps) apps:clone" {
deploy_app
run bash -c "dokku apps:clone $TEST_APP great-test-name"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku apps | grep $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "curl --silent --write-out '%{http_code}\n' `dokku url great-test-name` | grep 404"
echo "output: "$output
echo "status: "$status
assert_output ""
run bash -c "dokku --force apps:destroy great-test-name"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku apps:clone --skip-deploy $TEST_APP great-test-name"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "curl --silent --write-out '%{http_code}\n' `dokku url great-test-name` | grep 404"
echo "output: "$output
echo "status: "$status
assert_failure
run bash -c "dokku --force apps:destroy great-test-name"
echo "output: "$output
echo "status: "$status
assert_success
}