File tree Expand file tree Collapse file tree 20 files changed +98
-58
lines changed Expand file tree Collapse file tree 20 files changed +98
-58
lines changed Original file line number Diff line number Diff line change 1111PROJECT_ROOT=` python${PY_VERSION} -c ' import os; import freenit; print(os.path.dirname(os.path.abspath(freenit.__file__)))' `
1212
1313
14- mkdir ${NAME}
15- touch ${NAME} /__init__.py
1614echo ' freenit' > requirements.txt
1715cp -r ${PROJECT_ROOT} /project/* .
18- mv api ${NAME}
19- mv models ${NAME}
20- mv schemas ${NAME}
16+ mv project ${NAME}
2117echo " app_name=\" ${NAME} \" # noqa: E225" > name.py
2218echo " ipdb" > requirements_dev.txt
19+ echo " DEVEL_MODE = YES" > vars.mk
20+ cat > Makefile << EOF
21+ .include <name.py>
22+
23+ SERVICE != echo \$ {app_name}back
24+ REGGAE_PATH := /usr/local/share/reggae
25+ SYSPKG := YES
26+
27+ shell: up
28+ @sudo cbsd jexec user=devel jname=\$ {SERVICE} /usr/src/bin/shell.sh
29+
30+ init: up
31+ @sudo cbsd jexec jname=\$ {SERVICE} env OFFLINE=\$ {offline} SYSPKG=\$ {SYSPKG} /usr/src/bin/init.sh
32+
33+ do_devel:
34+ @sudo cbsd jexec jname=\$ {SERVICE} env OFFLINE=\$ {offline} SYSPKG=\$ {SYSPKG} /usr/src/bin/devel.sh
35+
36+ .include <\$ {REGGAE_PATH}/mk/service.mk>
37+ EOF
Original file line number Diff line number Diff line change 1+ .provisioned
2+ ansible /group_vars /all
3+ ansible /inventory /inventory
4+ ansible /roles /*
5+ ansible /site.yml
6+ ! ansible /roles /.keep
7+ build /
8+ cbsd.conf
9+ site.retry
10+ project.mk
11+ vars.mk
Original file line number Diff line number Diff line change @@ -6,4 +6,3 @@ BIN_DIR=`dirname $0`
66setup
77
88flask collect --verbose
9- rm -rf pyser/static
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3-
3+ export LC_ALL=C.UTF-8
4+ export LANG=C.UTF-8
45export BIN_DIR=` dirname $0 `
56export PROJECT_ROOT=" ${BIN_DIR} /.."
67. " ${PROJECT_ROOT} /name.py"
78export VIRTUALENV=${VIRTUALENV:= " ${app_name} back" }
89export FLASK_ENV=${FLASK_ENV:= " production" }
910export PY_VERSION=${PY_VERSION:= " 3.7" }
11+ export SYSPKG=${SYSPKG:= " no" }
1012
1113
1214setup () {
13- update=${1}
14- if [ ! -d ${HOME} /.virtualenvs/${VIRTUALENV} ]; then
15- python${PY_VERSION} -m venv " ${HOME} /.virtualenvs/${VIRTUALENV} "
16- fi
17- . ${HOME} /.virtualenvs/${VIRTUALENV} /bin/activate
15+ cd " ${PROJECT_ROOT} "
16+ if [ " ${SYSPKG} " = " no" ]; then
17+ update=${1}
18+ if [ ! -d ${HOME} /.virtualenvs/${VIRTUALENV} ]; then
19+ python${PY_VERSION} -m venv " ${HOME} /.virtualenvs/${VIRTUALENV} "
20+ fi
21+ . ${HOME} /.virtualenvs/${VIRTUALENV} /bin/activate
1822
19- cd ${PROJECT_ROOT}
20- if [ " ${update} " != " no" ]; then
21- pip install -U pip
22- pip install -U wheel
23- pip install -U -r requirements.txt
24- fi
25- if [ -e " ${BIN_DIR} /../migrations/main/001_initial.py" ]; then
26- flask migration run
23+ cd ${PROJECT_ROOT}
24+ if [ " ${update} " != " no" ]; then
25+ pip install -U pip
26+ pip install -U wheel
27+ pip install -U -r requirements.txt
28+ fi
2729 fi
2830}
Original file line number Diff line number Diff line change 22
33
44BIN_DIR=` dirname $0 `
5+ PROJECT_ROOT=" ${BIN_DIR} /.."
56export FLASK_PORT=${FLASK_PORT:= 5000}
67export FLASK_ENV=" development"
8+ API_ROOT=" http://` hostname` :${FLASK_PORT} /doc/swaggerui"
79export OFFLINE=${OFFLINE:= no}
10+ export SYSPKG=${SYSPKG:= " no" }
811
912
1013. ${BIN_DIR} /common.sh
1114setup no
1215
1316
14- if [ " ${OFFLINE} " != " yes" ]; then
15- pip install -U -r requirements_dev.txt
17+ cd " ${PROJECT_ROOT} "
18+ if [ " ${SYSPKG} " = " no" ]; then
19+ if [ " ${OFFLINE} " != " yes" ]; then
20+ pip install -U -r requirements_dev.txt
21+ fi
1622fi
1723
1824
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,10 +10,6 @@ if [ "${OFFLINE}" = "yes" ]; then
1010else
1111 setup
1212fi
13-
14-
15- if [ ! -e " ${BIN_DIR} /../migrations/main/001_initial.py" ]; then
16- flask migration create initial
17- flask migration run
18- fi
13+ flask migration run
1914flask admin create
15+ flask gallery create
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+
4+ BIN_DIR=` dirname $0 `
5+ PROJECT_ROOT=" ${BIN_DIR} /.."
6+ PROCESSES=4
7+ WSGI_MODULE=wsgi
8+ PORT=${PORT:= 9000}
9+ export FLASK_ENV=" production"
10+
11+ . ${BIN_DIR} /common.sh
12+ setup
13+ pip install -U uwsgi
14+
15+
16+ cd ${PROJECT_ROOT}
17+ exec uwsgi \
18+ --wsgi-file ${WSGI_MODULE} .py \
19+ --master \
20+ --processes ${PROCESSES} \
21+ --uwsgi-socket :${PORT} \
22+ --vacuum
Original file line number Diff line number Diff line change 1- from importlib import import_module
1+ from freenit import create_app
22
33from config import configs
4- from name import app_name
54
6- application = import_module (f'{ app_name } ' )
75config = configs ['development' ]
8- app = application . create_app (config )
6+ app = create_app (config )
File renamed without changes.
You can’t perform that action at this time.
0 commit comments