70 lines
2.1 KiB
Plaintext
70 lines
2.1 KiB
Plaintext
![]() |
import? "/etc/self-host-playbook/tiers/core.just"
|
||
|
import? "/etc/self-host-playbook/tiers/starter.just"
|
||
|
import? "/etc/self-host-playbook/tiers/premium.just"
|
||
|
|
||
|
@default:
|
||
|
#!/usr/bin/env bash
|
||
|
|
||
|
# Function to show the header
|
||
|
show_header() {
|
||
|
gum style \
|
||
|
--foreground 212 --border double --border-foreground 212 \
|
||
|
--align center --width 50 --margin "1 2" --padding "1 2" \
|
||
|
"🚀 DevOps Control Center 🚀"
|
||
|
}
|
||
|
|
||
|
# Function to create menu items with icons and descriptions
|
||
|
create_menu() {
|
||
|
echo "📊 Status - Show running docker containers"
|
||
|
echo "📝 Logs - View container logs"
|
||
|
echo "💾 Disk Usage - Show docker disk usage"
|
||
|
echo "🔄 Restart - Restart a specific container"
|
||
|
echo "🐳 Update Docker - Update Docker containers"
|
||
|
echo "❌ Exit"
|
||
|
}
|
||
|
|
||
|
while true; do
|
||
|
clear
|
||
|
show_header
|
||
|
|
||
|
# Show menu and get selection
|
||
|
choice=$(create_menu | gum choose --cursor.foreground 212 --selected.foreground 212 --header "Select an action:" --cursor "➜ ")
|
||
|
|
||
|
# Exit if no selection
|
||
|
if [ -z "$choice" ]; then
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
# Process selection
|
||
|
case $choice in
|
||
|
"📊 Status"*)
|
||
|
just status
|
||
|
;;
|
||
|
"📝 Logs"*)
|
||
|
just logs
|
||
|
;;
|
||
|
"🛑 Stop All"*)
|
||
|
just docker-stop-all
|
||
|
;;
|
||
|
"🗑️ Prune"*)
|
||
|
just docker-prune
|
||
|
;;
|
||
|
"💾 Disk Usage"*)
|
||
|
just docker-disk
|
||
|
;;
|
||
|
"🔄 Restart"*)
|
||
|
just docker-restart
|
||
|
;;
|
||
|
"🐳 Update Docker"*)
|
||
|
just update-containers
|
||
|
;;
|
||
|
"❌ Exit")
|
||
|
echo "Goodbye! 👋" | gum style --foreground 212
|
||
|
exit 0
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
# Pause after command execution
|
||
|
gum confirm "Press Enter to continue..." --default=true --affirmative "Continue" --negative "Exit" || exit 0
|
||
|
done
|