Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script/setup env #13

Closed
m1kc opened this issue Mar 21, 2022 · 1 comment
Closed

script/setup env #13

m1kc opened this issue Mar 21, 2022 · 1 comment
Labels
feature New feature or request

Comments

@m1kc
Copy link
Owner

m1kc commented Mar 21, 2022

#!/bin/bash
set -e
set -x

script/bootstrap

MAIN_FOLDER=ost_export
if [ ! -e $MAIN_FOLDER/.env ]; then
	cp $MAIN_FOLDER/.env.example $MAIN_FOLDER/.env
	cat $MAIN_FOLDER/.env
	echo "To edit: $ nano $MAIN_FOLDER/.env"
fi
@m1kc m1kc added the feature New feature or request label Mar 21, 2022
@m1kc
Copy link
Owner Author

m1kc commented Mar 31, 2022

#!/bin/bash
set -e
set -x

script/bootstrap

# Populate .env
cp main/.env{.example,}
SECRET=$(mcookie)
sed -i 's|DJANGO_SECRET_KEY=""|DJANGO_SECRET_KEY="'$SECRET'"|g' main/.env

# If sqlite database is present, move it away
if [ -e db.sqlite3 ]; then
        mv db.sqlite3 db.sqlite3~
fi

# Run migrations
poetry run python manage.py migrate

@m1kc m1kc closed this as completed in f9700fd Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant