-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure cloned/renamed apps have a link to linked services
Previously they would just 'disappear', resulting in broken applications until the app was relinked to the service in question. Closes dokku/dokku-redis#142
- Loading branch information
1 parent
e0c5f79
commit 14754aa
Showing
3 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" | ||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common-functions" | ||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions" | ||
set -eo pipefail | ||
[[ $DOKKU_TRACE ]] && set -x | ||
|
||
plugin-post-app-clone-setup() { | ||
declare OLD_APP_NAME="$1" NEW_APP_NAME="$2" | ||
|
||
local SERVICES=$(ls "$PLUGIN_DATA_ROOT" 2>/dev/null) | ||
for SERVICE in $SERVICES; do | ||
if in_links_file "$SERVICE" "$OLD_APP_NAME"; then | ||
add_to_links_file "$SERVICE" "$NEW_APP_NAME" | ||
fi | ||
done | ||
} | ||
|
||
plugin-post-app-clone-setup "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" | ||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common-functions" | ||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions" | ||
set -eo pipefail | ||
[[ $DOKKU_TRACE ]] && set -x | ||
|
||
plugin-post-app-rename-setup() { | ||
declare OLD_APP_NAME="$1" NEW_APP_NAME="$2" | ||
|
||
local SERVICES=$(ls "$PLUGIN_DATA_ROOT" 2>/dev/null) | ||
for SERVICE in $SERVICES; do | ||
if in_links_file "$SERVICE" "$OLD_APP_NAME"; then | ||
add_to_links_file "$SERVICE" "$NEW_APP_NAME" | ||
fi | ||
done | ||
} | ||
|
||
plugin-post-app-rename-setup "$@" |