Skip to content
Snippets Groups Projects
Commit 0405a146 authored by Viktor Vorobev's avatar Viktor Vorobev Committed by Ugo Albanese
Browse files

Merged in NRRPLT-8191-makefile-schema-generation (pull request #31)

[NRRPLT-8191] Generate schema parsers via Makefile.

* [NRRPLT-8241] Test new make shemas targets

Approved-by: Ugo Albanese
Approved-by: Krzysztof Lebioda
parent d9be4e15
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
REPOSITORY=$1
FILENAME_XSD=$2
TOPIC_BRANCH=$3
wget https://api.bitbucket.org/2.0/repositories/hbpneurorobotics/${REPOSITORY}/src/${TOPIC_BRANCH}/${FILENAME_XSD} -O ${FILENAME_XSD} \
&& echo ${FILENAME_XSD}:${TOPIC_BRANCH}
......@@ -40,42 +40,16 @@ export export PYTHONPATH=$VIRTUAL_ENV_PATH/lib/python${PYTHON_VERSION_MAJOR_MINO
cp ${HBP}/${USER_SCRIPTS_DIR}/config_files/CLE/config.ini.sample ${HBP}/${CLE_DIR}/hbp_nrp_cle/hbp_nrp_cle/config.ini
# Obtain schemas
REPOSITORY=experiments
[ -z "$(git ls-remote --heads https://bitbucket.org/hbpneurorobotics/${REPOSITORY}.git ${TOPIC_BRANCH})" ] \
&& CO_BRANCH="${DEFAULT_BRANCH}" \
|| CO_BRANCH="${TOPIC_BRANCH}"
bash ./.ci/bitbucket_api_get.bash "${REPOSITORY}" bibi_configuration.xsd "${CO_BRANCH}"
bash ./.ci/bitbucket_api_get.bash "${REPOSITORY}" ExDConfFile.xsd "${CO_BRANCH}"
REPOSITORY=models
[ -z "$(git ls-remote --heads https://bitbucket.org/hbpneurorobotics/${REPOSITORY}.git ${TOPIC_BRANCH})" ] \
&& CO_BRANCH="${DEFAULT_BRANCH}" \
|| CO_BRANCH="${TOPIC_BRANCH}"
bash ./.ci/bitbucket_api_get.bash "${REPOSITORY}" robot_model_configuration.xsd "${CO_BRANCH}"
bash ./.ci/bitbucket_api_get.bash "${REPOSITORY}" environment_model_configuration.xsd "${CO_BRANCH}"
# Generate schemas
pushd $VIRTUAL_ENV_PATH/lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages && rm -f hbp-nrp-distributed-nest.egg-link && popd
make devinstall # Otherwise it can't find pyxbgen
export pyxb_version=`grep "pyxb" ${HBP}/${EXDBACKEND_DIR}/hbp_nrp_commons/requirements.txt`
. $VIRTUAL_ENV_PATH/bin/activate \
&& pyxbgen -u bibi_configuration.xsd -m bibi_api_gen \
&& pyxbgen -u ExDConfFile.xsd -m exp_conf_api_gen \
&& pyxbgen -u robot_model_configuration.xsd -m robot_conf_api_gen \
&& pyxbgen -u environment_model_configuration.xsd -m environment_conf_api_gen
mv bibi_api_gen.py exp_conf_api_gen.py robot_conf_api_gen.py environment_conf_api_gen.py ${HBP}/${EXDBACKEND_DIR}/hbp_nrp_commons/hbp_nrp_commons/generated
touch ${HBP}/${EXDBACKEND_DIR}/hbp_nrp_commons/hbp_nrp_commons/generated/__init__.py
deactivate
cd ${HBP}/${EXDBACKEND_DIR}
make schemas-install
cd ${HBP}/${BRAIN_SIMULATION_DIR}
# Run tests
export IGNORE_LINT='platform_venv|migrations|nest|ci_download_directory'
# Egg-links have to be removed because make devinstall set them up wrongly
pushd $VIRTUAL_ENV_PATH/lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages \
&& rm -f hbp-nrp-distributed-nest.egg-link && popd
# verify_base-ci fails on dependencies mismach, but ignores linter errors, that are cought by Jenkins afterwards
. $VIRTUAL_ENV_PATH/bin/activate \
&& source /opt/ros/noetic/setup.bash \
&& source $HBP/GazeboRosPackages/devel/setup.bash \
&& echo "PYTHONPATH $PYTHONPATH" \
&& make verify_base -i
&& make verify_base-ci
\ No newline at end of file
......@@ -12,6 +12,7 @@ build/
ci_dep.txt
pep8.txt
pylint.txt
pycodestyle.txt
test-reports/
coverage.xml
.project
......
......@@ -70,8 +70,6 @@ pipeline {
// 3 - name of topic branch
// 4 - default branch if topic unavailable
// 5 - username for chown
// TODO: fix default branch to master when admin-scripts CI is merged
cloneRepoTopic(env.ADMIN_SCRIPTS_DIR, 'git@bitbucket.org:hbpneurorobotics/admin-scripts.git', env.TOPIC_BRANCH, 'master', '${USER}')
cloneRepoTopic(env.USER_SCRIPTS_DIR, 'git@bitbucket.org:hbpneurorobotics/user-scripts.git', env.TOPIC_BRANCH, env.DEFAULT_BRANCH, '${USER}')
cloneRepoTopic(env.GAZEBO_ROS_DIR, 'git@bitbucket.org:hbpneurorobotics/gazeborospackages.git', env.TOPIC_BRANCH, env.DEFAULT_BRANCH, '${USER}')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment