source: src/mapservice/codegen/code_generator@ 02b893b

debian/bullseye
Last change on this file since 02b893b was ce301d3, checked in by Joachim Langenbach <joachim.langenbach@…>, 7 years ago
  • Added the celery beat start to the celery_worker script for development purposes
  • The periodic tasks are now registered in CeleryWorker.py, because the after_configure.connect method is currently not reliable
  • Fixed log_generate_tile_little_zoom task
  • Changed the crontab to execute the task once a month, due to the possible amount of slices
  • Property mode set to 100755
File size: 1.9 KB
Line 
1#!/bin/bash
2
3DIR=`dirname "$0"`
4SRC_GEN="${DIR}/../src-gen"
5TARGET="${SRC_GEN}/openapi_server/"
6CELERY_WORKER_SCRIPT="${SRC_GEN}/celery_worker"
7
8echo "Cleaning directory"
9rm -R "${SRC_GEN}"
10
11echo "Preparing symlinks"
12mkdir -p "${TARGET}"
13cd "${TARGET}"
14#if [ ! -L server_impl ]; then
15# ln -s ../../src/server_impl/
16#fi
17mkdir -p server_impl
18cp -a ../../src/server_impl/* server_impl/
19#mv server_impl/CeleryWorker.py ./
20
21#echo "Copying static files"
22#cp -a ../../src/templates ./
23#cp -a ../../src/static ./
24mkdir -p static/css/
25mkdir -p static/js/
26mkdir -p static/resources/
27cp -a ../../../common/css/* static/css/
28cp -a ../../../common/js/* static/js/
29cp -a ../../../common/resources/* static/resources/
30cp -a ../../../common/icon/* static/resources/
31mkdir -p templates
32cp -a ../../templates/* templates/
33ln -s ../templates server_impl/templates
34
35echo "Generating backend and client API code"
36cd ../../
37# backend
38codegen/openapi-generator-cli generate -i openapi.yaml -g python-flask -t codegen/templates/ -o src-gen
39# client
40#codegen/openapi-generator-cli generate -i openapi.yaml -g javascript -o src-gen/openapi_server/static/
41#rm -R src-gen/openapi_server/static/.openapi*
42
43
44echo "#!/bin/bash" > "${CELERY_WORKER_SCRIPT}"
45echo 'export FLASK_ENV="development"' >> "${CELERY_WORKER_SCRIPT}"
46echo "celery -A openapi_server.server_impl.CeleryWorker:celery worker -l info -E -B" >> "${CELERY_WORKER_SCRIPT}"
47chmod +x "${CELERY_WORKER_SCRIPT}"
48
49cd src-gen/
50tox > /tmp/openapi_tox.log
51echo "###########################"
52echo "#"
53echo "# Do not forget to start the celery worker with"
54echo "# 1. start RabbitMQ broker with"
55echo "# sudo service rabbitmq-server start"
56echo "# 2. start result backend"
57echo "# sudo service memcached start"
58echo "# 3. start celery worker with"
59echo "# cd ${SRC_GEN} && ${CELERY_WORKER_SCRIPT}"
60echo "#"
61echo "###########################"
62export FLASK_ENV="development"
63python3 -m openapi_server
Note: See TracBrowser for help on using the repository browser.