-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·212 lines (193 loc) · 4.5 KB
/
install.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#!/usr/bin/env bash
# Author: Francis Pelletier
# Date : January 2021
# This script is part of this project : https://github.com/f-PLT/dev-setup-scripts
# This script will configure everything. It is meant to be run
# on a newly installed system, or one meant to become a new
# developement environment.
#
# Tested with Ubuntu 18.04 and 20.04, as well a Vagrant
#
# Use at your own risks.
# basic tools scripts
basictools () {
(cd ~/dev-setup/scripts && ./basictools.sh)
}
# bash configuration
bashconf () {
(cd ~/dev-setup/scripts && ./bashconf.sh)
}
# ctools
c () {
(cd ~/dev-setup/scripts && ./ctools.sh)
}
# dockertools
docker () {
(cd ~/dev-setup/scripts && ./dockertools_config.sh)
}
ide () {
echo 'Installing VS Code'
sudo snap install code --classic
}
# javatools
java () {
(cd ~/dev-setup/scripts && ./javatools_config.sh)
}
# pythontools
python () {
(cd ~/dev-setup/scripts && ./pythontools_config.sh)
}
# Setting things in to place
setup () {
# System update
sudo apt-get update
curl -V
if [ $? != "0" ]
then
sudo apt-get install curl -y
fi
git --version
if [ $? != "0" ]
then
sudo apt-get install git -y
fi
# Fetch repo
if [ ! -d "$HOME/dev-setup" ]
then
git clone https://github.com/f-PLT/dev-setup-scripts.git ~/dev-setup
else
(cd ~/dev-setup && git pull)
fi
}
# ubuntuconfig
ubuntu () {
(cd ~/dev-setup/scripts && ./ubuntuconfig.sh)
}
# vim configuration
vimconf () {
(cd ~/dev-setup/scripts && ./vimconf.sh)
}
# webtools
web () {
(cd ~/dev-setup/scripts && ./webtools_config.sh)
}
# Preset installations
all () {
setup
bashconf
basictools
vimconf
ubuntu
python
docker
java
c
web
ide
}
desktop () {
setup
bashconf
vimconf
basictools
ubuntu
python
docker
web
ide
}
headless () {
setup
bashconf
vimconf
basictools
python
docker
web
}
list () {
echo " List of available configurations:"
echo
echo " - bashconf : Set .bashrc file. This will overwrite your .bashrc file,"
echo " Run this first, as python and other configurations"
echo " will modify this file too"
echo " - basictools : Basic packages and vim configuration."
echo " - c : C libraries"
echo " - docker : Docker installation and configuration"
echo " - ide : Install Vscode"
echo " - java : Open JDK, maven, gradle"
echo " - python : Python libraries"
echo " - setup : Updates system, fetches repository."
echo " Run this first if you downloaded install.sh file only"
echo " - ubuntu : Ubuntu system configs and themes"
echo " - vimconf : Set .vimrc file. This will overwrite your .vimrc file."
echo " - web : NVM, Yarn and"
echo
echo " Preset installation packages:"
echo
echo " - all : Installs everything"
echo " - desktop : Installs desktop selection:"
echo " basictools, bashconf, vimconf, docker, python, ubuntu, ide and web."
echo " - headless : Installs headless selection:"
echo " basictools, bashconf, vimconf, docker, python, and web."
}
if [[ "$#" -eq 0 ]]; then
list
fi
for var in "$@"
do
# Order is set according to use, not alphabetical order
case "$var" in
"list")
list
;;
"headless")
headless
;;
"desktop")
desktop
;;
"setup")
setup
;;
"bashconf")
bashconf
;;
"basictools")
basictools
;;
"vimconf")
vimconf
;;
"ide")
ide
;;
"ubuntu")
ubuntu
;;
"python")
python
;;
"web")
web
;;
"docker")
docker
;;
"java")
java
;;
"c")
c
;;
"all")
all
;;
*)
echo "* * * * * * * * * * * * * * * * * * * * * * * * * "
echo "* ""$var"" is not a valid input "
echo "* Use the list command to see available inputs"
echo "* * * * * * * * * * * * * * * * * * * * * * * * *"
exit 1
esac
done