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

ci managing temporary branch

parent 4756bae4
No related branches found
No related tags found
1 merge request!39Draft: Resolve "Adapt to new sensor constructors in core"
include: include:
- 'https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/wolf/-/raw/$WOLF_CORE_BRANCH/.license_template_ci.yml' - 'https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/wolf/-/raw/$WOLF_CORE_BRANCH/.license_template_ci.yml'
- 'https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/wolf/-/raw/$WOLF_CORE_BRANCH/.yaml_schema_cpp.yml'
- 'https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/wolf/-/raw/$WOLF_CORE_BRANCH/.clang_format.yml'
- 'https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/wolf/-/raw/$WOLF_CORE_BRANCH/.preliminaries.yml'
stages: stages:
- license - license
...@@ -19,127 +22,8 @@ stages: ...@@ -19,127 +22,8 @@ stages:
## PRINT VARIABLES ## PRINT VARIABLES
- *print_variables_definition - *print_variables_definition
## Install ssh-agent if not already installed, it is required by Docker. ## preliminaries script (ssh, apt update and mkdir ci_deps)
## (change apt-get to yum if you use an RPM-based image) - !reference [.preliminaries_script]
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
## Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts
- ssh-keyscan -H -p 2202 gitlab.iri.upc.edu >> $HOME/.ssh/known_hosts
# update apt
- apt-get update
# create 'ci_deps' folder (if not exists)
- mkdir -pv ci_deps
# .license_header_template: &license_header_definition
# - cd $CI_PROJECT_DIR
# # configure git
# - export CI_NEW_BRANCH=ci_processing$RANDOM
# - echo creating new temporary branch... $CI_NEW_BRANCH
# - git config --global user.email "${CI_EMAIL}"
# - git config --global user.name "${CI_USERNAME}"
# - git checkout -b $CI_NEW_BRANCH # temporary branch
# # download license script
# - if [ -f /ci_deps/license_manager.sh ]; then
# - echo "File license_manager.sh already exists."
# - else
# - echo "Downloading file license_manager.sh..."
# - wget -P /ci_deps https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/wolf/-/raw/$WOLF_CORE_BRANCH/wolf_scripts/license_manager.sh
# - fi
# # license headers
# - export CURRENT_YEAR=$( date +'%Y' )
# - echo "current year:" ${CURRENT_YEAR}
# - if [ -f license_header_${CURRENT_YEAR}.txt ]; then
# # add license headers to new files
# - echo "File license_header_${CURRENT_YEAR}.txt already exists. License headers are assumed to be updated. Adding headers to new files..."
# - source /ci_deps/license_manager.sh --add --path=. --config-path=. --exclude=ci_deps
# - else
# # remove license headers of all files
# - source /ci_deps/license_manager.sh --remove --path=. --config-path=. --exclude=ci_deps
# # update license header
# - export PREV_YEAR=$(( CURRENT_YEAR-1 ))
# - echo "Creating new file license_header_${CURRENT_YEAR}.txt..."
# - git mv license_header_${PREV_YEAR}.txt license_header_${CURRENT_YEAR}.txt
# - sed -i "s/${PREV_YEAR}/${PREV_YEAR},${CURRENT_YEAR}/g" license_header_${CURRENT_YEAR}.txt
# # add new license headers to all files
# - source /ci_deps/license_manager.sh --add --path=. --config-path=. --exclude=ci_deps
# - fi
# # push changes (if any)
# - if git commit -a -m "[skip ci] license headers added or modified" ; then
# - git remote set-url --push origin "ssh://git@gitlab.iri.upc.edu:2202/${CI_PROJECT_PATH}.git"
# - git push origin $CI_NEW_BRANCH:${CI_COMMIT_REF_NAME}
# - else
# - echo "No changes, nothing to commit!"
# - fi
.install_yamlschemacpp_template: &install_yamlschemacpp_definition
- cd ${CI_PROJECT_DIR}/ci_deps
- 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
- mkdir -pv build
- cd build
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_TESTS=OFF ..
- make -j$(nproc)
- make install
- ldconfig
.install_wolf_template: &install_wolf_definition
- cd ${CI_PROJECT_DIR}/ci_deps
- if [ -d wolf ]; then
- echo "directory wolf exists"
- cd wolf
- git checkout devel
- git pull
- git checkout $WOLF_CORE_BRANCH
- git pull
- else
- git clone -b $WOLF_CORE_BRANCH ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/wolf.git
- cd wolf
- fi
- mkdir -pv build
- cd build
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_DEMOS=OFF -DBUILD_TESTS=OFF ..
- make -j$(nproc)
- make install
.install_visionutils_template: &install_visionutils_definition
- cd ${CI_PROJECT_DIR}/ci_deps
- if [ -d vision_utils ]; then
- echo "directory vision_utils exists"
- cd vision_utils
- git pull
- else
- git clone https://gitlab.iri.upc.edu/labrobotica/algorithms/vision_utils.git
- cd vision_utils
- fi
- mkdir -pv build
- cd build
- cmake -DCMAKE_BUILD_TYPE=release ..
- make -j$(nproc)
- ctest -j$(nproc) --output-on-failure
- make install
.build_and_test_template: &build_and_test_definition .build_and_test_template: &build_and_test_definition
- cd $CI_PROJECT_DIR - cd $CI_PROJECT_DIR
...@@ -157,9 +41,31 @@ license_headers: ...@@ -157,9 +41,31 @@ license_headers:
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
script: script:
# - *license_header_definition
- !reference [.license_header_script] - !reference [.license_header_script]
############ CLANG FORMAT ############
clang_format:
stage: clang
image: labrobotica/wolf_deps:20.04
before_script:
- *preliminaries_definition
script:
- !reference [.clang_format_script]
############ YAML TEMPLATES GENERATION ############
yaml_templates_generation:
stage: yaml_templates
image: labrobotica/wolf_deps:20.04
cache:
- key: yamlschemacpp-focal
paths:
- ci_deps/yaml-schema-cpp/
before_script:
- *preliminaries_definition
- !reference [.install_yamlschemacpp_script]
script:
- !reference [.generate_yaml_templates_script]
############ UBUNTU 18.04 TESTS ############ ############ UBUNTU 18.04 TESTS ############
build_and_test:bionic: build_and_test:bionic:
image: labrobotica/wolf_vision_deps:18.04 image: labrobotica/wolf_vision_deps:18.04
...@@ -171,14 +77,10 @@ build_and_test:bionic: ...@@ -171,14 +77,10 @@ build_and_test:bionic:
- key: yamlschemacpp-bionic - key: yamlschemacpp-bionic
paths: paths:
- ci_deps/yaml_schema_cpp/ - ci_deps/yaml_schema_cpp/
- key: visionutils-bionic
paths:
- ci_deps/vision_utils/
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *install_yamlschemacpp_definition - !reference [.install_yamlschemacpp_script]
- *install_wolf_definition - !reference [.install_core_script]
- *install_visionutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
- *build_and_test_definition - *build_and_test_definition
...@@ -194,14 +96,10 @@ build_and_test:focal: ...@@ -194,14 +96,10 @@ build_and_test:focal:
- key: yamlschemacpp-focal - key: yamlschemacpp-focal
paths: paths:
- ci_deps/yaml_schema_cpp/ - ci_deps/yaml_schema_cpp/
- key: visionutils-focal
paths:
- ci_deps/vision_utils/
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *install_yamlschemacpp_definition - !reference [.install_yamlschemacpp_script]
- *install_wolf_definition - !reference [.install_core_script]
- *install_visionutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
- *build_and_test_definition - *build_and_test_definition
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