-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-all.sh
executable file
·114 lines (100 loc) · 3.13 KB
/
install-all.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
#!/bin/bash
#
# Setup development environment. Creates hostcert, admin cert, and copies them to builder locations.
#
gitdir=~/git
destdir=~/
pyprojects="cheroot sdcc-pluginmanager credible vc3-infoservice vc3-client vc3-master vc3-resource-tool vc3-wrappers vc3-factory-plugins"
makeprojects="vc3-builder"
f_copyconf() {
DEST=$1
mkdir -p $DEST/etc
if ls etc/*.conf* > /dev/null 2>&1; then
echo "Copying conf files to $DEST"
cp etc/*.conf* $DEST/etc
fi
if ls etc/*.template > /dev/null 2>&1; then
echo "Copying conf files to $DEST"
cp etc/*.template $DEST/etc
fi
}
for p in $pyprojects; do
echo $p
if [ ! -d "$gitdir/$p" ] ; then
echo "$gitdir/$p does not exist."
echo "Please clone project $p"
exit 1
fi
cd $gitdir/$p
#echo "rm -rf build"
#rm -rf build
echo "python setup.py install --home=$destdir"
python setup.py install --home=$destdir
f_copyconf $destdir
if [ $? -ne 0 ]; then
echo -e "\e[41mERROR: Something went wrong in $p\e[49m"
sleep 2
else
echo "done."
fi
done
for p in $makeprojects; do
echo $p
if [ ! -d "$gitdir/$p" ] ; then
echo "$gitdir/$p does not exist."
echo "Please clone project $p"
exit 1
fi
cd $gitdir/$p
echo "make all "
make all
if [ $? -ne 0 ]; then
echo -e "\e[41mERROR: Something went wrong in $p\e[49m"
sleep 2
else
echo "done."
fi
done
p="autopyfactory"
echo $p
if [ ! -d "$gitdir/$p" ] ; then
echo "$gitdir/$p does not exist."
echo "Please clone project $p"
exit 1
fi
cd $gitdir/$p
echo "python setup.py install --home=$destdir"
python setup.py install --home=$destdir
if [ $? -ne 0 ]; then
echo -e "\e[41mERROR: Something went wrong in $p\e[49m"
sleep 2
else
echo "done."
fi
credroot=~/var/credible/ssca/defaultca/intermediate/
srvroot=~/vc3-services/etc/certs
~/bin/credible -c ~/git/credible/etc/credible.conf hostcert localhost
~/bin/credible -c ~/git/credible/etc/credible.conf certchain
~/bin/credible -c ~/git/credible/etc/credible.conf usercert VC3Admin
mkdir -p $srvroot/private
cp $credroot/certs/localhost.cert.pem $credroot/certs/ca-chain.cert.pem $credroot/certs/VC3Admin.cert.pem $srvroot/
cp $credroot/private/localhost.keynopw.pem $credroot/private/VC3Admin.keynopw.pem $srvroot/private/
echo "Done."
echo ""
echo "To run infoservice..."
echo "vc3-infoservice -d --conf ~/git/vc3-info-service/etc/vc3-infoservice.conf "
echo ""
echo "To run master..."
echo "vc3-master --conf ~/git/vc3-master/etc/vc3-master.conf -d "
echo ""
echo "To run factory..."
echo "autopyfactory --conf ~/git/vc3-factory-plugins/etc/autopyfactory-vc3config.conf --debug --sleep=30 --log=~/var/autopyfactory.log"
echo ""
echo "To create a doc..."
echo "vc3-info-client -d --conf ~/git/vc3-info-service/etc/vc3-infoclient.conf --add ~/git/vc3-info-service/test/account.json"
echo ""
echo "To retrieve a doc..."
echo "vc3-info-client -d --conf ~/git/vc3-info-service/etc/vc3-infoclient.conf --getkey=user "
echo ""
echo "To see client commands..."
echo "vc3-client --conf ~/git/vc3-client/etc/vc3-client.conf --help "