-
Notifications
You must be signed in to change notification settings - Fork 226
/
first_run.dev.sh
executable file
·33 lines (26 loc) · 1.07 KB
/
first_run.dev.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
#!/bin/bash
#Clear old db files
echo 'Removing old files'
rm -rf mysql_data
rm -rf postgres_data
rm -rf mongo_data
echo 'Deleting Existing Migrations'
find ./esim-cloud-backend -name "migrations" -type d -prune -exec rm -rf '{}' +
#For Slow Systems / Systems with less memory
export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=120
#Build Containers
echo 'Building Containers, might take a while'
docker-compose -f docker-compose.dev.yml --env-file .env build
# MYSQL does not play well with other containers if not allowed to finish config beforehand
echo 'Waiting for DB to finish its thing....'
docker-compose -f docker-compose.dev.yml --no-recreate --env-file .env -d up db
echo 'Waiting for 1 Minute'
sleep 1m
echo 'Applying Database Migrations'
docker-compose -f docker-compose.dev.yml --env-file .env run --rm django /bin/sh migrations.sh
echo 'Copying Pre-Defined eSim-Gallery'
if [ ! -d esim-cloud-backend/file_storage ]; then
mkdir esim-cloud-backend/file_storage
fi
cp esim-cloud-backend/workflowAPI/fixtures/circuit_images_esim esim-cloud-backend/file_storage -r