-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
Β·191 lines (162 loc) Β· 6.25 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
Β·191 lines (162 loc) Β· 6.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/bin/bash
# Cosmic DevOps Installer
# The Gateway to Joyful DevOps!
# Colors and styling
BOLD="\033[1m"
GREEN="\033[0;32m"
CYAN="\033[0;36m"
MAGENTA="\033[0;35m"
YELLOW="\033[0;33m"
RED="\033[0;31m"
RESET="\033[0m"
# Cosmic ASCII art
function show_cosmic_banner() {
echo -e "${CYAN}"
echo " βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
echo " β β"
echo " β ${YELLOW}βββββββββββ¦ββ¦βββ ββ¦βββββ¦ β¦ββββ ββ£βββ ββββββββ¦ββ¦ β¦${CYAN} β"
echo " β ${YELLOW}β β βββββββββ ββββ£ βββββ ββ β¦ββββ ββ£ βββ β βββ${CYAN} β"
echo " β ${YELLOW}ββββββββββ© β©β©βββ ββ©ββββ ββ ββββ©βββββ ββββββ β© ββ©β${CYAN} β"
echo " β β"
echo " βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ"
echo -e "${RESET}"
echo -e " ${MAGENTA}β Installing Cosmic DevOps Symphony β${RESET}"
echo
}
# Progress bar function
function show_progress() {
local msg="$1"
local duration=${2:-2}
local width=50
local step=$((width / duration / 5))
echo -e "${msg}"
for ((i = 0; i <= width; i += step)); do
# Create progress bar with stars and stardust
local bar=$(printf 'β%0.s' $(seq 1 $((i / 5))))
local spaces=$(printf ' %0.s' $(seq 1 $(((width - i) / 5))))
printf "\r[%s%s] %d%%" "$bar" "$spaces" $((i * 100 / width))
sleep 0.2
done
echo
}
# Simulate gem install for lolcat
function install_lolcat() {
echo -e "\n${YELLOW}Installing lolcat for maximum joy...${RESET}"
echo "gem install lolcat"
show_progress "Installing colorful output capabilities..." 3
echo -e "${GREEN}lolcat installed successfully!${RESET}"
}
# Simulate installing whiptail if needed
function install_whiptail() {
echo -e "\n${YELLOW}Installing whiptail for cosmic interface...${RESET}"
echo "brew install newt"
show_progress "Installing interface capabilities..." 3
echo -e "${GREEN}whiptail installed successfully!${RESET}"
}
# Main installation function
function install_cosmic_devops() {
local repo="$1"
local ai_council="$2"
local mood="$3"
local confetti_level="$4"
echo -e "\n${CYAN}Starting Cosmic DevOps installation...${RESET}"
show_progress "Preparing for cosmic journey..." 2
echo -e "\n${CYAN}Configuring AI Council of Agents: ${YELLOW}$ai_council${RESET}"
show_progress "Assembling the AI council..." 3
echo -e "\n${CYAN}Setting mood to: ${YELLOW}$mood${RESET}"
show_progress "Adjusting cosmic vibrations..." 2
echo -e "\n${CYAN}Confetti level: ${YELLOW}$confetti_level${RESET}"
show_progress "Calibrating celebration intensity..." 2
echo -e "\n${CYAN}Creating symlink to launch script...${RESET}"
echo "ln -sf ~/cosmic-devops/launch.sh /usr/local/bin/cosmic-devops"
show_progress "Finalizing installation..." 3
echo -e "\n${GREEN}${BOLD}β
Cosmic DevOps installed successfully!${RESET}"
echo -e "${GREEN}${BOLD}β
Run 'cosmic-devops' or ~/cosmic-devops/launch.sh to start!${RESET}"
echo -e "\n${MAGENTA}${BOLD}Thank you for choosing Cosmic DevOps - may your deployments be joyful! π${RESET}"
}
# Parse command line arguments
function parse_args() {
local repo="theapexintelligence"
local ai_council="dolphin,owl,raven"
local mood="playful"
local confetti_level="max"
while [[ $# -gt 0 ]]; do
case "$1" in
--repo=*)
repo="${1#*=}"
shift
;;
--ai-council=*)
ai_council="${1#*=}"
shift
;;
--mood=*)
mood="${1#*=}"
shift
;;
--confetti-level=*)
confetti_level="${1#*=}"
shift
;;
*)
echo "Unknown parameter: $1"
shift
;;
esac
done
install_cosmic_devops "$repo" "$ai_council" "$mood" "$confetti_level"
}
# Make all scripts executable
function make_executable() {
chmod +x ~/cosmic-devops/launch.sh
chmod +x ~/cosmic-devops/agents/*.sh 2>/dev/null
chmod +x ~/cosmic-devops/healing/*.sh 2>/dev/null
chmod +x ~/cosmic-devops/chaos-monkey.sh 2>/dev/null
echo -e "${GREEN}Scripts made executable!${RESET}"
}
# Main installation process
show_cosmic_banner
echo -e "${CYAN}Welcome to the Cosmic DevOps Installer!${RESET}"
echo -e "This will set up the most joyful DevOps system in the universe!\n"
# Check if directory already exists
if [[ -d ~/cosmic-devops && -f ~/cosmic-devops/launch.sh ]]; then
echo -e "${YELLOW}Cosmic DevOps is already installed!${RESET}"
echo -e "Would you like to (r)einstall, (u)pgrade, or (c)ancel? [r/u/c]: "
read -r action
case "$action" in
r|R)
echo -e "${YELLOW}Reinstalling Cosmic DevOps...${RESET}"
;;
u|U)
echo -e "${YELLOW}Upgrading Cosmic DevOps...${RESET}"
;;
*)
echo -e "${YELLOW}Installation cancelled. You can still run the existing installation.${RESET}"
exit 0
;;
esac
fi
# Check for dependencies
if ! command -v whiptail >/dev/null 2>&1; then
echo -e "${YELLOW}whiptail not found. Would you like to install it? [y/n]: ${RESET}"
read -r install_ui
if [[ "$install_ui" == "y" || "$install_ui" == "Y" ]]; then
install_whiptail
else
echo -e "${YELLOW}Note: The cosmic interface will use fallback mode without whiptail.${RESET}"
fi
fi
if ! command -v lolcat >/dev/null 2>&1; then
echo -e "${YELLOW}lolcat not found. Would you like to install it for cosmic colors? [y/n]: ${RESET}"
read -r install_lolcat_yn
if [[ "$install_lolcat_yn" == "y" || "$install_lolcat_yn" == "Y" ]]; then
install_lolcat
else
echo -e "${YELLOW}Note: Your cosmic experience will be less colorful without lolcat.${RESET}"
fi
fi
# Make executable
make_executable
# Parse arguments and complete installation
echo -e "\n${CYAN}Using installation parameters from command line...${RESET}"
parse_args "$@"