mirror of
https://github.com/dokku/dokku.git
synced 2026-02-23 19:50:34 +01:00
@@ -149,7 +149,12 @@ dokku apps:clone node-js-app io-js-app
|
||||
Cloning node-js-app to io-js-app... done
|
||||
```
|
||||
|
||||
This will copy all of your app's contents into a new app directory with the name of your choice and then rebuild the new version of the app and deploy it. All of your config variables, including database urls, will be preserved. Custom domains and SSL certificates will not be copied to the new app.
|
||||
This will copy all of your app's contents into a new app directory with the name of your choice and then rebuild the new version of the app and deploy it with the following caveats:
|
||||
|
||||
- All of your environment variables, including database urls, will be preserved.
|
||||
- Custom domains are not applied to the new app.
|
||||
- SSL certificates will not be copied to the new app.
|
||||
- Port mappings with the scheme `https` and host-port `443` will be skipped.
|
||||
|
||||
> Warning: If you have exposed specific ports via docker-options, or performed anything that cannot be done against multiple applications, `apps:clone` may result in errors.
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ certs_post_app_clone_setup() {
|
||||
local APP_DIR="$DOKKU_ROOT/$NEW_APP"
|
||||
|
||||
rm -rf "$APP_DIR/tls"
|
||||
plugn trigger post-certs-remove "$NEW_APP"
|
||||
}
|
||||
|
||||
certs_post_app_clone_setup "$@"
|
||||
|
||||
@@ -5,16 +5,15 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/proxy/functions"
|
||||
|
||||
nginx_post_certs_remove() {
|
||||
trigger-proxy-post-certs-remove() {
|
||||
declare desc="unset port config vars after SSL cert is removed"
|
||||
local trigger="nginx_post_certs_remove"
|
||||
local APP="$1"
|
||||
if [[ "$(get_app_proxy_type "$APP")" == "nginx" ]]; then
|
||||
config_unset --no-restart "$APP" DOKKU_PROXY_SSL_PORT
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
remove_proxy_ports "$APP" $(filter_app_proxy_ports "$APP" "https" "443")
|
||||
fi
|
||||
config_unset --no-restart "$APP" DOKKU_PROXY_SSL_PORT
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
remove_proxy_ports "$APP" $(filter_app_proxy_ports "$APP" "https" "443")
|
||||
}
|
||||
|
||||
nginx_post_certs_remove "$@"
|
||||
trigger-proxy-post-certs-remove "$@"
|
||||
@@ -146,6 +146,27 @@ teardown () {
|
||||
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
|
||||
run /bin/bash -c "dokku apps:clone $TEST_APP app-without-ssl"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku --quiet proxy:ports app-without-ssl | xargs"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output "http 80 5000"
|
||||
run /bin/bash -c "dokku config:get app-without-ssl DOKKU_PROXY_SSL_PORT"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output ""
|
||||
run /bin/bash -c "dokku --force apps:destroy app-without-ssl"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(apps) apps:clone --skip-deploy" {
|
||||
deploy_app
|
||||
run /bin/bash -c "dokku apps:clone --skip-deploy $TEST_APP great-test-name"
|
||||
|
||||
Reference in New Issue
Block a user