-
Notifications
You must be signed in to change notification settings - Fork 9
/
test.sh
executable file
·63 lines (48 loc) · 980 Bytes
/
test.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
set -e
original=$(pwd)
keepenv=false
RED='\033[0;31m'
YELLOW='\033[1;33m'
CLEAR='\033[0m'
while getopts "k" opt; do
case ${opt} in
k)
echo "Keeping the old env"
keepenv=true
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
tmpfolder=""
appname=sampleapp
appdir=../$appname
unset DJANGO_SETTINGS_MODULE
if [ "$keepenv" = true ]; then
export POETRY_VIRTUALENVS_IN_PROJECT=false
fi
printf "${RED}Removing old app${CLEAR}\n"
if [[ -d "../$appname" ]]
then
set +e
rm -rf ../$appname
dropdb test_sampleapp
dropdb sampleapp
set -e
fi
echo "Creating App"
cookiecutter . --default-config --no-input project_name=$appname -o ../
echo "Running tests"
cd ../$appname/
eval "$(direnv export bash)"
./scripts/create_new_project.sh
npm run build
pre-commit run --all-files
playwright install
poetry run pytest
RV=$?
rm -rf static/
cd $original
exit $RV