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
MCOL-5966 common createrepo for cmapi and columnstore packages
This commit is contained in:
committed by
Leonid Fedorov
parent
41176f9f5b
commit
74f51afb21
@ -134,7 +134,7 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
|
|||||||
|
|
||||||
publish(step_prefix='pkg', eventp=event + '/${DRONE_BUILD_NUMBER}'):: {
|
publish(step_prefix='pkg', eventp=event + '/${DRONE_BUILD_NUMBER}'):: {
|
||||||
name: 'publish ' + step_prefix,
|
name: 'publish ' + step_prefix,
|
||||||
depends_on: [std.strReplace(step_prefix, ' latest', '')],
|
depends_on: [std.strReplace(step_prefix, ' latest', ''), 'createrepo'],
|
||||||
image: 'amazon/aws-cli',
|
image: 'amazon/aws-cli',
|
||||||
when: {
|
when: {
|
||||||
status: ['success', 'failure'],
|
status: ['success', 'failure'],
|
||||||
@ -710,13 +710,6 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
|
|||||||
'/mdb/' + builddir + '/storage/columnstore/columnstore/build/ansi2txt.sh ' +
|
'/mdb/' + builddir + '/storage/columnstore/columnstore/build/ansi2txt.sh ' +
|
||||||
'/mdb/' + builddir + '/' + result + '/build.log"' ,
|
'/mdb/' + builddir + '/' + result + '/build.log"' ,
|
||||||
'sccache --show-stats',
|
'sccache --show-stats',
|
||||||
|
|
||||||
// move engine and cmapi packages to one dir and make a repo
|
|
||||||
if (pkg_format == 'rpm') then "mv -v -t ./" + result + "/ /mdb/" + builddir + "/*.rpm /drone/src/cmapi/" + result + "/*.rpm && createrepo ./" + result
|
|
||||||
else "mv -v -t ./" + result + "/ /mdb/*.deb /drone/src/cmapi/" + result + "/*.deb && dpkg-scanpackages " + result + " | gzip > ./" + result + "/Packages.gz",
|
|
||||||
|
|
||||||
// list storage manager binary
|
|
||||||
'ls -la /mdb/' + builddir + '/storage/columnstore/columnstore/storage-manager',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -731,9 +724,18 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
|
|||||||
'bash /mdb/' + builddir + '/storage/columnstore/columnstore/build/build_cmapi.sh --distro ' + platform + ' --arch ' + arch,
|
'bash /mdb/' + builddir + '/storage/columnstore/columnstore/build/build_cmapi.sh --distro ' + platform + ' --arch ' + arch,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'createrepo',
|
||||||
|
depends_on: ['build', 'cmapi build'],
|
||||||
|
image: img,
|
||||||
|
volumes: [pipeline._volumes.mdb],
|
||||||
|
commands: [
|
||||||
|
'bash /mdb/' + builddir + '/storage/columnstore/columnstore/build/createrepo.sh --distro ' + platform,
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'unittests',
|
name: 'unittests',
|
||||||
depends_on: ['build'],
|
depends_on: ['createrepo'],
|
||||||
image: img,
|
image: img,
|
||||||
volumes: [pipeline._volumes.mdb],
|
volumes: [pipeline._volumes.mdb],
|
||||||
environment: {
|
environment: {
|
||||||
@ -774,7 +776,6 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
] +
|
] +
|
||||||
[pipeline.cmapipython] + [pipeline.cmapibuild] +
|
|
||||||
[pipeline.publish('cmapi build')] +
|
[pipeline.publish('cmapi build')] +
|
||||||
[pipeline.publish()] +
|
[pipeline.publish()] +
|
||||||
[
|
[
|
||||||
|
54
build/createrepo.sh
Executable file
54
build/createrepo.sh
Executable file
@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script creates a repository from packages in result directory
|
||||||
|
# Should be executed by root
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
SCRIPT_LOCATION=$(dirname "$0")
|
||||||
|
|
||||||
|
|
||||||
|
source "$SCRIPT_LOCATION"/utils.sh
|
||||||
|
optparse.define short=D long=distro desc="OS" variable=OS
|
||||||
|
source $(optparse.build)
|
||||||
|
echo "Arguments received: $@"
|
||||||
|
|
||||||
|
BUILDDIR="verylongdirnameforverystrangecpackbehavior";
|
||||||
|
COLUMNSTORE_RPM_PACKAGES_PATH="/mdb/${BUILDDIR}/*.rpm"
|
||||||
|
CMAPI_RPM_PACKAGES_PATH="/mdb/${BUILDDIR}/storage/columnstore/columnstore/cmapi/*.rpm"
|
||||||
|
|
||||||
|
COLUMNSTORE_DEB_PACKAGES_PATH="/mdb/*.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
|
||||||
|
error "Please run script as root"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${OS:-}" ]]; then
|
||||||
|
echo "Please provide provide --distro parameter, e.g. ./createrepo.sh --distro ubuntu:24.04"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pkg_format="deb"
|
||||||
|
if [[ "$OS" == *"rocky"* ]]; then
|
||||||
|
pkg_format="rpm"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "/mdb/${BUILDDIR}"
|
||||||
|
|
||||||
|
if [[ "${pkg_format}" == "rpm" ]]; then
|
||||||
|
dnf install -q -y createrepo
|
||||||
|
|
||||||
|
mv -v ${COLUMNSTORE_RPM_PACKAGES_PATH} ${CMAPI_RPM_PACKAGES_PATH} "./${RESULT}/"
|
||||||
|
createrepo "./${RESULT}"
|
||||||
|
|
||||||
|
else
|
||||||
|
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"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "/drone/src/${RESULT}"
|
||||||
|
cp -vrf "./${RESULT}" "/drone/src/${RESULT}"
|
Reference in New Issue
Block a user