add requirement for sensitive.py

This commit is contained in:
Daniel Tsvetkov 2020-06-27 20:32:12 +02:00
parent 61743a5050
commit d292cbfb08
3 changed files with 21 additions and 1 deletions

View File

@ -13,6 +13,7 @@ PaaS - creates easily deployable declarative web applications with (moslty) file
## TODO
* [ ] [prod_install] Download sensitive prompt
* [ ] [vm_gen] Auto generate dependency graph for `view_models/_process_order`
* [ ] [auto_dns] Start and test `auto_dns.service`
* [ ] [migrations] ALTER doesn't work with sqlite3

View File

@ -12,6 +12,7 @@ Usage $0 [ bootstrap | model | db_migrate | db_upgrade | db_populate | db_recrea
bootstrap [PROJECT_PATH] Create a new project in PROJECT_PATH
init Install dev env
download_sensitive Download sensitive
model Create or update a model from files in webapp/view_models/*.yaml
db_migrate DB migration
@ -58,10 +59,21 @@ link_dev_oshipka() {
pip install -e ${TWW_PATH}
}
download_sensitive() {
if [ ! -f sensitive.py ]; then
echo "File sensitive.py NOT FOUND"
exit 1;
fi
}
init() {
init_venv
install_reqs
link_dev_oshipka
mkdir -p data
db_upgrade
download_sensitive
db_populate
}
install_cert() {
@ -121,7 +133,11 @@ run_in_prod() {
prod_install() {
shift
sudo apt install nginx dnsutils
if [ ! -f ${OSHIPKA_PATH}/provision/auto_dns/sensitive.py ]; then
echo "File ${OSHIPKA_PATH}/provision/auto_dns/sensitive.py NOT FOUND"
exit 1;
fi
sudo apt install -y nginx dnsutils
source venv/bin/activate
PROJECT_NAME=$(basename `pwd`)
echo "1/6 Generating service and config files..."
@ -269,6 +285,8 @@ command_main() {
;;
init) init "$@"
;;
download_sensitive) download_sensitive "$@"
;;
worker) worker "$@"
;;
web) web "$@"

View File

@ -14,6 +14,7 @@ MAX_UPLOAD_SIZE = "10m"
oshipka_path = os.environ.get('OSHIPKA_PATH')
TEMPLATES_PATH = os.path.join(oshipka_path, "provision", "templates")
TMP_PATH = os.path.join(oshipka_path, "provision", "tmp")
os.makedirs(TMP_PATH, exist_ok=True)
shutil.rmtree(TMP_PATH)
os.makedirs(TMP_PATH, exist_ok=True)
env = Environment(