-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackages.sh
57 lines (47 loc) · 1.59 KB
/
packages.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
#!/bin/bash
set -e
#
# Bootstrapping a new WebPlatform salt master (step 2)
#
# *The packages we share accross the infrastructure*
#
# This script is meant to be run only once per salt master
# so that every code dependencies are cloned and installed
# in a constant fashion.
#
# A salt master should have NO hardcoded files and configuration
# but simply be booted bootstrapped by the three following components.
#
# 1. Cloning Salt configurations (so we can salt the salt master)
# 2. The packages we share accross the infrastructure
# 3. Cloning every webplatform.org software dependencies.
if [ ! -f "/srv/ci-dreamobjects.sh" ]; then
echo "Cannot find ci-dreamobjects, did you run state.highstate yet?"
exit 1
fi
echo "About to download all the packages in DreamObject wpd-packages bucket"
cd /srv
. ci-dreamobjects.sh
mkdir -p code/packages
cd code/packages
swift list wpd-packages > filesList
while read FILE; do swift download wpd-packages $FILE --skip-identical; done < filesList
rm filesList
chown -R nobody:deployment /srv/code/packages
mkdir -p /srv/code/auth-server
cp -r /srv/code/packages/auth-server/dists /srv/code/auth-server/dists
chown -R nobody:deployment /srv/code/auth-server
mkdir -p /srv/code/notes-server
cp -r /srv/code/packages/notes-server/dists /srv/code/notes-server/dists
chown -R nobody:deployment /srv/code/notes-server
echo ""
echo "Extracting our SSL certificates, you will be prompted a passphrase"
gpg certificates.tar.gz.gpg
tar xfz certificates.tar.gz
echo ""
echo "Step 2 of 3 completed!"
echo ""
echo "Next step:"
echo " bash /srv/ops/salt-master/code.sh"
echo ""
exit 0