Skip to content
Snippets Groups Projects
Commit e3c28015 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

Upload New File

parent 25d3ed66
No related branches found
No related tags found
3 merge requests!476spdlog version upgrade,!473Rerefactor,!472Merge ProcessorLandmarkExternal
Pipeline #17060 canceled
.install_yamlschemacpp_script:
- cd ${CI_PROJECT_DIR}
# create 'ci_deps' folder (if not exists)
- mkdir -pv ci_deps
- cd ${CI_PROJECT_DIR}/ci_deps
# clone or pull
- if [ -d yaml-schema-cpp ]; then
- echo "directory yaml-schema-cpp exists"
- cd yaml-schema-cpp
- git checkout main
- git pull
- else
- git clone -b main ssh://git@gitlab.iri.upc.edu:2202/labrobotica/algorithms/yaml-schema-cpp.git
- cd yaml-schema-cpp
- fi
# build and install
- mkdir -pv build
- cd build
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_TESTS=OFF ..
- make -j$(nproc)
- make install
- ldconfig
.generate_yaml_templates_script:
- cd ${CI_PROJECT_DIR}
# create ci_deps if not created yet
- mkdir -pv ci_deps
# configure git
- git remote set-url origin "ssh://git@gitlab.iri.upc.edu:2202/${CI_PROJECT_PATH}.git"
- git pull origin ${CI_COMMIT_REF_NAME}
- git config --global user.email "${CI_EMAIL}"
- git config --global user.name "${CI_USERNAME}"
# create temporary branch
- if [ `git rev-parse --verify ci_yamlschemacpp 2>/dev/null` ]; then
- git branch --delete ci_yamlschemacpp
- fi
- export CI_NEW_BRANCH_YAML=ci_yamlschemacpp
- echo creating new temporary branch... $CI_NEW_BRANCH_YAML
- git checkout -b $CI_NEW_BRANCH_YAML
# remove all existing yaml templates
- cd ${CI_PROJECT_DIR}
- rm -rf yaml_templates
# go to schema folder
- cd ${CI_PROJECT_DIR}/schema
# list all schema files
- find . -iname "*.schema" > schemas.txt
# generate yaml template for each schema file in yaml_templates folder
- while read p; do
- echo "Generating template for schema $p"
- folder=${p%/*}
- folder_length=${#folder}
- tmp=${p%.*}
- name=${tmp:$folder_length+1}
- mkdir -p ${CI_PROJECT_DIR}/yaml_templates/$folder
- yaml_template_generator $name "[${CI_PROJECT_DIR}/schema ${CI_PROJECT_DIR}/ci_deps]" ${CI_PROJECT_DIR}/yaml_templates/$folder/$name.yaml
- done <schemas.txt
# remove list of all schema files
- rm schemas.txt
# push changes (if any)
- git add ../yaml_templates
- if git commit -a -m "[skip ci] yaml templates added or modified" ; then
- git push origin $CI_NEW_BRANCH_YAML:${CI_COMMIT_REF_NAME}
- else
- echo "No changes, nothing to commit!"
- fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment