-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23fdb3a
commit fddcdfd
Showing
7 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
export $(grep -v '^#' .env | xargs) | ||
docker exec -i mongodb-praise /usr/bin/mongodump --authenticationDatabase admin --archive -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --db praise_db > database-backup-$(date +"%F-%T").archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
if ! test -f "$1" ; then | ||
echo "Could not find database backup" | ||
echo "Usage: database-restore.sh filename\n" | ||
fi | ||
export $(grep -v '^#' .env | xargs) | ||
docker compose -f ./docker-compose.production.yml down | ||
docker volume rm $(docker volume ls -q) | ||
docker compose -f ./docker-compose.production.yml up mongodb -d --remove-orphans | ||
docker exec -i mongodb-praise sh -c 'mongorestore --authenticationDatabase admin -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --nsInclude=praise_db.* --archive' < $1 | ||
docker compose -f ./docker-compose.production.yml up -d --remove-orphans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
echo | ||
echo "⚠ Running this script will delete ALL Praise data!" | ||
read -p "Are you sure? (N/y) " -n 1 -r | ||
echo | ||
if [[ $REPLY =~ ^[Yy]$ ]] | ||
then | ||
echo | ||
echo "Shutting down containers..." | ||
echo | ||
docker compose -f ./docker-compose.production.yml down | ||
echo | ||
echo "Deleting images..." | ||
echo | ||
docker rmi -f $(docker images -aq) | ||
echo | ||
echo "Deleting volumes..." | ||
echo | ||
docker volume rm $(docker volume ls -q) | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
docker compose -f ./docker-compose.production.yml down | ||
docker compose -f ./docker-compose.production.yml up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
docker build -t praise-setup -f ./packages/setup/Dockerfile . | ||
#!/bin/bash | ||
IMAGE=$( docker images | grep praise-setup ) | ||
if [ -z "$IMAGE" ] | ||
then | ||
echo "Building setup image..." | ||
docker build -t praise-setup -q -f ./packages/setup/Dockerfile . | ||
fi | ||
|
||
docker run -it -v $(pwd):/usr/praise praise-setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#!/bin/bash | ||
docker compose -f ./docker-compose.production.yml up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
docker compose -f ./docker-compose.production.yml pull | ||
docker compose -f ./docker-compose.production.yml down | ||
docker compose -f ./docker-compose.production.yml up -d --remove-orphans |