-
Notifications
You must be signed in to change notification settings - Fork 1
/
devenvdevilbox.sh
executable file
·185 lines (158 loc) · 5.08 KB
/
devenvdevilbox.sh
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
#!/bin/bash
echo "Install Prerequisite"
sudo apt install \
curl \
apt-transport-https \
ca-certificates \
software-properties-common \
ubuntu-restricted-extras
clear
installenv(){
echo "Install Docker"
sudo apt update -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update -y
sudo apt install docker-ce
echo "Applying user Docker permission"
sudo usermod -aG docker ${USER}
echo "Install Docker Compose v2.20.2"
sudo rm -rf $HOME/.docker/cli-plugins/docker-compose
curl -SL https://github.com/docker/compose/releases/download/v2.20.2/docker-compose-linux-x86_64 -o $HOME/.docker/cli-plugins/docker-compose
sudo chmod +x ~/.docker/cli-plugins/docker-compose
docker compose version
echo "Install Devilbox"
cd ~
git clone https://github.com/cytopia/devilbox.git
cd ~/devilbox/
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/.env
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/docker-compose.override.yml
mkdir sh
cd ~/devilbox/sh
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/sh/docker-entrypoint-es.sh
cd ~/devilbox/bash/
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/bash/aliases.sh
cd ~/devilbox/autostart/
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/autostart/autostart.sh
cd ~/devilbox/cfg/php-fpm-8.1/
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/cfg/php-fpm-x.x/www_server.conf
cd ~/devilbox/cfg/php-ini-8.1/
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/cfg/php-ini-x.x/memory_limit.ini
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/cfg/php-ini-x.x/timeouts.ini
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/cfg/php-ini-x.x/xdebug.ini
cd ~/devilbox/
clear
}
aliases(){
clear
echo "Add Aliases? y/n"
read aliases
if [ $aliases = "y" ]
then
echo "if [ -f ~/.aliases ]; then
source ~/.aliases
fi" >> ~/.zshrc
cd ~
curl -O https://raw.githubusercontent.com/Discorgento/dev-env-devilbox/main/devilbox/.aliases
echo "***Aliases added"
else
echo "***Do not add Aliases"
fi
}
zshsetup(){
echo "Add zsh? y/n"
read zshsetup
if [ $zshsetup = "y" ]
then
sudo apt install zsh
curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh;
zsh
sudo usermod --shell $(which zsh) $USER
echo "***Which zsh done!"
else
echo "***Do not add zsh"
fi
}
pluginzsh(){
echo "Add plugin zsh? y/n"
read pluginzsh
if [ $pluginzsh = "y" ]
then
sudo usermod --shell $(which zsh) $USER
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
mkdir -p ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install
echo "***Plugin zsh done!"
else
echo "***Do not add plugin zsh"
fi
}
welcomeenv(){
echo "
####################
Installed environment :D
If you have trouble starting the docker, restart the system
Obs (save these commands and links below)
Abraços
Jonatan Machado
Read the readme.md
####################
"
echo "
Environment Development DevilBox
Enter the folder
cd ~/devilbox
Command to lift containers
docker-compose up
Command to drop the containers
docker-compose down
"
echo "
Useful links
Devilbox DOC -> https://devilbox.readthedocs.io/en/latest/
Gnome Docker -> https://extensions.gnome.org/extension/2224/easy-docker-containers/
VSCODE Docker -> https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
"
echo "
Enable zsh plugins in file ~/.zshrc
dnf
zsh-syntax-highlighting
zsh-autosuggestions
"
}
echo -n "
What you want to install?
(D)evilBox
(Z)sh
(P)luginZsh
(A)liases(*need zsh)
(E)xit
"
read answerini
case "$answerini" in
d|D)
installenv
welcomeenv
;;
z|Z)
zshsetup
welcomeenv
;;
p|P)
pluginzsh
welcomeenv
;;
a|A)
aliases
welcomeenv
;;
e|E)
clear
echo "Bye..."
;;
*|"")
clear
echo "Invalid option"
;;
esac