-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·73 lines (56 loc) · 1.48 KB
/
setup.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
#!/bin/sh
# script to initialize or update a CentOS or Fedora instance
# bootstraps the setup of a newly provisionned VM
# WARNING : you shoud make sure you added your public key to ~/.ssh/authorized_keys before doing that
set -e
set -x
OFFLINE=0
while test $# -gt 0; do
case "$1" in
--offline)
OFFLINE=1
shift
;;
esac
done
DISTRIB_NAME=$(awk '{print $1}' /etc/redhat-release)
# copy repo files to yum.repos.d directory
# repo files are embedded in the git repository for easier offline usage
find repos-$DISTRIB_NAME -name "*.repo" -exec cp {} /etc/yum.repos.d \;
find repos-$DISTRIB_NAME -name "RPM-GPG*" -exec cp {} /etc/pki/rpm-gpg/ \;
# if we are not doing an offline setup then we may use the downloaders ...
if test $OFFLINE -eq 0
then
pushd ./downloaders
for LOCAL_SCRIPT in $(ls *.sh)
do
./$LOCAL_SCRIPT
done
popd
fi
pushd ./installers
for LOCAL_SCRIPT in $(ls *.sh)
do
./$LOCAL_SCRIPT
done
popd
pushd ./configures
for LOCAL_SCRIPT in $(ls *.sh)
do
./$LOCAL_SCRIPT
done
popd
# pip and npm commands may not be available before installers are run
# so we have to use them AFTER installers are run
# if we are not doing an offline setup then we may download pip packages ...
if test $OFFLINE -eq 0
then
./pip-download-packages.sh
fi
./pip-install-packages.sh
# if we are not doing an offline setup then we may download node modules ...
if test $OFFLINE -eq 0
then
./npm-download-packages.sh
fi
echo "Finished successfully"