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

Merge branch 'license-headers' into 'devel'

license headers

See merge request !25
parents 547d3b31 4be8d29c
No related branches found
No related tags found
3 merge requests!30Release after RAL,!29After 2nd RAL submission,!25license headers
stages: stages:
- license
- none - none
- csm - csm
- falko - falko
...@@ -27,8 +28,11 @@ stages: ...@@ -27,8 +28,11 @@ stages:
- apt-get update - apt-get update
- ldconfig - ldconfig
.build_install_wolf_template: &build_install_wolf_definition # create 'ci_deps' folder (if not exists)
- cd $CI_BUILDS_DIR - mkdir -pv ci_deps
.install_wolf_template: &install_wolf_definition
- cd ${CI_PROJECT_DIR}/ci_deps
- if [ -d wolf ]; then - if [ -d wolf ]; then
- echo "directory wolf exists" - echo "directory wolf exists"
- cd wolf - cd wolf
...@@ -42,12 +46,46 @@ stages: ...@@ -42,12 +46,46 @@ stages:
- mkdir -pv build - mkdir -pv build
- cd build - cd build
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON .. - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
- make -j$WOLF_N_PROC - make -j$(nproc)
- ctest -j$WOLF_N_PROC - ctest -j$(nproc)
- make install - make install
.build_install_laserscanutils_template: &build_install_laserscanutils_definition .license_header_template: &license_header_definition
- cd $CI_BUILDS_DIR - 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
# 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..."
- ./ci_deps/wolf/wolf_scripts/license_manager.sh --add --path=. --license-header=license_header_${CURRENT_YEAR}.txt --exclude=ci_deps
- else
# update license headers of all files
- 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
- ./ci_deps/wolf/wolf_scripts/license_manager.sh --update --path=. --license-header=license_header_${CURRENT_YEAR}.txt --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_laserscanutils_template: &install_laserscanutils_definition
- cd ${CI_PROJECT_DIR}/ci_deps
- if [ -d laser_scan_utils ]; then - if [ -d laser_scan_utils ]; then
- echo "directory laser_scan_utils exists" - echo "directory laser_scan_utils exists"
- cd laser_scan_utils - cd laser_scan_utils
...@@ -60,11 +98,11 @@ stages: ...@@ -60,11 +98,11 @@ stages:
- cd build - cd build
- rm -rf * - rm -rf *
- cmake -DCMAKE_BUILD_TYPE=release .. - cmake -DCMAKE_BUILD_TYPE=release ..
- make -j$WOLF_N_PROC - make -j$(nproc)
- make install - make install
.build_install_csm_template: &build_install_csm_definition .install_csm_template: &install_csm_definition
- cd $CI_BUILDS_DIR - cd ${CI_PROJECT_DIR}/ci_deps
- apt-get install -y libgsl-dev - apt-get install -y libgsl-dev
- if [ -d csm ]; then - if [ -d csm ]; then
- echo "directory csm exists" - echo "directory csm exists"
...@@ -75,11 +113,11 @@ stages: ...@@ -75,11 +113,11 @@ stages:
- cd csm - cd csm
- fi - fi
- cmake . - cmake .
- make -j$WOLF_N_PROC - make -j$(nproc)
- make install - make install
.build_install_falko_template: &build_install_falko_definition .install_falko_template: &install_falko_definition
- cd $CI_BUILDS_DIR - cd ${CI_PROJECT_DIR}/ci_deps
- if [ -d falkolib ]; then - if [ -d falkolib ]; then
- echo "directory falkolib exists" - echo "directory falkolib exists"
- cd falkolib - cd falkolib
...@@ -91,18 +129,34 @@ stages: ...@@ -91,18 +129,34 @@ stages:
- mkdir -pv build - mkdir -pv build
- cd build - cd build
- cmake .. - cmake ..
- make -j$WOLF_N_PROC - make -j$(nproc)
- make install - 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}/ci_deps
- mkdir -pv build - mkdir -pv build
- cd build - cd build
- cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON .. - cmake -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON ..
- make -j$WOLF_N_PROC - make -j$(nproc)
- ctest - ctest
- make install - make install
############ LICENSE HEADERS ############
license_headers:
stage: license
image: labrobotica/wolf_deps:16.04
cache:
- key: wolf-xenial
paths:
- ci_deps/wolf/
except:
- master
before_script:
- *preliminaries_definition
- *install_wolf_definition
script:
- *license_header_definition
############ UBUNTU 16.04 TESTS ############ ############ UBUNTU 16.04 TESTS ############
build_and_test_none:xenial: build_and_test_none:xenial:
stage: none stage: none
...@@ -110,16 +164,16 @@ build_and_test_none:xenial: ...@@ -110,16 +164,16 @@ build_and_test_none:xenial:
cache: cache:
- key: laserscanutils-xenial - key: laserscanutils-xenial
paths: paths:
- ${CI_BUILDS_DIR}/laser_scan_utils/ - ci_deps/laser_scan_utils/
- key: wolf-xenial - key: wolf-xenial
paths: paths:
- ${CI_BUILDS_DIR}/wolf/ - ci_deps/wolf/
except: except:
- master - master
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *build_install_wolf_definition - *install_wolf_definition
- *build_install_laserscanutils_definition - *install_laserscanutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
- *build_and_test_definition - *build_and_test_definition
...@@ -130,20 +184,20 @@ build_and_test_csm:xenial: ...@@ -130,20 +184,20 @@ build_and_test_csm:xenial:
cache: cache:
- key: wolf-xenial - key: wolf-xenial
paths: paths:
- ${CI_BUILDS_DIR}/wolf/ - ci_deps/wolf/
- key: laserscanutils-xenial - key: laserscanutils-xenial
paths: paths:
- ${CI_BUILDS_DIR}/laser_scan_utils/ - ci_deps/laser_scan_utils/
- key: csm-xenial - key: csm-xenial
paths: paths:
- ${CI_BUILDS_DIR}/csm/ - ci_deps/csm/
except: except:
- master - master
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *build_install_wolf_definition - *install_wolf_definition
- *build_install_csm_definition - *install_csm_definition
- *build_install_laserscanutils_definition - *install_laserscanutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
...@@ -155,20 +209,20 @@ build_and_test_falko:xenial: ...@@ -155,20 +209,20 @@ build_and_test_falko:xenial:
cache: cache:
- key: wolf-xenial - key: wolf-xenial
paths: paths:
- ${CI_BUILDS_DIR}/wolf/ - ci_deps/wolf/
- key: laserscanutils-xenial - key: laserscanutils-xenial
paths: paths:
- ${CI_BUILDS_DIR}/laser_scan_utils/ - ci_deps/laser_scan_utils/
- key: falko-xenial - key: falko-xenial
paths: paths:
- ${CI_BUILDS_DIR}/falkolib/ - ci_deps/falkolib/
except: except:
- master - master
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *build_install_wolf_definition - *install_wolf_definition
- *build_install_falko_definition - *install_falko_definition
- *build_install_laserscanutils_definition - *install_laserscanutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
...@@ -180,24 +234,24 @@ build_and_test_csm_falko:xenial: ...@@ -180,24 +234,24 @@ build_and_test_csm_falko:xenial:
cache: cache:
- key: wolf-xenial - key: wolf-xenial
paths: paths:
- ${CI_BUILDS_DIR}/wolf/ - ci_deps/wolf/
- key: laserscanutils-xenial - key: laserscanutils-xenial
paths: paths:
- ${CI_BUILDS_DIR}/laser_scan_utils/ - ci_deps/laser_scan_utils/
- key: csm-xenial - key: csm-xenial
paths: paths:
- ${CI_BUILDS_DIR}/csm/ - ci_deps/csm/
- key: falko-xenial - key: falko-xenial
paths: paths:
- ${CI_BUILDS_DIR}/falkolib/ - ci_deps/falkolib/
except: except:
- master - master
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *build_install_wolf_definition - *install_wolf_definition
- *build_install_falko_definition - *install_falko_definition
- *build_install_csm_definition - *install_csm_definition
- *build_install_laserscanutils_definition - *install_laserscanutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
...@@ -210,16 +264,16 @@ build_and_test_none:bionic: ...@@ -210,16 +264,16 @@ build_and_test_none:bionic:
cache: cache:
- key: wolf-bionic - key: wolf-bionic
paths: paths:
- ${CI_BUILDS_DIR}/wolf/ - ci_deps/wolf/
- key: laserscanutils-bionic - key: laserscanutils-bionic
paths: paths:
- ${CI_BUILDS_DIR}/laser_scan_utils/ - ci_deps/laser_scan_utils/
except: except:
- master - master
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *build_install_wolf_definition - *install_wolf_definition
- *build_install_laserscanutils_definition - *install_laserscanutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
- *build_and_test_definition - *build_and_test_definition
...@@ -230,20 +284,20 @@ build_and_test_csm:bionic: ...@@ -230,20 +284,20 @@ build_and_test_csm:bionic:
cache: cache:
- key: wolf-bionic - key: wolf-bionic
paths: paths:
- ${CI_BUILDS_DIR}/wolf/ - ci_deps/wolf/
- key: laserscanutils-bionic - key: laserscanutils-bionic
paths: paths:
- ${CI_BUILDS_DIR}/laser_scan_utils/ - ci_deps/laser_scan_utils/
- key: csm-bionic - key: csm-bionic
paths: paths:
- ${CI_BUILDS_DIR}/csm/ - ci_deps/csm/
except: except:
- master - master
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *build_install_wolf_definition - *install_wolf_definition
- *build_install_csm_definition - *install_csm_definition
- *build_install_laserscanutils_definition - *install_laserscanutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
...@@ -255,20 +309,20 @@ build_and_test_falko:bionic: ...@@ -255,20 +309,20 @@ build_and_test_falko:bionic:
cache: cache:
- key: wolf-bionic - key: wolf-bionic
paths: paths:
- ${CI_BUILDS_DIR}/wolf/ - ci_deps/wolf/
- key: laserscanutils-bionic - key: laserscanutils-bionic
paths: paths:
- ${CI_BUILDS_DIR}/laser_scan_utils/ - ci_deps/laser_scan_utils/
- key: falko-bionic - key: falko-bionic
paths: paths:
- ${CI_BUILDS_DIR}/falkolib/ - ci_deps/falkolib/
except: except:
- master - master
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *build_install_wolf_definition - *install_wolf_definition
- *build_install_falko_definition - *install_falko_definition
- *build_install_laserscanutils_definition - *install_laserscanutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
...@@ -280,24 +334,24 @@ build_and_test_csm_falko:bionic: ...@@ -280,24 +334,24 @@ build_and_test_csm_falko:bionic:
cache: cache:
- key: wolf-bionic - key: wolf-bionic
paths: paths:
- ${CI_BUILDS_DIR}/wolf/ - ci_deps/wolf/
- key: laserscanutils-bionic - key: laserscanutils-bionic
paths: paths:
- ${CI_BUILDS_DIR}/laser_scan_utils/ - ci_deps/laser_scan_utils/
- key: csm-bionic - key: csm-bionic
paths: paths:
- ${CI_BUILDS_DIR}/csm/ - ci_deps/csm/
- key: falko-bionic - key: falko-bionic
paths: paths:
- ${CI_BUILDS_DIR}/falkolib/ - ci_deps/falkolib/
except: except:
- master - master
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
- *build_install_wolf_definition - *install_wolf_definition
- *build_install_falko_definition - *install_falko_definition
- *build_install_csm_definition - *install_csm_definition
- *build_install_laserscanutils_definition - *install_laserscanutils_definition
- ldconfig # update links (shared libraries) - ldconfig # update links (shared libraries)
script: script:
......
// Copyright (C) 2020,2021 Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
// Authors: Joan Solà Ortega (jsola@iri.upc.edu)
// All rights reserved.
//
// This file is part of WOLF
// WOLF is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
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