-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
55 lines (45 loc) · 3.84 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This is a sample build configuration for Docker.
# Check our guides at https://confluence.atlassian.com/x/O1toN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: hbpneurorobotics/nrp:dev
pipelines:
branches:
development:
- step:
max-time: 30
name: Build
script:
# Branch dependencies (ex-gerrit topic)
- git archive --remote=ssh://[email protected]/hbpneurorobotics/admin-scripts.git refs/heads/master nrp_branch_topic_checkout | tar xf -
- . ./nrp_branch_topic_checkout admin-scripts user-scripts ExperimentControl CLE BrainSimulation Experiments Models GazeboRosPackages
- cd $BITBUCKET_CLONE_DIR
# This plan depends on GazeboRosPackages being built
- pushd $HBP/GazeboRosPackages && rm -rf build && catkin_make && popd && cd $BITBUCKET_CLONE_DIR
# Configure build has to be placed before make devinstall
- export VIRTUAL_ENV_PATH=$VIRTUAL_ENV
- export NRP_INSTALL_MODE=dev
- export PYTHONPATH=hbp_nrp_commons:hbp_nrp_backend:hbp_nrp_cleserver:hbp_nrp_watchdog:hbp-flask-restful-swagger-master:$VIRTUAL_ENV_PATH/lib/python2.7/site-packages:$PYTHONPATH
# Concatenate all build requirements, ensure newline in between
- (echo; cat $HBP/ExperimentControl/hbp_nrp_excontrol/requirements.txt) >> hbp_nrp_backend/requirements.txt
- (echo; cat $HBP/CLE/hbp_nrp_cle/requirements.txt) >> hbp_nrp_backend/requirements.txt
# Checkout config.ini.sample from user-scripts
- cp $HBP/user-scripts/config_files/CLE/config.ini.sample $HBP/CLE/hbp_nrp_cle/hbp_nrp_cle/config.ini
# Copy bbp-client from user-scripts (before make devinstall)
- cp -af $HBP/user-scripts/config_files/platform_venv/* $VIRTUAL_ENV_PATH/lib/python2.7/site-packages/
# Generate schemas
- make devinstall # Otherwise it can't find pyxbgen
- . $VIRTUAL_ENV_PATH/bin/activate && 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_nrp_commons/hbp_nrp_commons/generated
- touch hbp_nrp_commons/hbp_nrp_commons/generated/__init__.py
- deactivate
# version.txt
- if [ -f "version.txt" ]; then sed -i -f version.txt hbp_nrp_backend/hbp_nrp_backend/version.py hbp_nrp_backend/requirements.txt; sed -i -f version.txt hbp_nrp_commons/hbp_nrp_commons/version.py hbp_nrp_commons/requirements.txt; sed -i -f version.txt hbp_nrp_cleserver/hbp_nrp_cleserver/version.py hbp_nrp_cleserver/requirements.txt; fi
# Run tests
- export IGNORE_LINT='platform_venv|hbp_nrp_commons/hbp_nrp_commons/generated|hbp-flask-restful-swagger-master|migrations|nest'
# Egg-links have to be removed because make devinstall set them up wrongly
- pushd $VIRTUAL_ENV_PATH/lib/python2.7/site-packages && rm -f hbp-nrp-backend.egg-link hbp-nrp-cleserver.egg-link hbp-nrp-watchdog.egg-link hbp-nrp-commons.egg-link hbp-flask-restful-swagger.egg-link && popd
- . $VIRTUAL_ENV_PATH/bin/activate && source /opt/ros/melodic/setup.$CURR_SHELL && echo "PYTHONPATH $PYTHONPATH" && make verify_base || { if [ -f pylint.txt ]; then echo "----------"; echo "PYLINT.TXT"; echo "----------";cat pylint.txt; fi; if [ -f pep8.txt ]; then echo "----------"; echo "PEP8.TXT"; echo "----------";cat pep8.txt; fi; exit 1; }
# Coverage check
- $HBP/admin-scripts/nrp_cobertura_check coverage.xml