Skip to content
Snippets Groups Projects

Resolve "license headers"

Merged Joan Vallvé Navarro requested to merge 27-license-headers into master
1 file
+ 67
21
Compare changes
  • Side-by-side
  • Inline
+ 67
21
stages:
stages:
 
- license
- none
- none
- csm
- csm
- falko
- falko
@@ -9,7 +10,43 @@ stages:
@@ -9,7 +10,43 @@ stages:
# update apt
# update apt
- apt-get update
- apt-get update
.build_install_csm_template: &build_install_csm_definition
.license_header_template: &license_header_definition
 
- cd $CI_PROJECT_DIR
 
 
# configure git
 
- export CI_NEW_BRANCH=ci_processing$CI_COMMIT_SHORT_SHA
 
- 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}
 
- cd scripts
 
- 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..."
 
- ./license_manager.sh --add --path=${CI_PROJECT_DIR} --license-header=license_header_${CURRENT_YEAR}.txt
 
- 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
 
- ./license_manager.sh --update --path=${CI_PROJECT_DIR} --license-header=license_header_${CURRENT_YEAR}.txt
 
- fi
 
- cd ..
 
 
# 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_csm_template: &install_csm_definition
 
- cd $CI_BUILDS_DIR
- 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"
@@ -22,9 +59,9 @@ stages:
@@ -22,9 +59,9 @@ stages:
- cmake .
- cmake .
- make -j2
- make -j2
- make install
- make install
- cd ..
.build_install_falko_template: &build_install_falko_definition
.install_falko_template: &install_falko_definition
 
- cd $CI_BUILDS_DIR
- if [ -d falkolib ]; then
- if [ -d falkolib ]; then
- echo "directory falkolib exists"
- echo "directory falkolib exists"
- cd falkolib
- cd falkolib
@@ -38,9 +75,9 @@ stages:
@@ -38,9 +75,9 @@ stages:
- cmake ..
- cmake ..
- make -j2
- make -j2
- make install
- make install
- cd ../..
.build_and_test_template: &build_and_test_definition
.build_and_test_template: &build_and_test_definition
 
- cd $CI_PROJECT_DIR
- 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 ..
@@ -48,6 +85,15 @@ stages:
@@ -48,6 +85,15 @@ stages:
- ctest
- ctest
- make install
- make install
 
############ LICENSE HEADERS ############
 
license_headers:
 
stage: license
 
image: labrobotica/wolf_deps:16.04
 
except:
 
- master
 
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
@@ -64,10 +110,10 @@ build_and_test_csm:xenial:
@@ -64,10 +110,10 @@ build_and_test_csm:xenial:
cache:
cache:
- key: csm-xenial
- key: csm-xenial
paths:
paths:
- csm/
- ${CI_BUILDS_DIR}/csm/
before_script:
before_script:
- *preliminaries_definition
- *preliminaries_definition
- *build_install_csm_definition
- *install_csm_definition
- ldconfig # update links (shared libraries)
- ldconfig # update links (shared libraries)
script:
script:
- *build_and_test_definition
- *build_and_test_definition
@@ -78,10 +124,10 @@ build_and_test_falko:xenial:
@@ -78,10 +124,10 @@ build_and_test_falko:xenial:
cache:
cache:
- key: falko-xenial
- key: falko-xenial
paths:
paths:
- falkolib/
- ${CI_BUILDS_DIR}/falkolib/
before_script:
before_script:
- *preliminaries_definition
- *preliminaries_definition
- *build_install_falko_definition
- *install_falko_definition
- ldconfig # update links (shared libraries)
- ldconfig # update links (shared libraries)
script:
script:
- *build_and_test_definition
- *build_and_test_definition
@@ -92,14 +138,14 @@ build_and_test_csm_falko:xenial:
@@ -92,14 +138,14 @@ build_and_test_csm_falko:xenial:
cache:
cache:
- key: csm-xenial
- key: csm-xenial
paths:
paths:
- csm/
- ${CI_BUILDS_DIR}/csm/
- key: falko-xenial
- key: falko-xenial
paths:
paths:
- falkolib/
- ${CI_BUILDS_DIR}/falkolib/
before_script:
before_script:
- *preliminaries_definition
- *preliminaries_definition
- *build_install_falko_definition
- *install_falko_definition
- *build_install_csm_definition
- *install_csm_definition
- ldconfig # update links (shared libraries)
- ldconfig # update links (shared libraries)
script:
script:
- *build_and_test_definition
- *build_and_test_definition
@@ -120,10 +166,10 @@ build_and_test_csm:bionic:
@@ -120,10 +166,10 @@ build_and_test_csm:bionic:
cache:
cache:
- key: csm-bionic
- key: csm-bionic
paths:
paths:
- csm/
- ${CI_BUILDS_DIR}/csm/
before_script:
before_script:
- *preliminaries_definition
- *preliminaries_definition
- *build_install_csm_definition
- *install_csm_definition
- ldconfig # update links (shared libraries)
- ldconfig # update links (shared libraries)
script:
script:
- *build_and_test_definition
- *build_and_test_definition
@@ -134,10 +180,10 @@ build_and_test_falko:bionic:
@@ -134,10 +180,10 @@ build_and_test_falko:bionic:
cache:
cache:
- key: falko-bionic
- key: falko-bionic
paths:
paths:
- falkolib/
- ${CI_BUILDS_DIR}/falkolib/
before_script:
before_script:
- *preliminaries_definition
- *preliminaries_definition
- *build_install_falko_definition
- *install_falko_definition
- ldconfig # update links (shared libraries)
- ldconfig # update links (shared libraries)
script:
script:
- *build_and_test_definition
- *build_and_test_definition
@@ -148,14 +194,14 @@ build_and_test_csm_falko:bionic:
@@ -148,14 +194,14 @@ build_and_test_csm_falko:bionic:
cache:
cache:
- key: csm-bionic
- key: csm-bionic
paths:
paths:
- csm/
- ${CI_BUILDS_DIR}/csm/
- key: falko-bionic
- key: falko-bionic
paths:
paths:
- falkolib/
- ${CI_BUILDS_DIR}/falkolib/
before_script:
before_script:
- *preliminaries_definition
- *preliminaries_definition
- *build_install_falko_definition
- *install_falko_definition
- *build_install_csm_definition
- *install_csm_definition
- ldconfig # update links (shared libraries)
- ldconfig # update links (shared libraries)
script:
script:
- *build_and_test_definition
- *build_and_test_definition
 
\ No newline at end of file
Loading