-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart-dev
More file actions
executable file
·57 lines (48 loc) · 1.66 KB
/
start-dev
File metadata and controls
executable file
·57 lines (48 loc) · 1.66 KB
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
#!/bin/bash
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
LIGHTGRAY='\033[0;37m'
DARKGRAY='\033[1;30m'
LIGHTRED='\033[1;31m'
LIGHTGREEN='\033[1;32m'
YELLOW='\033[1;33m'
LIGHTBLUE='\033[1;34m'
LIGHTPURPLE='\033[1;35m'
LIGHTCYAN='\033[1;36m'
WHITE='\033[1;37m'
# Handling for Git Bash for Windows
# (incl. workaround for https://github.com/yarnpkg/yarn/issues/2591)
case "$(uname -s)" in
MINGW*)
export FORCE_COLOR=true
yarn=yarn.cmd
;;
*) yarn=yarn;;
esac
# ----------------------------------
# Set default hosts/ports
DJANGO_PORT=${DJANGO_PORT:-8080}
REACT_HOST=${REACT_HOST:-127.0.0.1}
REACT_PORT=${REACT_PORT:-3000}
DB_HOST=${DB_HOST:-127.0.0.1}
DB_PORT=${DB_PORT:-5432}
DB_NAME=${DB_NAME:-cs_toolkit}
DB_USER=${DB_USER:-cs_toolkit}
DB_PASS=${DB_PASS:-cs_toolkit}
# Update-notifier sometimes causes permissions errors on Windows
NO_UPDATE_NOTIFIER=1
echo -e "${CYAN}Starting Django/React development servers (UI on port ${DJANGO_PORT})...${NOCOLOR}"
# Django
echo -e "${YELLOW}Django is running in debug mode.\nStatic bundles will not be compressed and only local connections will be accepted, among other caveats.${NOCOLOR}"
DB_HOST=${DB_HOST} DB_PORT=${DB_PORT} DB_NAME=${DB_NAME} DB_USER=${DB_USER} DB_PASS=${DB_PASS} eval ${yarn} workspace django-backend run dev ${DJANGO_PORT} &
# React
# cf. https://github.com/facebook/create-react-app/issues/2495
FORCE_COLOR=true DJANGO_PORT=${DJANGO_PORT} HOST=${REACT_HOST} PORT=${REACT_PORT} eval ${yarn} workspace react-frontend run dev-no-browser | cat