-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare
executable file
·39 lines (31 loc) · 1006 Bytes
/
prepare
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
#! /usr/bin/bash
# Settings
ENV_NAME="softbutterfly-wagtail-materialize"
APP_NAME="wagtailmaterialize"
# delete old stuff
find . -name migrations -type d -exec rm -r {} \;
rm -r test/media
rm -r test/static
rm -r test/db.sqlite3
conda env remove -n ${ENV_NAME} -y
# Create necesary directories
mkdir test/media
mkdir test/static
# Create the conda environment
conda create --name ${ENV_NAME} --file requirements.test.conda -y
source activate ${ENV_NAME}
# Install pip dependendies
pip install -r requirements.test.pip
# Link module directory to the environment library (only for development)
env_path="$(conda info --env | grep ${ENV_NAME})"
env_path="/${env_path#*/}"
library_path="${env_path}/lib/python3.6/site-packages/"
module_path="$(pwd)/softbutterfly/"
ln -s "${module_path}" "${library_path}"
# Running all the django stuff
source activate ${ENV_NAME}
cd test
python manage.py makemigrations ${APP_NAME}
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver