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

Merge branch '198-wolf-license' of...

Merge branch '198-wolf-license' of ssh://git@gitlab.iri.upc.edu:2202/mobile_robotics/wolf_projects/wolf_lib/wolf.git into 198-wolf-license
parents 5804ca60 cd185436
No related branches found
No related tags found
1 merge request!427Resolve "Wolf license"
Pipeline #7330 canceled
This commit is part of merge request !427. Comments created here will be created in the context of that merge request.
...@@ -20,6 +20,32 @@ ...@@ -20,6 +20,32 @@
# update apt # update apt
- apt-get update - apt-get update
.license_header_template: &license_header_definition
- echo "current year of the headers:" ${LICENSE_HEADER_YEAR}
- export LICENSE_HEADER_YEAR_NEW=$( date +'%Y' )
# UPDATE: check if license headers have to be updated
- if [ ! ${LICENSE_HEADER_YEAR} == ${LICENSE_HEADER_YEAR_NEW} ] ; then
- echo "license headers should be changed!"
- echo "Creating new file wolf_scripts/license_header_${LICENSE_HEADER_YEAR_NEW}.txt..."
- cd wolf_scripts
- cp license_header_${LICENSE_HEADER_YEAR}.txt license_header_${LICENSE_HEADER_YEAR_NEW}.txt
- sed -e "s/${LICENSE_HEADER_YEAR}/'${LICENSE_HEADER_YEAR},${LICENSE_HEADER_YEAR_NEW}'/g" license_header_${LICENSE_HEADER_YEAR_NEW}.txt
- ./license_manager.sh --update --path=. --license-header=license_header_${LICENSE_HEADER_YEAR_NEW}.txt
# ADD: add license headers
- else
- ./license_manager.sh --add --path=. --license-header=license_header_${LICENSE_HEADER_YEAR}.txt
- fi
# push changes (if any)
- git config --global user.email "${CI_EMAIL}"
- git config --global user.name "${CI_USERNAME}"
- if git commit -m "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 HEAD:${CI_COMMIT_REF_NAME}
- else
- echo "No changes, nothing to commit!"
- fi
.build_and_test_template: &build_and_test_definition .build_and_test_template: &build_and_test_definition
- mkdir -pv build - mkdir -pv build
- cd build - cd build
...@@ -42,20 +68,8 @@ license_header: ...@@ -42,20 +68,8 @@ license_header:
image: labrobotica/wolf_deps:16.04 image: labrobotica/wolf_deps:16.04
before_script: before_script:
- *preliminaries_definition - *preliminaries_definition
script:
script: - *license_header_definition
- git config --global user.email "${CI_EMAIL}"
- git config --global user.name "${CI_USERNAME}"
- touch prova.txt
- git add -f prova.txt
- git commit -m "added prova.txt" || echo "No changes, nothing to commit!"
- git remote set-url --push origin "ssh://git@gitlab.iri.upc.edu:2202/${CI_PROJECT_PATH}.git"
# push changes
# always return true so that the build does not fail if there are no changes
- git push origin HEAD:${CI_COMMIT_REF_NAME}
build_and_test:xenial: build_and_test:xenial:
stage: build_and_test stage: build_and_test
......
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