source: src/mapservice/codegen/code_generator@ cdd6542

debian/bullseye
Last change on this file since cdd6542 was adda9f2, checked in by Joachim Langenbach <joachim.langenbach@…>, 7 years ago

code_generator generates the package now with name gnuboat_webserivce and a suitable version

  • Property mode set to 100755
File size: 2.2 KB
RevLine 
[3a89adb]1#!/bin/bash
2
3DIR=`dirname "$0"`
[ec9e811]4SRC_GEN="${DIR}/../src-gen"
[adda9f2]5PACKAGE_NAME="gnuboat_mapservice"
6PACKAGE_VERSION="0.5.99"
7TARGET="${SRC_GEN}/${PACKAGE_NAME}/"
[a88607b]8CELERY_WORKER_SCRIPT="${SRC_GEN}/celery_worker"
[ec9e811]9
10echo "Cleaning directory"
11rm -R "${SRC_GEN}"
[3a89adb]12
13echo "Preparing symlinks"
[13cbe66]14mkdir -p "${TARGET}"
15cd "${TARGET}"
[a88607b]16#if [ ! -L server_impl ]; then
17# ln -s ../../src/server_impl/
18#fi
19mkdir -p server_impl
20cp -a ../../src/server_impl/* server_impl/
21#mv server_impl/CeleryWorker.py ./
[3a89adb]22
[be25db1]23#echo "Copying static files"
24#cp -a ../../src/templates ./
25#cp -a ../../src/static ./
[ec9e811]26mkdir -p static/css/
27mkdir -p static/js/
28mkdir -p static/resources/
29cp -a ../../../common/css/* static/css/
30cp -a ../../../common/js/* static/js/
31cp -a ../../../common/resources/* static/resources/
32cp -a ../../../common/icon/* static/resources/
[bd0cb38]33mkdir -p templates
34cp -a ../../templates/* templates/
[a88607b]35ln -s ../templates server_impl/templates
[3a89adb]36
[be25db1]37echo "Generating backend and client API code"
[3a89adb]38cd ../../
[be25db1]39# backend
[adda9f2]40codegen/openapi-generator-cli generate -i openapi.yaml -g python-flask -t codegen/templates/ --additional-properties=packageVersion=${PACKAGE_VERSION},packageName=${PACKAGE_NAME} -o src-gen
[be25db1]41# client
42#codegen/openapi-generator-cli generate -i openapi.yaml -g javascript -o src-gen/openapi_server/static/
43#rm -R src-gen/openapi_server/static/.openapi*
44
[adda9f2]45########
46#
47# Adding additional files to src-gen directory
48#
49########
[a88607b]50echo "#!/bin/bash" > "${CELERY_WORKER_SCRIPT}"
51echo 'export FLASK_ENV="development"' >> "${CELERY_WORKER_SCRIPT}"
[adda9f2]52echo "celery -A ${PACKAGE_NAME}.server_impl.CeleryWorker:celery worker -l info -E -B" >> "${CELERY_WORKER_SCRIPT}"
[a88607b]53chmod +x "${CELERY_WORKER_SCRIPT}"
54
[adda9f2]55########
56#
57# Run tox tests and start mapservice
58#
59########
[3a89adb]60cd src-gen/
[be25db1]61tox > /tmp/openapi_tox.log
[a88607b]62echo "###########################"
63echo "#"
64echo "# Do not forget to start the celery worker with"
65echo "# 1. start RabbitMQ broker with"
66echo "# sudo service rabbitmq-server start"
[c5ca247]67echo "# 2. start result backend"
68echo "# sudo service memcached start"
69echo "# 3. start celery worker with"
[a88607b]70echo "# cd ${SRC_GEN} && ${CELERY_WORKER_SCRIPT}"
71echo "#"
72echo "###########################"
73export FLASK_ENV="development"
[adda9f2]74python3 -m ${PACKAGE_NAME}
Note: See TracBrowser for help on using the repository browser.