-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·45 lines (32 loc) · 1.01 KB
/
setup.sh
File metadata and controls
executable file
·45 lines (32 loc) · 1.01 KB
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
#!/bin/bash
set -e
if [ ! -f .admin ]; then
echo "ERROR: the admin credentials file does not exist."
echo "If you have not run 'prepare.sh' yet, please do so first."
echo "If you have already run 'setup.sh', don't run it again."
exit 1
fi
export $(cat .env | xargs)
export $(cat .admin | xargs)
echo "Setting up the initial Philomena database..."
docker compose pull
docker compose run \
--rm \
-e ADMIN_USERNAME=$ADMIN_USERNAME \
-e ADMIN_EMAIL=$ADMIN_EMAIL \
-e ADMIN_PASSWORD=$ADMIN_PASSWORD \
app setup-production
sleep 3
if [ $S3_HOST = "files" ]; then
echo "Setting up the local S3 storage bucket..."
docker compose --profile local-storage up -d
echo "Waiting for Philomena to come online..."
sleep 15
if ! docker exec philomena-app-1 philomena eval 'Philomena.Release.create_buckets()'; then
echo "ERROR: Could not create S3 buckets. Your S3 configuration may be incorrect."
else
echo "Successfully created the S3 buckets."
fi
docker compose down
fi
rm .admin