-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* check if Rocket.toml exists and if it contains the required fields * update instructions to run bash * quote the output of pwd to handle pathes withs spaces in them Thanks to EzekTec in #73
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
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
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,12 +1,43 @@ | ||
set -e | ||
mkdir -p backup | ||
|
||
if [ ! -f Rocket.toml ]; then | ||
echo "Rocket.toml not found!" | ||
exit 1 | ||
fi | ||
|
||
database=$(cat Rocket.toml | grep "database_name " | cut -d'=' -f2 | sed 's/ //g' | sed 's/"//g') | ||
namespace=$(cat Rocket.toml | grep "database_namespace" | cut -d'=' -f2 | sed 's/ //g' | sed 's/"//g') | ||
username=$(cat Rocket.toml | grep "database_username" | cut -d'=' -f2 | sed 's/ //g' | sed 's/"//g') | ||
password=$(cat Rocket.toml | grep "database_password" | cut -d'=' -f2 | sed 's/ //g' | sed 's/"//g') | ||
|
||
if [ "$database" == "" ]; then | ||
echo "database_name is missing from Rocket.toml" | ||
exit 1 | ||
fi | ||
|
||
if [ "$namespace" == "" ]; then | ||
echo "database_namespace is missing from Rocket.toml" | ||
exit 1 | ||
fi | ||
|
||
if [ "$username" == "" ]; then | ||
echo "database_username is missing from Rocket.toml" | ||
exit 1 | ||
fi | ||
|
||
if [ "$password" == "" ]; then | ||
echo "database_password is missing from Rocket.toml" | ||
exit 1 | ||
fi | ||
|
||
|
||
echo $namespace | ||
echo $database | ||
#echo $username | ||
#echo $password | ||
|
||
set -x | ||
docker volume create my-surreal-db | ||
docker run --detach --restart always --name surrealdb -p 127.0.0.1:8000:8000 --user root -v$(pwd):/external -v my-surreal-db:/database surrealdb/surrealdb:v2.0.4 start --user $username --pass $password --log trace file://database | ||
docker run --detach --restart always --name surrealdb -p 127.0.0.1:8000:8000 --user root -v"$(pwd)":/external -v my-surreal-db:/database surrealdb/surrealdb:v2.0.4 start --user $username --pass $password --log trace file://database | ||
|