From 5312d9a251ce96dbdf0dacfcba1f0ded6358459b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20V=C3=A1radi?= Date: Wed, 10 Jul 2024 19:44:32 +0200 Subject: [PATCH 1/2] Determine the base version and build kind using the Debian build branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: István Váradi --- admin/linux/debian/drone-build.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/admin/linux/debian/drone-build.sh b/admin/linux/debian/drone-build.sh index 4758fad09957..75ff985591d8 100755 --- a/admin/linux/debian/drone-build.sh +++ b/admin/linux/debian/drone-build.sh @@ -43,8 +43,19 @@ fi set -x cd "${DRONE_WORKSPACE}" +git config --global user.email "drone@noemail.invalid" +git config --global user.name "Drone User" git fetch --tags -read basever revdate kind <<<$(admin/linux/debian/scripts/git2changelog.py /tmp/tmpchangelog stable) + +for distribution in ${UBUNTU_DISTRIBUTIONS} ${DEBIAN_DISTRIBUTIONS}; do + git fetch origin debian/dist/${distribution}/${DRONE_TARGET_BRANCH} + git checkout origin/debian/dist/${distribution}/${DRONE_TARGET_BRANCH} + + git merge ${DRONE_COMMIT} + + read basever revdate kind <<<$(admin/linux/debian/scripts/git2changelog.py /tmp/tmpchangelog stable) + break +done cd "${DRONE_DIR}" @@ -64,8 +75,6 @@ cp -a ${DRONE_WORKSPACE} nextcloud-desktop_${basever}-${revdate} tar cjf nextcloud-desktop_${basever}-${revdate}.orig.tar.bz2 --exclude .git --exclude binary nextcloud-desktop_${basever}-${revdate} cd "${DRONE_WORKSPACE}" -git config --global user.email "drone@noemail.invalid" -git config --global user.name "Drone User" for distribution in ${UBUNTU_DISTRIBUTIONS} ${DEBIAN_DISTRIBUTIONS}; do git checkout -- . From 07f69133e411da02b968f3bcb340f7b94ba91f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20V=C3=A1radi?= Date: Thu, 11 Jul 2024 16:29:48 +0200 Subject: [PATCH 2/2] Use a single OBS package for all Debian distributions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: István Váradi --- admin/linux/debian/drone-build.sh | 35 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/admin/linux/debian/drone-build.sh b/admin/linux/debian/drone-build.sh index 75ff985591d8..36aabc8345e4 100755 --- a/admin/linux/debian/drone-build.sh +++ b/admin/linux/debian/drone-build.sh @@ -22,6 +22,12 @@ else DEBIAN_DISTRIBUTIONS="bullseye bookworm testing" fi +declare -A DIST_TO_OBS=( + ["bullseye"]="Debian_11" + ["bookworm"]="Debian_12" + ["testing"]="Debian_Testing" +) + pull_request=${DRONE_PULL_REQUEST:=master} if test -z "${DRONE_WORKSPACE}"; then @@ -120,29 +126,34 @@ if test "${pull_request}" = "master"; then fi done - for distribution in ${DEBIAN_DISTRIBUTIONS}; do - pkgsuffix=".${distribution}" - pkgvertag="~${distribution}1" - - package="${OBS_PACKAGE}${pkgsuffix}" + if test -n "${DEBIAN_DISTRIBUTIONS}"; then + package="nextcloud-desktop" OBS_SUBDIR="${OBS_PROJECT}/${package}" mkdir -p osc pushd osc - osc co ${OBS_PROJECT} ${package} + osc co "${OBS_PROJECT}" "${package}" + if test "$(ls ${OBS_SUBDIR})"; then osc delete ${OBS_SUBDIR}/* fi - cp ../nextcloud-desktop*.orig.tar.* ${OBS_SUBDIR}/ - cp ../nextcloud-desktop_*[0-9.][0-9]${pkgvertag}.dsc ${OBS_SUBDIR}/ - cp ../nextcloud-desktop_*[0-9.][0-9]${pkgvertag}.debian.tar* ${OBS_SUBDIR}/ - cp ../nextcloud-desktop_*[0-9.][0-9]${pkgvertag}_source.changes ${OBS_SUBDIR}/ + ln ../nextcloud-desktop*.orig.tar.* ${OBS_SUBDIR}/ + + for distribution in ${DEBIAN_DISTRIBUTIONS}; do + pkgsuffix=".${distribution}" + pkgvertag="~${distribution}1" + obs_dist="${DIST_TO_OBS[${distribution}]}" + + ln ../nextcloud-desktop_*[0-9.][0-9]${pkgvertag}.dsc ${OBS_SUBDIR}/nextcloud-desktop-${obs_dist}.dsc + ln ../nextcloud-desktop_*[0-9.][0-9]${pkgvertag}.debian.tar* ${OBS_SUBDIR}/ + done + osc add ${OBS_SUBDIR}/* cd ${OBS_SUBDIR} - osc commit -m "Travis update" + osc commit -m "Drone update" popd - done + fi fi fi