Commit 9b55e0fa authored by Sjoerd Simons's avatar Sjoerd Simons
Browse files

WIP: helper to adopt from git development to a source package

parent 7ba46d18
image: registry.gitlab.apertis.org/infrastructure/apertis-docker-images/v2022dev2-package-source-builder
variables:
NAME: ${GITLAB_USER_NAME}
EMAIL: ${GITLAB_USER_EMAIL}
GIT_AUTHOR_NAME: ${GITLAB_USER_NAME}
GIT_COMMITTER_NAME: ${GITLAB_USER_NAME}
PACKAGE_BRANCH: "Please configure a package branch variable"
PACKAGE_BASELINE: "Please configure a shared baseline tag version"
QUIT_TOPIC: "Please configure a quilt topic"
stages:
- triggers
- build
rebase patchset on debian source:
variables:
GIT_STRATEGY: clone
stage: build
tags:
- lightweight
script:
- git remote -v
- git branch -v
- git fetch origin ${PACKAGE_BRANCH}
- git checkout ${CI_COMMIT_BRANCH}
- git checkout ${PACKAGE_BRANCH}
- test -d debian/patches/${QUILT_TOPIC} && git rm -rf debian/patches/${QUILT_TOPIC}
- cp debian/patches/series /tmp/series && cat /tmp/series | grep -v "^${QUILT_TOPIC}/" > debian/patches/series
- git add -f debian/patches/series
- git commit --allow-empty -m "Update patch series"
- gbp pq import
- export PQ_BRANCH=$(git branch --show-current)
- git rebase --onto ${PQ_BRANCH} ${PACKAGE_BASELINE} ${CI_COMMIT_BRANCH}
- 'FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter "cat && echo Gbp-Pq: Topic ${QUILT_TOPIC}" ${PQ_BRANCH}..HEAD'
- git checkout ${PQ_BRANCH}
- git merge ${CI_COMMIT_BRANCH}
- gbp pq export
- git add -f debian/patches/${QUILT_TOPIC}
- cat debian/patches/series | grep '^${QUILT_TOPIC}/' > /tmp/quilt-patches
# Reset everything else
- git checkout .
- git status
- cat /tmp/quilt-patches >> debian/patches/series
- git add -f debian/patches/series
- 'git commit --amend -m "Update patchset to ${CI_COMMIT_SHORT_SHA}"'
- gbp dch -R --spawn-editor=never --commit
- git push -o ci.skip https://${BOT_USERNAME}:${BOT_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git ${PACKAGE_BRANCH}
rules:
- if: '$CI_COMMIT_BRANCH == "wip/sjoerd/test123"'
trigger package build:
stage: triggers
trigger:
strategy: depend
project: $CI_PROJECT_PATH
branch: $PACKAGE_BRANCH
rules:
- if: '$CI_COMMIT_BRANCH == "wip/sjoerd/test123"'
build source package:
stage: build
script:
- git fetch origin pristine-lfs
- ci-buildpackage -S --git-prebuild='debian/rules debian/control || true'
rules:
- if: '$CI_COMMIT_BRANCH == $PACKAGE_BRANCH'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment