Skip to content
Snippets Groups Projects
Commit 260819d8 authored by Dylan Aïssi's avatar Dylan Aïssi
Browse files

scan-licenses: create a merge request updating the copyright file on default branch only


This is especially useful during a rebase where the copyright
tooling is updated and the copyrght file needs to be refreshed.
Some packages don't have any update in the next Debian release,
but the pipeline fails only because we have to manually refresh
the copyright file, so let's it create a MR to save us time.

Signed-off-by: default avatarDylan Aïssi <dylan.aissi@collabora.com>
parent 561f4e5c
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !339. Comments created here will be created in the context of that merge request.
......@@ -571,6 +571,31 @@ scan-licenses:
- dpkg-source --after-build .
- |
case $BRANCH in
$CI_DEFAULT_BRANCH)
if ! diff debian/apertis/copyright.new debian/apertis/copyright
then
echo "Copyright report needs to be updated, creating a MR"
NEW_BRANCH=proposed-copyright-updates/$CI_COMMIT_SHORT_SHA
git checkout -b $NEW_BRANCH
mv debian/apertis/copyright.new debian/apertis/copyright
git add -f debian/apertis/copyright
git commit -s -m 'Refresh the automatically detected licensing information' debian/apertis/copyright
dch -i -m 'Refresh the automatically detected licensing information' -D apertis --force-distribution
git add -f debian/changelog
NEW_VERSION=$(dpkg-parsechangelog -SVersion)
git commit -s -m "Release $PACKAGE version $NEW_VERSION"
git push -o merge_request.create \
-o merge_request.remove_source_branch \
-o merge_request.target=$CI_DEFAULT_BRANCH \
-o merge_request.target_project=$CI_PROJECT_PATH \
-o merge_request.title='Refresh the automatically detected licensing information' \
${CI_AUTH_PROJECT_URL} HEAD:${NEW_BRANCH}
exit 1
else
echo "Copyright report is up to date"
fi
rm debian/apertis/copyright.new
;;
$OSNAME/*)
if ! diff debian/apertis/copyright.new debian/apertis/copyright
then
......
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