Skip to content
Snippets Groups Projects
Commit c51c7e53 authored by Ugo Albanese's avatar Ugo Albanese
Browse files

Merged in drop-scxml-NRRPLT-8145 (pull request #27)

[NRRPLT-8145] Drop SCXML

Approved-by: Stefano Nardo
Approved-by: Viktor Vorobev
parent e25efb6e
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ REPOSITORY=experiments ...@@ -46,7 +46,7 @@ REPOSITORY=experiments
|| CO_BRANCH="${TOPIC_BRANCH}" || CO_BRANCH="${TOPIC_BRANCH}"
bash ./.ci/bitbucket_api_get.bash "${REPOSITORY}" bibi_configuration.xsd "${CO_BRANCH}" bash ./.ci/bitbucket_api_get.bash "${REPOSITORY}" bibi_configuration.xsd "${CO_BRANCH}"
bash ./.ci/bitbucket_api_get.bash "${REPOSITORY}" ExDConfFile.xsd "${CO_BRANCH}" bash ./.ci/bitbucket_api_get.bash "${REPOSITORY}" ExDConfFile.xsd "${CO_BRANCH}"
python .ci/ci_download_directory.py https://bitbucket.org/hbpneurorobotics/experiments/src/${CO_BRANCH}/hbp-scxml/
REPOSITORY=models REPOSITORY=models
[ -z "$(git ls-remote --heads https://bitbucket.org/hbpneurorobotics/${REPOSITORY}.git ${TOPIC_BRANCH})" ] \ [ -z "$(git ls-remote --heads https://bitbucket.org/hbpneurorobotics/${REPOSITORY}.git ${TOPIC_BRANCH})" ] \
&& CO_BRANCH="${DEFAULT_BRANCH}" \ && CO_BRANCH="${DEFAULT_BRANCH}" \
...@@ -63,7 +63,7 @@ export pyxb_version=`grep "pyxb" ${HBP}/${EXDBACKEND_DIR}/hbp_nrp_commons/requir ...@@ -63,7 +63,7 @@ export pyxb_version=`grep "pyxb" ${HBP}/${EXDBACKEND_DIR}/hbp_nrp_commons/requir
&& pyxbgen -u ExDConfFile.xsd -m exp_conf_api_gen \ && pyxbgen -u ExDConfFile.xsd -m exp_conf_api_gen \
&& pyxbgen -u robot_model_configuration.xsd -m robot_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 && pyxbgen -u environment_model_configuration.xsd -m environment_conf_api_gen
mv bibi_api_gen.py exp_conf_api_gen.py _sc.py robot_conf_api_gen.py environment_conf_api_gen.py ${HBP}/${EXDBACKEND_DIR}/hbp_nrp_commons/hbp_nrp_commons/generated 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 touch ${HBP}/${EXDBACKEND_DIR}/hbp_nrp_commons/hbp_nrp_commons/generated/__init__.py
deactivate deactivate
......
#!/usr/bin/env python
"""
CI script for checkout of a single directory from a specified repo ref HEAD
This script uses BitBucket API, so the repo is supposed to be in BitBucket cloud
"""
import os
import sys
from urllib.parse import urlparse
import urllib.request
try:
import json
except ImportError:
import simplejson as json
def open_directory(api_path_, user_name_, repository_, slug_, path_):
"""
open_directory opens directory and recursevely downloads its content throug BitBucket API
:param api_path_: path to BitBucket API core (https://api.bitbucket.org/2.0/repositories)
:param user_name_: BitBucket username (hbpneurorobotics)
:param repository_: the desired repo to download (i.e. CLE)
:param slug_: the desired ref (branch/tag/hash)
:param path_: the path to the directory inside repository
"""
directory_url = "%s/%s/%s/src/%s/%s" % (api_path_, user_name_, repository_, slug_, path_)
print(directory_url)
json_data_url_handle = urllib.request.urlopen(directory_url)
if json_data_url_handle.code != 200:
print("url %s not found" % directory_url)
sys.exit()
json_directory = json.loads(json_data_url_handle.read())
page_exists = True
while page_exists:
for item in json_directory["values"]:
print(json.dumps(item, indent=4))
if item["type"] == "commit_directory":
open_directory(api_path_, user_name_, repository_, slug_, item["path"])
for file_ in json_directory["values"]:
if file_["type"] == "commit_file" and file_["mimetype"] == "text/xml":
try:
os.makedirs(os.path.dirname(file_["path"]))
except OSError:
pass
print("downloading %s" % file_["path"])
print(file_['links']['self']['href'])
urllib.request.urlretrieve(file_['links']['self']['href'], file_['path'])
if "next" in json_directory:
json_data_url_handle = urllib.request.urlopen(json_directory['next'])
if json_data_url_handle.code != 200:
print("url %s not found" % directory_url)
sys.exit()
json_directory = json.loads(json_data_url_handle.read())
else:
page_exists = False
if (
len(sys.argv) != 2 or
sys.argv[1].find("https://bitbucket.org/") != 0 or
sys.argv[1].find("/src/") == -1
):
print("usage: python download_directory.py.py https://bitbucket.org/ws/repo/src/branch/demo/")
sys.exit()
API_PATH = "https://api.bitbucket.org/2.0/repositories"
_, username, repo, _, slug, path_section = urlparse(sys.argv[1]).path.split("/", 5)
print(username, repo, slug, path_section)
open_directory(API_PATH, username, repo, slug, path_section)
...@@ -45,7 +45,7 @@ pipelines: ...@@ -45,7 +45,7 @@ pipelines:
- make devinstall # Otherwise it can't find pyxbgen - make devinstall # Otherwise it can't find pyxbgen
- export pyxb_version=`grep "pyxb" $HBP/ExDBackend/hbp_nrp_commons/requirements.txt` - export pyxb_version=`grep "pyxb" $HBP/ExDBackend/hbp_nrp_commons/requirements.txt`
- . $VIRTUAL_ENV_PATH/bin/activate && pip install ${pyxb_version} && pyxbgen -u $HBP/Experiments/bibi_configuration.xsd -m bibi_api_gen && pyxbgen -u $HBP/Experiments/ExDConfFile.xsd -m exp_conf_api_gen && pyxbgen -u $HBP/Models/robot_model_configuration.xsd -m robot_conf_api_gen && pyxbgen -u $HBP/Models/environment_model_configuration.xsd -m environment_conf_api_gen - . $VIRTUAL_ENV_PATH/bin/activate && pip install ${pyxb_version} && pyxbgen -u $HBP/Experiments/bibi_configuration.xsd -m bibi_api_gen && pyxbgen -u $HBP/Experiments/ExDConfFile.xsd -m exp_conf_api_gen && pyxbgen -u $HBP/Models/robot_model_configuration.xsd -m robot_conf_api_gen && pyxbgen -u $HBP/Models/environment_model_configuration.xsd -m environment_conf_api_gen
- mv bibi_api_gen.py exp_conf_api_gen.py _sc.py robot_conf_api_gen.py environment_conf_api_gen.py $HBP/ExDBackend/hbp_nrp_commons/hbp_nrp_commons/generated - mv bibi_api_gen.py exp_conf_api_gen.py robot_conf_api_gen.py environment_conf_api_gen.py $HBP/ExDBackend/hbp_nrp_commons/hbp_nrp_commons/generated
- touch $HBP/ExDBackend/hbp_nrp_commons/hbp_nrp_commons/generated/__init__.py - touch $HBP/ExDBackend/hbp_nrp_commons/hbp_nrp_commons/generated/__init__.py
- deactivate - deactivate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment