-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shell) add kx alias to export config
also updates other aliases to first try the kong default file; kong.yml, and adds an explanation when shelling into container
- Loading branch information
Showing
7 changed files
with
51 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
kong-versions/nightly-ee/* | ||
kong-versions/nightly/* | ||
servroot | ||
.pongo |
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
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,27 @@ | ||
#!/bin/sh | ||
|
||
# export the kong configuration to "kong.yml" | ||
|
||
|
||
echo '' | ||
if [ -f /kong-plugin/kong.yml ]; then | ||
if [ ! "$1" = "-y" ]; then | ||
echo "The file \"kong.yml\" already exists, overwrite? (y/n, or use \"-y\") " | ||
old_stty_cfg=$(stty -g) | ||
stty raw -echo | ||
answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) | ||
stty "$old_stty_cfg" | ||
if ! echo "$answer" | grep -iq "^y" ;then | ||
exit 0 | ||
fi | ||
fi | ||
fi | ||
|
||
|
||
echo "Exporting declarative config to \"kong.yml\"..." | ||
#kong config db_export /kong-plugin/kong.yml | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to export to \"kong.yml\"" | ||
exit 1 | ||
fi | ||
echo "Export to \"kong.yml\" complete." |
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
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