You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
chore(CI): make createrepo step resilient to one of build or cmapi build steps fails
This commit is contained in:
committed by
Leonid Fedorov
parent
8bbf373b43
commit
39c8126548
@ -580,7 +580,7 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
|
|||||||
},
|
},
|
||||||
cmapitest:: {
|
cmapitest:: {
|
||||||
name: 'cmapi test',
|
name: 'cmapi test',
|
||||||
depends_on: ['publish cmapi build', 'smoke'],
|
depends_on: ['publish cmapi build'],
|
||||||
image: 'docker:git',
|
image: 'docker:git',
|
||||||
volumes: [pipeline._volumes.docker],
|
volumes: [pipeline._volumes.docker],
|
||||||
environment: {
|
environment: {
|
||||||
@ -728,9 +728,12 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
|
|||||||
name: 'createrepo',
|
name: 'createrepo',
|
||||||
depends_on: ['build', 'cmapi build'],
|
depends_on: ['build', 'cmapi build'],
|
||||||
image: img,
|
image: img,
|
||||||
|
when: {
|
||||||
|
status: ['success', 'failure'],
|
||||||
|
},
|
||||||
volumes: [pipeline._volumes.mdb],
|
volumes: [pipeline._volumes.mdb],
|
||||||
commands: [
|
commands: [
|
||||||
'bash /mdb/' + builddir + '/storage/columnstore/columnstore/build/createrepo.sh --distro ' + platform,
|
'bash /mdb/' + builddir + '/storage/columnstore/columnstore/build/createrepo.sh --distro ' + platform,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -7,19 +7,17 @@ set -eo pipefail
|
|||||||
|
|
||||||
SCRIPT_LOCATION=$(dirname "$0")
|
SCRIPT_LOCATION=$(dirname "$0")
|
||||||
|
|
||||||
|
|
||||||
source "$SCRIPT_LOCATION"/utils.sh
|
source "$SCRIPT_LOCATION"/utils.sh
|
||||||
optparse.define short=D long=distro desc="OS" variable=OS
|
optparse.define short=D long=distro desc="OS" variable=OS
|
||||||
source $(optparse.build)
|
source $(optparse.build)
|
||||||
echo "Arguments received: $@"
|
echo "Arguments received: $@"
|
||||||
|
|
||||||
BUILDDIR="verylongdirnameforverystrangecpackbehavior";
|
BUILDDIR="verylongdirnameforverystrangecpackbehavior"
|
||||||
COLUMNSTORE_RPM_PACKAGES_PATH="/mdb/${BUILDDIR}/*.rpm"
|
COLUMNSTORE_RPM_PACKAGES_PATH="/mdb/${BUILDDIR}/*.rpm"
|
||||||
CMAPI_RPM_PACKAGES_PATH="/mdb/${BUILDDIR}/storage/columnstore/columnstore/cmapi/*.rpm"
|
CMAPI_RPM_PACKAGES_PATH="/mdb/${BUILDDIR}/storage/columnstore/columnstore/cmapi/*.rpm"
|
||||||
|
|
||||||
COLUMNSTORE_DEB_PACKAGES_PATH="/mdb/*.deb"
|
COLUMNSTORE_DEB_PACKAGES_PATH="/mdb/*.deb"
|
||||||
CMAPI_DEB_PACKAGES_PATH="/mdb/${BUILDDIR}/storage/columnstore/columnstore/cmapi/*.deb"
|
CMAPI_DEB_PACKAGES_PATH="/mdb/${BUILDDIR}/storage/columnstore/columnstore/cmapi/*.deb"
|
||||||
RESULT=$(echo "$OS" | sed 's/://g' | sed 's/\//-/g')
|
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
error "Please run script as root"
|
error "Please run script as root"
|
||||||
@ -27,10 +25,12 @@ if [ "$EUID" -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${OS:-}" ]]; then
|
if [[ -z "${OS:-}" ]]; then
|
||||||
echo "Please provide provide --distro parameter, e.g. ./createrepo.sh --distro ubuntu:24.04"
|
echo "Please provide --distro parameter, e.g. ./createrepo.sh --distro ubuntu:24.04"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
RESULT=$(echo "$OS" | sed 's/://g' | sed 's/\//-/g')
|
||||||
|
|
||||||
pkg_format="deb"
|
pkg_format="deb"
|
||||||
if [[ "$OS" == *"rocky"* ]]; then
|
if [[ "$OS" == *"rocky"* ]]; then
|
||||||
pkg_format="rpm"
|
pkg_format="rpm"
|
||||||
@ -38,17 +38,40 @@ fi
|
|||||||
|
|
||||||
cd "/mdb/${BUILDDIR}"
|
cd "/mdb/${BUILDDIR}"
|
||||||
|
|
||||||
|
if ! compgen -G "/mdb/${BUILDDIR}/*.rpm" > /dev/null \
|
||||||
|
&& ! compgen -G "/mdb/${BUILDDIR}/storage/columnstore/columnstore/cmapi/*.rpm" > /dev/null \
|
||||||
|
&& ! compgen -G "/mdb/${BUILDDIR}/*.deb" > /dev/null \
|
||||||
|
&& ! compgen -G "/mdb/${BUILDDIR}/storage/columnstore/columnstore/cmapi/*.deb" > /dev/null
|
||||||
|
then
|
||||||
|
echo "None of the cmapi or columnstore packages found. Failing!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Adding columnstore packages to repository..."
|
||||||
|
if [[ "${pkg_format}" == "rpm" && $(compgen -G "$COLUMNSTORE_RPM_PACKAGES_PATH") ]]; then
|
||||||
|
mv -v $COLUMNSTORE_RPM_PACKAGES_PATH "./${RESULT}/"
|
||||||
|
elif [[ "${pkg_format}" == "deb" && $(compgen -G "$COLUMNSTORE_DEB_PACKAGES_PATH") ]]; then
|
||||||
|
mv -v $COLUMNSTORE_DEB_PACKAGES_PATH "./${RESULT}/"
|
||||||
|
else
|
||||||
|
echo "Columnstore packages are not found!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Adding cmapi packages to repository..."
|
||||||
|
if [[ "${pkg_format}" == "rpm" && $(compgen -G "$CMAPI_RPM_PACKAGES_PATH") ]]; then
|
||||||
|
mv -v $CMAPI_RPM_PACKAGES_PATH "./${RESULT}/"
|
||||||
|
elif [[ "${pkg_format}" == "deb" && $(compgen -G "$CMAPI_DEB_PACKAGES_PATH") ]]; then
|
||||||
|
mv -v $CMAPI_DEB_PACKAGES_PATH "./${RESULT}/"
|
||||||
|
else
|
||||||
|
echo "Cmapi packages are not found!"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${pkg_format}" == "rpm" ]]; then
|
if [[ "${pkg_format}" == "rpm" ]]; then
|
||||||
dnf install -q -y createrepo
|
dnf install -q -y createrepo
|
||||||
|
|
||||||
mv -v ${COLUMNSTORE_RPM_PACKAGES_PATH} ${CMAPI_RPM_PACKAGES_PATH} "./${RESULT}/"
|
|
||||||
createrepo "./${RESULT}"
|
createrepo "./${RESULT}"
|
||||||
|
|
||||||
else
|
else
|
||||||
apt update && apt install -y dpkg-dev
|
apt update && apt install -y dpkg-dev
|
||||||
mv -v ${COLUMNSTORE_DEB_PACKAGES_PATH} ${CMAPI_DEB_PACKAGES_PATH} "./${RESULT}/"
|
|
||||||
dpkg-scanpackages "${RESULT}" | gzip > "./${RESULT}/Packages.gz"
|
dpkg-scanpackages "${RESULT}" | gzip > "./${RESULT}/Packages.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "/drone/src/${RESULT}"
|
mkdir -p "/drone/src/${RESULT}"
|
||||||
cp -vrf "./${RESULT}" "/drone/src/${RESULT}"
|
cp -vrf "./${RESULT}/." "/drone/src/${RESULT}"
|
||||||
|
Reference in New Issue
Block a user