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

Upload New File

parent 83747322
No related branches found
No related tags found
3 merge requests!476spdlog version upgrade,!473Rerefactor,!472Merge ProcessorLandmarkExternal
Pipeline #17058 canceled
.license_header_script:
- cd $CI_PROJECT_DIR
# create 'ci_deps' folder (if not exists)
- 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_license_header 2>/dev/null` ]; then
- git branch --delete ci_license_header
- fi
- export CI_NEW_BRANCH_LICENSE=ci_license_header
- echo creating new temporary branch... $CI_NEW_BRANCH_LICENSE
- git checkout -b $CI_NEW_BRANCH_LICENSE
# 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 push origin $CI_NEW_BRANCH_LICENSE:${CI_COMMIT_REF_NAME}
- else
- echo "No changes, nothing to commit!"
- fi
\ No newline at end of file
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