Skip to content

Commit

Permalink
Use a single OBS package for all Debian distributions
Browse files Browse the repository at this point in the history
Signed-off-by: István Váradi <ivaradi@varadiistvan.hu>
  • Loading branch information
ivaradi committed Jul 11, 2024
1 parent 60c51e8 commit aad1297
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions admin/linux/debian/drone-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -100,6 +106,7 @@ for distribution in ${UBUNTU_DISTRIBUTIONS} ${DEBIAN_DISTRIBUTIONS}; do
debsign -k2265D8767D14AA7B -S
fi
done

cd ..
ls -al

Expand All @@ -120,29 +127,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

0 comments on commit aad1297

Please sign in to comment.