From 249c672352a88b8519e44259170ffe9dcb0c1e17 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Mon, 2 Aug 2021 12:44:31 +0300 Subject: [PATCH 01/54] [Issue #413] deb packages --- Makefile | 2 + packaging/Makefile.debian | 74 ++++++ packaging/Makefile.pkg | 227 ++++++++++++++++++ packaging/Makefile.ubuntu | 99 ++++++++ packaging/Readme.md | 16 ++ packaging/scripts/deb.sh | 151 ++++++++++++ .../specs/deb/pg_probackup/debian/changelog | 11 + .../specs/deb/pg_probackup/debian/compat | 1 + .../specs/deb/pg_probackup/debian/control | 29 +++ .../pg_probackup/debian/pg_probackup.install | 1 + packaging/specs/deb/pg_probackup/debian/rules | 29 +++ .../deb/pg_probackup/debian/source/format | 1 + packaging/tarballs/.gitkeep | 0 13 files changed, 641 insertions(+) create mode 100644 packaging/Makefile.debian create mode 100644 packaging/Makefile.pkg create mode 100644 packaging/Makefile.ubuntu create mode 100644 packaging/Readme.md create mode 100755 packaging/scripts/deb.sh create mode 100644 packaging/specs/deb/pg_probackup/debian/changelog create mode 100644 packaging/specs/deb/pg_probackup/debian/compat create mode 100644 packaging/specs/deb/pg_probackup/debian/control create mode 100644 packaging/specs/deb/pg_probackup/debian/pg_probackup.install create mode 100644 packaging/specs/deb/pg_probackup/debian/rules create mode 100644 packaging/specs/deb/pg_probackup/debian/source/format create mode 100644 packaging/tarballs/.gitkeep diff --git a/Makefile b/Makefile index 1431be4ef..8b2a26d56 100644 --- a/Makefile +++ b/Makefile @@ -80,3 +80,5 @@ src/walmethods.h: $(srchome)/src/bin/pg_basebackup/walmethods.h ifeq ($(PORTNAME), aix) CC=xlc_r endif + +include packaging/Makefile.pkg diff --git a/packaging/Makefile.debian b/packaging/Makefile.debian new file mode 100644 index 000000000..016dce381 --- /dev/null +++ b/packaging/Makefile.debian @@ -0,0 +1,74 @@ +# DEBIAN 8 +build/debian_8_9.5: + $(call build_deb,debian,8,jessie,9.5,9.5.25) + touch build/debian_8_9.5 + +build/debian_8_9.6: + $(call build_deb,debian,8,jessie,9.6,9.6.21) + touch build/debian_8_9.6 + +build/debian_8_10: + $(call build_deb,debian,8,jessie,10,10.16) + touch build/debian_8_10 + +build/debian_8_11: + $(call build_deb,debian,8,jessie,11,11.11) + touch build/debian_8_11 + +build/debian_8_12: + $(call build_deb,debian,8,jessie,12,12.6) + touch build/debian_8_12 + +build/debian_8_13: + $(call build_deb,debian,8,jessie,13,13.3) + touch build/debian_8_13 + +# DEBIAN 9 +build/debian_9_9.5: + $(call build_deb,debian,9,stretch,9.5,9.5.25) + touch build/debian_9_9.5 + +build/debian_9_9.6: + $(call build_deb,debian,9,stretch,9.6,9.6.21) + touch build/debian_9_9.6 + +build/debian_9_10: + $(call build_deb,debian,9,stretch,10,10.16) + touch build/debian_9_10 + +build/debian_9_11: + $(call build_deb,debian,9,stretch,11,11.11) + touch build/debian_9_11 + +build/debian_9_12: + $(call build_deb,debian,9,stretch,12,12.6) + touch build/debian_9_12 + +build/debian_9_13: + $(call build_deb,debian,9,stretch,13,13.3) + touch build/debian_9_13 + +# DEBIAN 10 +build/debian_10_9.5: + $(call build_deb,debian,10,buster,9.5,9.5.25) + touch build/debian_10_9.5 + +build/debian_10_9.6: + $(call build_deb,debian,10,buster,9.6,9.6.21) + touch build/debian_10_9.6 + +build/debian_10_10: + $(call build_deb,debian,10,buster,10,10.16) + touch build/debian_10_10 + +build/debian_10_11: + $(call build_deb,debian,10,buster,11,11.11) + touch build/debian_10_11 + +build/debian_10_12: + $(call build_deb,debian,10,buster,12,12.6) + touch build/debian_10_12 + +build/debian_10_13: + $(call build_deb,debian,10,buster,13,13.3) + touch build/debian_10_13 diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg new file mode 100644 index 000000000..2ff3d4bb8 --- /dev/null +++ b/packaging/Makefile.pkg @@ -0,0 +1,227 @@ +WORKDIR ?= $(CURDIR) +BUILDDIR = $(WORKDIR)/build/ +PBK_GIT_REPO = http://github.com/postgrespro/pg_probackup + +ifeq ($(PBK_EDITION),std) + PBK_PKG_REPO = pg_probackup-forks + PBK_EDITION_FULL = Standart + PKG_NAME_SUFFIX = std- +else ifeq ($(PBK_EDITION),ent) + PBK_PKG_REPO = pg_probackup-forks + PBK_EDITION_FULL = Enterprise + PKG_NAME_SUFFIX = ent- +else + PBK_PKG_REPO = pg_probackup + PBK_EDITION_FULL = + PBK_EDITION = + PKG_NAME_SUFFIX = +endif + +#ifndef $(PG_VERSIONS) +#PG_VERSIONS = $(PG_VERSIONS_DEFAULT) +#endif + +pkg: prepare_builddir build/all + @echo Build for all platform: done +# echo "HELLO" + +prepare_builddir: + @if [ -z ${PBK_VERSION} ] ; then \ + echo "Env variable PBK_VERSION is not set" ; \ + false ; \ + fi + + @if [ -z ${PBK_RELEASE} ] ; then \ + echo "Env variable PBK_RELEASE is not set" ; \ + false ; \ + fi + + @if [ -z ${PBK_HASH} ] ; then \ + echo "Env variable PBK_HASH is not set" ; \ + false ; \ + fi + mkdir -p $(BUILDDIR) + +#deb: prepare_builddir +# cd $(BUILDDIR) && cp -a $(WORKDIR)/packaging/debian . && dpkg-buildpackage -b +# cp -av build/mamonsu*.deb . + +#rpm: prepare_builddir $(BUILDDIR)/packaging/rpm/SPECS/$(SPEC) +# mkdir -p $(BUILDDIR)/packaging/rpm/RPMS $(BUILDDIR)/packaging/rpm/BUILD $(BUILDDIR)/packaging/rpm/SRPMS +# rpmbuild -ba --define '_topdir $(BUILDDIR)/packaging/rpm'\ +# $(BUILDDIR)/packaging/rpm/SPECS/$(SPEC) +# cp -av $(BUILDDIR)/packaging/rpm/RPMS/noarch/mamonsu*.rpm . + +#build/prepare: +# mkdir -p build +# touch build/prepare + +#build/all: build/debian build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/pkg_suse +# @echo Build for all platform: done +# touch build/all + +build/all: build/debian build/ubuntu + @echo Packaging is done + +### DEBIAN +build/debian: build/debian_8 #build/debian_9 build/debian_10 + @echo Debian: done + +build/debian_8: build/debian_8_9.5 build/debian_8_9.6 #build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13 + @echo Debian 8: done + +build/debian_9: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13 + @echo Debian 9: done + +build/debian_10: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13 + @echo Debian 10: done + +### UBUNTU +build/ubuntu: build/ubuntu_14.04 #build/ubuntu_16.04 build/ubuntu_18.04 build/ubuntu_20.04 + @echo Ubuntu: done + +build/ubuntu_14.04: build/ubuntu_14.04_9.5 #build/ubuntu_14.04_9.6 build/ubuntu_14.04_10 build/ubuntu_14.04_11 build/ubuntu_14.04_12 build/ubuntu_14.04_13 + @echo Ubuntu 14.04: + +build/ubuntu_16.04: build/ubuntu_16.04_9.5 build/ubuntu_16.04_9.6 build/ubuntu_16.04_10 build/ubuntu_16.04_11 build/ubuntu_16.04_12 build/ubuntu_16.04_13 + @echo Ubuntu 16.04: done + +build/ubuntu_18.04: build/ubuntu_18.04_9.5 build/ubuntu_18.04_9.6 build/ubuntu_18.04_10 build/ubuntu_18.04_11 build/ubuntu_18.04_12 build/ubuntu_18.04_13 + @echo Ubuntu 18.04: done + +build/ubuntu_20.04: build/ubuntu_20.04_9.5 build/ubuntu_20.04_9.6 build/ubuntu_20.04_10 build/ubuntu_20.04_11 build/ubuntu_20.04_12 build/ubuntu_20.04_13 + @echo Ubuntu 20.04: done + +#build/centos: build/centos_6 build/centos_7 build/rpm_repo_package_centos +# @echo Centos: done + +define build_deb + docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ + docker run \ + -v "$(WORKDIR)":/app/in \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO):/app/out \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ + -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \ + -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ + --rm pgpro/$1:$2 /app/in/packaging/scripts/deb.sh +endef + + +#define build_rpm +# docker run -v "$(WORKDIR)":/app/in \ +# -v "$(WORKDIR)/build/pkg/$1/$2/mamonsu/$(VERSION)":/app/out \ +# -e "VERSION=$(VERSION)" -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" \ +# --rm $1:$2 /app/in/packaging/scripts/rpm.sh +#endef +# +#define build_rpm_repo_pkg +# docker run -v "$(WORKDIR)":/app/in \ +# -v "$(WORKDIR)/build/pkg/keys":/app/out \ +# -e "VERSION=$(VERSION)" -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" \ +# --rm $1:$2 /app/in/packaging/scripts/repo_rpm.sh +#endef + +#build/rpm_repo_package_centos: +# $(call build_rpm_repo_pkg,centos,7) +# touch build/rpm_repo_package_centos +# +include packaging/Makefile.debian +include packaging/Makefile.ubuntu + +#build/ubuntu_14_04: +# $(call build_deb,ubuntu,14.04,trusty) +# touch build/ubuntu_14_04 +# +#build/ubuntu_16_04: +# $(call build_deb,ubuntu,16.04,xenial) +# touch build/ubuntu_16_04 +# +#build/ubuntu_18_04: +# $(call build_deb,ubuntu,18.04,bionic) +# touch build/ubuntu_18_04 +# +#build/centos_6: +# $(call build_rpm,centos,6) +# touch build/centos_6 +# +#build/centos_7: +# $(call build_rpm,centos,7) +# touch build/centos_7 + +#build/centos_8: +# $(call build_rpm,centos,8) +# touch build/centos_8 + +repo/all: repo/debian repo/ubuntu repo/centos repo/finish + @echo Build repo for all platform: done + touch build/repo_all + +repo/debian: repo/debian_8 repo/debian_9 repo/debian_10 + @echo Build repo for debian platforms: done + touch build/repo_debian + +repo/ubuntu: repo/ubuntu_16_04 repo/ubuntu_18_04 + @echo Build repo for ubuntu platforms: done + touch build/repo_ubuntu + +repo/centos: repo/centos_6 repo/centos_7 + @echo Build repo for centos platforms: done + touch build/repo_centos + +repo/centos_6: + $(call build_repo_rpm,centos,6,6) + touch build/repo_centos_6 + +repo/centos_7: + $(call build_repo_rpm,centos,7,7) + touch build/repo_centos_7 + +repo/debian_8: + $(call build_repo_deb,debian,8,jessie) + touch build/repo_debian_8 + +repo/debian_9: + $(call build_repo_deb,debian,9,stretch) + touch build/repo_debian_9 + +repo/debian_10: + $(call build_repo_deb,debian,10,buster) + touch build/repo_debian_10 + +repo/ubuntu_14_04: + $(call build_repo_deb,ubuntu,14.04,trusty) + touch build/repo_ubuntu_14_04 + +repo/ubuntu_16_04: + $(call build_repo_deb,ubuntu,16.04,xenial) + touch build/repo_ubuntu_16_04 + +repo/ubuntu_18_04: + $(call build_repo_deb,ubuntu,18.04,bionic) + touch build/repo_ubuntu_18_04 + +repo/finish: + $(call repo_finish,centos,7) + touch build/repo_finish + +define build_repo_deb + docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + --rm $1:$2 /app/repo/scripts/deb.sh +endef + +define build_repo_rpm + docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + --rm $1:$2 /app/repo/scripts/rpm.sh +endef + +define repo_finish + docker run -v $(WORKDIR)/build/pkg/keys:/app/in -v $(WORKDIR)/build/www:/app/www \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + --rm $1:$2 bash -exc "cp -av /app/in/*rpm /app/www/mamonsu/keys && cd /app/www/mamonsu/ && \ + ln -s $(VERSION) latest" +endef diff --git a/packaging/Makefile.ubuntu b/packaging/Makefile.ubuntu new file mode 100644 index 000000000..74bbfd875 --- /dev/null +++ b/packaging/Makefile.ubuntu @@ -0,0 +1,99 @@ +# UBUNTU 20.04 +build/ubuntu_20.04_9.5: + $(call build_deb,ubuntu,20.04,focal,9.5,9.5.25) + touch build/ubuntu_20.04_9.5 + +build/ubuntu_20.04_9.6: + $(call build_deb,ubuntu,20.04,focal,9.6,9.6.21) + touch build/ubuntu_20.04_9.6 + +build/ubuntu_20.04_10: + $(call build_deb,ubuntu,20.04,focal,10,10.16) + touch build/ubuntu_20.04_10 + +build/ubuntu_20.04_11: + $(call build_deb,ubuntu,20.04,focal,11,11.11) + touch build/ubuntu_20.04_11 + +build/ubuntu_20.04_12: + $(call build_deb,ubuntu,20.04,focal,12,12.6) + touch build/ubuntu_20.04_12 + +build/ubuntu_20.04_13: + $(call build_deb,ubuntu,20.04,focal,13,13.3) + touch build/ubuntu_20.04_13 + +# UBUNTU 18.04 +build/ubuntu_18.04_9.5: + $(call build_deb,ubuntu,18.04,bionic,9.5,9.5.25) + touch build/ubuntu_18.04_9.5 + +build/ubuntu_18.04_9.6: + $(call build_deb,ubuntu,18.04,bionic,9.6,9.6.21) + touch build/ubuntu_18.04_9.6 + +build/ubuntu_18.04_10: + $(call build_deb,ubuntu,18.04,bionic,10,10.16) + touch build/ubuntu_18.04_10 + +build/ubuntu_18.04_11: + $(call build_deb,ubuntu,18.04,bionic,11,11.11) + touch build/ubuntu_18.04_11 + +build/ubuntu_18.04_12: + $(call build_deb,ubuntu,18.04,bionic,12,12.6) + touch build/ubuntu_18.04_12 + +build/ubuntu_18.04_13: + $(call build_deb,ubuntu,18.04,bionic,13,13.3) + touch build/ubuntu_18.04_13 + +# UBUNTU 16.04 +build/ubuntu_16.04_9.5: + $(call build_deb,ubuntu,16.04,xenial,9.5,9.5.25) + touch build/ubuntu_16.04_9.5 + +build/ubuntu_16.04_9.6: + $(call build_deb,ubuntu,16.04,xenial,9.6,9.6.21) + touch build/ubuntu_16.04_9.6 + +build/ubuntu_16.04_10: + $(call build_deb,ubuntu,16.04,xenial,10,10.16) + touch build/ubuntu_16.04_10 + +build/ubuntu_16.04_11: + $(call build_deb,ubuntu,16.04,xenial,11,11.11) + touch build/ubuntu_16.04_11 + +build/ubuntu_16.04_12: + $(call build_deb,ubuntu,16.04,xenial,12,12.6) + touch build/ubuntu_16.04_12 + +build/ubuntu_16.04_13: + $(call build_deb,ubuntu,16.04,xenial,13,13.3) + touch build/ubuntu_16.04_13 + +# UBUNTU 14.04 +build/ubuntu_14.04_9.5: + $(call build_deb,ubuntu,14.04,trusty,9.5,9.5.25) + touch build/ubuntu_14.04_9.5 + +build/ubuntu_14.04_9.6: + $(call build_deb,ubuntu,14.04,trusty,9.6,9.6.21) + touch build/ubuntu_14.04_9.6 + +build/ubuntu_14.04_10: + $(call build_deb,ubuntu,14.04,trusty,10,10.16) + touch build/ubuntu_14.04_10 + +build/ubuntu_14.04_11: + $(call build_deb,ubuntu,14.04,trusty,11,11.11) + touch build/ubuntu_14.04_11 + +build/ubuntu_14.04_12: + $(call build_deb,ubuntu,14.04,trusty,12,12.6) + touch build/ubuntu_14.04_12 + +build/ubuntu_14.04_13: + $(call build_deb,ubuntu,14.04,trusty,13,13.3) + touch build/ubuntu_14.04_13 diff --git a/packaging/Readme.md b/packaging/Readme.md new file mode 100644 index 000000000..cb2c4027c --- /dev/null +++ b/packaging/Readme.md @@ -0,0 +1,16 @@ +``` +export PBK_VERSION=2.4.17 +export PG_VERSIONS=9.5 +export PBK_HASH=57f871accce2604 +export PBK_EDITION=std +make pkg +``` + +To build binaries for PostgresPro Standart or Enterprise, a pgpro.tar.bz2 with latest git tree must be preset in `packaging/tarballs` directory: +``` +cd packaging/tarballs +git clone pgpro_repo pgpro +tar -cjSf pgpro.tar.bz2 pgpro +``` + +To build repo the gpg keys for package signing must be present ... diff --git a/packaging/scripts/deb.sh b/packaging/scripts/deb.sh new file mode 100755 index 000000000..5f657e04c --- /dev/null +++ b/packaging/scripts/deb.sh @@ -0,0 +1,151 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +# THere is no std/ent packages for PG 9.5 +#echo ${PG_MAJOUR_VERSION} +#echo ${PBK_EDITION} +if [[ ${PG_VERSION} == '9.5' ]] && [[ ${PBK_EDITION} != '' ]] ; then + exit 0 +fi + +# PACKAGES NEEDED +apt-get update -y && apt-get install -y git wget bzip2 devscripts equivs + +# Prepare +export DEBIAN_FRONTEND=noninteractive +echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +if [ ${CODENAME} == 'jessie' ]; then +printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list +fi + +apt-get -qq update -y + +# download PKG_URL if PKG_HASH is omitted +mkdir /root/build +cd /root/build + +# clone pbk repo +git clone $PKG_URL ${PKG_NAME}_${PKG_VERSION} +cd ${PKG_NAME}_${PKG_VERSION} +git fetch -a +git checkout ${PKG_HASH} +cd .. + +PG_TOC=$(echo ${PG_VERSION} | sed 's|\.||g') +# Download PostgreSQL source +if [[ ${PBK_EDITION} == '' ]] ; then + wget -q http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 +fi + +cd /root/build/${PKG_NAME}_${PKG_VERSION} +cp -av /app/in/packaging/specs/deb/pg_probackup/debian ./ +if [[ ${PBK_EDITION} == '' ]] ; then + sed -i "s/@PKG_NAME@/${PKG_NAME}/g" debian/changelog + sed -i "s/@PKG_VERSION@/${PKG_VERSION}/g" debian/changelog + sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/g" debian/changelog + sed -i "s/@PKG_HASH@/${PKG_HASH}/g" debian/changelog + sed -i "s/@CODENAME@/${CODENAME}/g" debian/changelog + + sed -i "s/@PKG_NAME@/${PKG_NAME}/g" debian/control + sed -i "s/@PG_VERSION@/${PG_VERSION}/g" debian/control + + sed -i "s/@PG_VERSION@/${PG_VERSION}/" debian/pg_probackup.install + mv debian/pg_probackup.install debian/${PKG_NAME}.install + + sed -i "s/@PKG_NAME@/${PKG_NAME}/g" debian/rules + sed -i "s/@PG_TOC@/${PG_TOC}/g" debian/rules + sed -i "s/@PG_VERSION@/${PG_VERSION}/g" debian/rules + sed -i "s/@PG_FULL_VERSION@/${PG_FULL_VERSION}/g" debian/rules + sed -i "s|@PREFIX@|/stump|g" debian/rules +else + sed -i "s/@PKG_NAME@/pg-probackup-${PBK_EDITION}-${PG_VERSION}/g" debian/changelog + sed -i "s/@PKG_VERSION@/${PKG_VERSION}/g" debian/changelog + sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/g" debian/changelog + sed -i "s/@PKG_HASH@/${PKG_HASH}/g" debian/changelog + sed -i "s/@CODENAME@/${CODENAME}/g" debian/changelog + + sed -i "s/@PKG_NAME@/pg-probackup-${PBK_EDITION}-${PG_VERSION}/g" debian/control + sed -i "s/pg-probackup-@PG_VERSION@/pg-probackup-${PBK_EDITION}-${PG_VERSION}/g" debian/control + sed -i "s/@PG_VERSION@/${PG_VERSION}/g" debian/control + sed -i "s/PostgreSQL/PostgresPro ${PBK_EDITION_FULL}/g" debian/control + + sed -i "s/pg_probackup-@PG_VERSION@/pg_probackup-${PBK_EDITION}-${PG_VERSION}/" debian/pg_probackup.install + mv debian/pg_probackup.install debian/pg-probackup-${PBK_EDITION}-${PG_VERSION}.install + + sed -i "s/@PKG_NAME@/pg-probackup-${PBK_EDITION}-${PG_VERSION}/g" debian/rules + sed -i "s/@PG_TOC@/${PG_TOC}/g" debian/rules + sed -i "s/pg_probackup-@PG_VERSION@/pg_probackup-${PBK_EDITION}-${PG_VERSION}/g" debian/rules + sed -i "s/postgresql-@PG_FULL_VERSION@/postgrespro-${PBK_EDITION}-${PG_FULL_VERSION}/g" debian/rules + + if [ ${PG_VERSION} == '9.6' ]; then + sed -i "s|@PREFIX@|/stump|g" debian/rules + else + sed -i "s|@PREFIX@|/opt/pgpro/${PBK_EDITION}-${PG_VERSION}|g" debian/rules + fi +fi + +# Build dependencies +mk-build-deps --install --remove --tool 'apt-get --no-install-recommends --yes' debian/control +rm -rf ./*.deb + +# Pack source to orig.tar.gz +mkdir -p /root/build/dsc +if [[ ${PBK_EDITION} == '' ]] ; then + mv /root/build/postgresql-${PG_FULL_VERSION}.tar.bz2 \ + /root/build/dsc/${PKG_NAME}_${PKG_VERSION}.orig-postgresql${PG_TOC}.tar.bz2 + + cd /root/build/${PKG_NAME}_${PKG_VERSION} + tar -xf /root/build/dsc/${PKG_NAME}_${PKG_VERSION}.orig-postgresql${PG_TOC}.tar.bz2 + cd /root/build + + tar -czf ${PKG_NAME}_${PKG_VERSION}.orig.tar.gz \ + ${PKG_NAME}_${PKG_VERSION} + + mv /root/build/${PKG_NAME}_${PKG_VERSION}.orig.tar.gz /root/build/dsc + + cd /root/build/${PKG_NAME}_${PKG_VERSION} + tar -xf /root/build/dsc/${PKG_NAME}_${PKG_VERSION}.orig-postgresql${PG_TOC}.tar.bz2 +else + tar -xf /app/in/packaging/tarballs/pgpro.tar.bz2 -C /root/build/dsc/ + cd /root/build/dsc/pgpro + + PGPRO_TOC=$(echo ${PG_FULL_VERSION} | sed 's|\.|_|g') + if [[ ${PBK_EDITION} == 'std' ]] ; then + git checkout "PGPRO${PGPRO_TOC}_1" + else + git checkout "PGPROEE${PGPRO_TOC}_1" + fi + + mv /root/build/dsc/pgpro /root/build/${PKG_NAME}_${PKG_VERSION}/postgrespro-${PBK_EDITION}-${PG_FULL_VERSION} +fi + +# BUILD: SOURCE PKG +if [[ ${PBK_EDITION} == '' ]] ; then + cd /root/build/dsc + dpkg-source -b /root/build/${PKG_NAME}_${PKG_VERSION} +fi + +# BUILD: DEB PKG +cd /root/build/${PKG_NAME}_${PKG_VERSION} +dpkg-buildpackage -b #&> /app/out/build.log + +# COPY ARTEFACTS +rm -rf /app/out/* +cd /root/build +cp -v *.deb /app/out +cp -v *.changes /app/out + +if [[ ${PBK_EDITION} == '' ]] ; then + cp -arv dsc /app/out +fi diff --git a/packaging/specs/deb/pg_probackup/debian/changelog b/packaging/specs/deb/pg_probackup/debian/changelog new file mode 100644 index 000000000..5b9160220 --- /dev/null +++ b/packaging/specs/deb/pg_probackup/debian/changelog @@ -0,0 +1,11 @@ +@PKG_NAME@ (@PKG_VERSION@-@PKG_RELEASE@.@PKG_HASH@.@CODENAME@) @CODENAME@; urgency=medium + + * @PKG_VERSION@ + + -- Grigory Smolkin Wed, 9 Feb 2018 10:22:08 +0300 + +@PKG_NAME@ (2.0.14-1.@CODENAME@) @CODENAME@; urgency=medium + + * Initial package + + -- Grigory Smolkin Fri, 29 Jan 2018 10:22:08 +0300 diff --git a/packaging/specs/deb/pg_probackup/debian/compat b/packaging/specs/deb/pg_probackup/debian/compat new file mode 100644 index 000000000..ec635144f --- /dev/null +++ b/packaging/specs/deb/pg_probackup/debian/compat @@ -0,0 +1 @@ +9 diff --git a/packaging/specs/deb/pg_probackup/debian/control b/packaging/specs/deb/pg_probackup/debian/control new file mode 100644 index 000000000..8f1d42007 --- /dev/null +++ b/packaging/specs/deb/pg_probackup/debian/control @@ -0,0 +1,29 @@ +Source: @PKG_NAME@ +Section: database +Priority: optional +Maintainer: PostgresPro DBA +Uploaders: Grigory Smolkin +Build-Depends: + debhelper (>= 9), + bison, + dpkg-dev, + flex, + gettext, + zlib1g-dev | libz-dev, + libpq5 +Standards-Version: 3.9.6 +Homepage: https://github.com/postgrespro/pg_probackup + +Package: @PKG_NAME@ +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Backup tool for PostgreSQL. + . + This package provides pg_probackup binary for PostgreSQL @PG_VERSION@. + +Package: @PKG_NAME@-dbg +Depends: @PKG_NAME@ +Architecture: any +Description: Backup tool for PostgreSQL. + . + This package provides detached debugging symbols for pg_probackup diff --git a/packaging/specs/deb/pg_probackup/debian/pg_probackup.install b/packaging/specs/deb/pg_probackup/debian/pg_probackup.install new file mode 100644 index 000000000..ed904ca40 --- /dev/null +++ b/packaging/specs/deb/pg_probackup/debian/pg_probackup.install @@ -0,0 +1 @@ +pg_probackup-@PG_VERSION@ /usr/bin/ \ No newline at end of file diff --git a/packaging/specs/deb/pg_probackup/debian/rules b/packaging/specs/deb/pg_probackup/debian/rules new file mode 100644 index 000000000..309a9a1d4 --- /dev/null +++ b/packaging/specs/deb/pg_probackup/debian/rules @@ -0,0 +1,29 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_auto_clean: + # skip + +override_dh_auto_build: + cd postgresql-@PG_FULL_VERSION@ && ./configure --enable-debug --without-readline --prefix=@PREFIX@ &&\ + make MAKELEVEL=0 install DESTDIR=$(CURDIR)/debian/tmp && cd .. &&\ + make USE_PGXS=1 top_srcdir=$(CURDIR)/postgresql-@PG_FULL_VERSION@ PG_CONFIG=$(CURDIR)/debian/tmp/@PREFIX@/bin/pg_config &&\ + mv pg_probackup pg_probackup-@PG_VERSION@ + +override_dh_auto_test: + # skip + +override_dh_auto_install: + # skip + +override_dh_strip: + dh_strip --dbg-package=@PKG_NAME@-dbg + +override_dh_auto_clean: + # skip + #make clean top_srcdir=$(CURDIR)/pg@PG_TOC@-source PG_CONFIG=$(CURDIR)/debian/tmp/stump/bin/pg_config diff --git a/packaging/specs/deb/pg_probackup/debian/source/format b/packaging/specs/deb/pg_probackup/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/packaging/specs/deb/pg_probackup/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/packaging/tarballs/.gitkeep b/packaging/tarballs/.gitkeep new file mode 100644 index 000000000..e69de29bb From 4d672f1887dbcccb7829c435725909ef1f9638ef Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Tue, 3 Aug 2021 01:26:45 +0300 Subject: [PATCH 02/54] [Issue #413] rpm packages --- packaging/Makefile.centos | 24 +++ packaging/Makefile.pkg | 80 ++++++++-- packaging/scripts/deb.sh | 5 +- packaging/scripts/rpm.sh | 139 ++++++++++++++++++ .../rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP | 52 +++++++ .../SOURCES/GPG-KEY-PG_PROBACKUP-FORKS | 52 +++++++ .../rpmbuild/SOURCES/pg_probackup-forks.repo | 6 + .../rpm/rpmbuild/SOURCES/pg_probackup.repo | 13 ++ .../rpmbuild/SPECS/pg_probackup-pgpro.spec | 72 +++++++++ .../SPECS/pg_probackup-repo-forks.spec | 49 ++++++ .../rpm/rpmbuild/SPECS/pg_probackup-repo.spec | 59 ++++++++ .../SPECS/pg_probackup.alt.forks.spec | 57 +++++++ .../rpm/rpmbuild/SPECS/pg_probackup.alt.spec | 48 ++++++ .../rpm/rpmbuild/SPECS/pg_probackup.spec | 48 ++++++ 14 files changed, 686 insertions(+), 18 deletions(-) create mode 100644 packaging/Makefile.centos create mode 100755 packaging/scripts/rpm.sh create mode 100644 packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP create mode 100644 packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS create mode 100644 packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo create mode 100644 packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo create mode 100644 packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec create mode 100644 packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec create mode 100644 packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec create mode 100644 packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec create mode 100644 packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec create mode 100644 packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.spec diff --git a/packaging/Makefile.centos b/packaging/Makefile.centos new file mode 100644 index 000000000..b60dc0df6 --- /dev/null +++ b/packaging/Makefile.centos @@ -0,0 +1,24 @@ +# CENTOS 6 +build/centos_6_9.5: + $(call build_rpm,centos,6,,9.5,9.5.25) + touch build/centos_6_9.5 + +build/centos_6_9.6: + $(call build_rpm,centos,6,,9.6,9.6.21) + touch build/centos_6_9.6 + +build/centos_6_10: + $(call build_rpm,centos,6,,10,10.16) + touch build/centos_6_10 + +build/centos_6_11: + $(call build_rpm,centos,6,,11,11.11) + touch build/centos_6_11 + +build/centos_6_12: + $(call build_rpm,centos,6,,12,12.6) + touch build/centos_6_12 + +build/centos_6_13: + $(call build_rpm,centos,6,,13,13.3) + touch build/centos_6_13 diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 2ff3d4bb8..de46eda1c 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -60,14 +60,18 @@ prepare_builddir: # @echo Build for all platform: done # touch build/all -build/all: build/debian build/ubuntu +#build/all: build/debian build/ubuntu +# @echo Packaging is done + +build/all: build/centos @echo Packaging is done + ### DEBIAN -build/debian: build/debian_8 #build/debian_9 build/debian_10 +build/debian: build/debian_8 build/debian_9 build/debian_10 @echo Debian: done -build/debian_8: build/debian_8_9.5 build/debian_8_9.6 #build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13 +build/debian_8: build/debian_8_9.5 build/debian_8_9.6 build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13 @echo Debian 8: done build/debian_9: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13 @@ -77,10 +81,10 @@ build/debian_10: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/d @echo Debian 10: done ### UBUNTU -build/ubuntu: build/ubuntu_14.04 #build/ubuntu_16.04 build/ubuntu_18.04 build/ubuntu_20.04 +build/ubuntu: build/ubuntu_14.04 build/ubuntu_16.04 build/ubuntu_18.04 build/ubuntu_20.04 @echo Ubuntu: done -build/ubuntu_14.04: build/ubuntu_14.04_9.5 #build/ubuntu_14.04_9.6 build/ubuntu_14.04_10 build/ubuntu_14.04_11 build/ubuntu_14.04_12 build/ubuntu_14.04_13 +build/ubuntu_14.04: build/ubuntu_14.04_9.5 build/ubuntu_14.04_9.6 build/ubuntu_14.04_10 build/ubuntu_14.04_11 build/ubuntu_14.04_12 build/ubuntu_14.04_13 @echo Ubuntu 14.04: build/ubuntu_16.04: build/ubuntu_16.04_9.5 build/ubuntu_16.04_9.6 build/ubuntu_16.04_10 build/ubuntu_16.04_11 build/ubuntu_16.04_12 build/ubuntu_16.04_13 @@ -99,7 +103,7 @@ define build_deb docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ -v "$(WORKDIR)":/app/in \ - -v $(WORKDIR)/build/data/$(PBK_PKG_REPO):/app/out \ + -v $(WORKDIR)/build/data/$1/$2/$(PBK_PKG_REPO)/pg-probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ @@ -107,13 +111,63 @@ define build_deb --rm pgpro/$1:$2 /app/in/packaging/scripts/deb.sh endef +include packaging/Makefile.debian +include packaging/Makefile.ubuntu + +# CENTOS +build/centos: build/centos_6 #build/centos_7 build/centos_7 build/rpm_repo_package_centos + @echo Centos: done + +build/centos_6: build/centos_6_9.5 build/centos_6_9.6 #build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 + @echo Centos 6: done + +build/centos_7: build/centos_7_9.5 build/centos_7_9.6 build/centos_7_10 build/centos_7_11 build/centos_7_12 build/centos_7_13 + @echo Centos 7: done + +build/centos_8: build/centos_8_9.5 build/centos_8_9.6 build/centos_8_10 build/centos_8_11 build/centos_8_12 build/centos_8_13 + @echo Centos 8: done + +# Oracle Linux +build/oraclelinux: build/oraclelinux_6 build/oraclelinux_7 build/oraclelinux_7 build/rpm_repo_package_oraclelinux + @echo Oraclelinux: done + +build/oraclelinux_6: build/oraclelinux_6_9.5 build/oraclelinux_6_9.6 build/oraclelinux_6_10 build/oraclelinux_6_11 build/oraclelinux_6_12 build/oraclelinux_6_13 + @echo Oraclelinux 6: done + +build/oraclelinux_7: build/oraclelinux_7_9.5 build/oraclelinux_7_9.6 build/oraclelinux_7_10 build/oraclelinux_7_11 build/oraclelinux_7_12 build/oraclelinux_7_13 + @echo Oraclelinux 7: done + +build/oraclelinux_8: build/oraclelinux_8_9.5 build/oraclelinux_8_9.6 build/oraclelinux_8_10 build/oraclelinux_8_11 build/oraclelinux_8_12 build/oraclelinux_8_13 + @echo Oraclelinux 8: done + +# RHEL +build/rhel: build/rhel_6 build/rhel_7 build/rhel_8 build/rpm_repo_package_rhel + @echo Rhel: done + +build/rhel_6: build/rhel_6_9.5 build/rhel_6_9.6 build/rhel_6_10 build/rhel_6_11 build/rhel_6_12 build/rhel_6_13 + @echo Rhel 6: done + +build/rhel_7: build/rhel_7_9.5 build/rhel_7_9.6 build/rhel_7_10 build/rhel_7_11 build/rhel_7_12 build/rhel_7_13 + @echo Rhel 7: done + +build/rhel_8: build/rhel_8_9.5 build/rhel_8_9.6 build/rhel_8_10 build/rhel_8_11 build/rhel_8_12 build/rhel_8_13 + @echo Rhel 8: done + + +define build_rpm + docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ + docker run \ + -v "$(WORKDIR)":/app/in \ + -v $(WORKDIR)/build/data/$1/$2/$(PBK_PKG_REPO)/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ + -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ + -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ + --rm pgpro/$1:$2 /app/in/packaging/scripts/rpm.sh +endef + +include packaging/Makefile.centos -#define build_rpm -# docker run -v "$(WORKDIR)":/app/in \ -# -v "$(WORKDIR)/build/pkg/$1/$2/mamonsu/$(VERSION)":/app/out \ -# -e "VERSION=$(VERSION)" -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" \ -# --rm $1:$2 /app/in/packaging/scripts/rpm.sh -#endef # #define build_rpm_repo_pkg # docker run -v "$(WORKDIR)":/app/in \ @@ -126,8 +180,6 @@ endef # $(call build_rpm_repo_pkg,centos,7) # touch build/rpm_repo_package_centos # -include packaging/Makefile.debian -include packaging/Makefile.ubuntu #build/ubuntu_14_04: # $(call build_deb,ubuntu,14.04,trusty) diff --git a/packaging/scripts/deb.sh b/packaging/scripts/deb.sh index 5f657e04c..9166e5e40 100755 --- a/packaging/scripts/deb.sh +++ b/packaging/scripts/deb.sh @@ -12,8 +12,6 @@ set -o pipefail ulimit -n 1024 # THere is no std/ent packages for PG 9.5 -#echo ${PG_MAJOUR_VERSION} -#echo ${PBK_EDITION} if [[ ${PG_VERSION} == '9.5' ]] && [[ ${PBK_EDITION} != '' ]] ; then exit 0 fi @@ -38,12 +36,11 @@ cd /root/build # clone pbk repo git clone $PKG_URL ${PKG_NAME}_${PKG_VERSION} cd ${PKG_NAME}_${PKG_VERSION} -git fetch -a git checkout ${PKG_HASH} cd .. PG_TOC=$(echo ${PG_VERSION} | sed 's|\.||g') -# Download PostgreSQL source +# Download PostgreSQL source if building for vanilla if [[ ${PBK_EDITION} == '' ]] ; then wget -q http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 fi diff --git a/packaging/scripts/rpm.sh b/packaging/scripts/rpm.sh new file mode 100755 index 000000000..210a23a77 --- /dev/null +++ b/packaging/scripts/rpm.sh @@ -0,0 +1,139 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + + +#yum upgrade -y || echo "some packages in docker fail to install" +#if [ -f /etc/rosa-release ]; then +# # Avoids old yum bugs on rosa-6 +# yum upgrade -y || echo "some packages in docker fail to install" +#fi + +set -xe +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +# THere is no std/ent packages for PG 9.5 +if [[ ${PG_VERSION} == '9.5' ]] && [[ ${PBK_EDITION} != '' ]] ; then + exit 0 +fi + +# PACKAGES NEEDED +yum install -y git wget bzip2 rpm-build + +mkdir /root/build +cd /root/build +rpm --rebuilddb && yum clean all + +# Copy rpmbuild +cp -rv /app/in/packaging/specs/rpm/rpmbuild /root/ + +# download pbk +git clone $PKG_URL pg_probackup-${PKG_VERSION} +cd pg_probackup-${PKG_VERSION} +git checkout ${PKG_HASH} + +# move it to source +cd /root/build +if [[ ${PBK_EDITION} == '' ]] ; then + tar -cjf pg_probackup-${PKG_VERSION}.tar.bz2 pg_probackup-${PKG_VERSION} + mv pg_probackup-${PKG_VERSION}.tar.bz2 /root/rpmbuild/SOURCES + rm -rf pg_probackup-${PKG_VERSION} +else + mv pg_probackup-${PKG_VERSION} /root/rpmbuild/SOURCES +fi + +if [[ ${PBK_EDITION} == '' ]] ; then + cd /root/rpmbuild/SOURCES/ + sed -i "s/@PG_VERSION@/${PKG_VERSION}/" pg_probackup.repo + + # Download PostgreSQL source + wget http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 -O /root/rpmbuild/SOURCES/postgresql-${PG_VERSION}.tar.bz2 + + # change to build dir + cd /root/rpmbuild/SOURCES + sed -i "s/@DISTRIB@/${DISTRIB}/" pg_probackup.repo + if [ $DISTRIB == 'centos' ] + then sed -i "s/@SHORT_CODENAME@/Centos/" pg_probackup.repo + elif [ $DISTRIB == 'rhel' ] + then sed -i "s/@SHORT_CODENAME@/RedHat/" pg_probackup.repo + elif [ $DISTRIB == 'oraclelinux' ] + then sed -i "s/@SHORT_CODENAME@/Oracle/" pg_probackup.repo + fi +else +# cp /app/tarballs/postgrespro-${EDITION}-${PG_FULL_VERSION}.tar.bz2 /root/rpmbuild/SOURCES/ +# cp /app/in/packaging/tarballs/pgpro.tar.bz2 + tar -xf /app/in/packaging/tarballs/pgpro.tar.bz2 -C /root/rpmbuild/SOURCES/ + cd /root/rpmbuild/SOURCES/pgpro + + PGPRO_TOC=$(echo ${PG_FULL_VERSION} | sed 's|\.|_|g') + if [[ ${PBK_EDITION} == 'std' ]] ; then + git checkout "PGPRO${PGPRO_TOC}_1" + else + git checkout "PGPROEE${PGPRO_TOC}_1" + fi + rm -rf .git + + cd /root/rpmbuild/SOURCES/ + mv pgpro postgrespro-${PBK_EDITION}-${PG_FULL_VERSION} + chown -R root:root postgrespro-${PBK_EDITION}-${PG_FULL_VERSION} + +# tar -cjf postgrespro-${PBK_EDITION}-${PG_FULL_VERSION}.tar.bz2 postgrespro-${PBK_EDITION}-${PG_FULL_VERSION} +fi + +cd /root/rpmbuild/SPECS +if [[ ${PBK_EDITION} == '' ]] ; then + sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup.spec + sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup.spec + sed -i "s/@PKG_HASH@/${PKG_HASH}/" pg_probackup.spec + sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup.spec + sed -i "s/@PG_FULL_VERSION@/${PG_FULL_VERSION}/" pg_probackup.spec + + sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup-repo.spec + sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup-repo.spec + sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup-repo.spec +else + sed -i "s/@EDITION@/${PBK_EDITION}/" pg_probackup-pgpro.spec + sed -i "s/@EDITION_FULL@/${PBK_EDITION_FULL}/" pg_probackup-pgpro.spec + sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup-pgpro.spec + sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup-pgpro.spec + sed -i "s/@PKG_HASH@/${PKG_HASH}/" pg_probackup-pgpro.spec + sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup-pgpro.spec + sed -i "s/@PG_FULL_VERSION@/${PG_FULL_VERSION}/" pg_probackup-pgpro.spec + + if [ ${PG_VERSION} != '9.6' ]; then + sed -i "s|@PREFIX@|/opt/pgpro/${EDITION}-${PG_VERSION}|g" pg_probackup-pgpro.spec + fi +fi + +if [[ ${PBK_EDITION} == '' ]] ; then + + # install dependencies + yum-builddep -y pg_probackup.spec + + # build pg_probackup + rpmbuild -bs pg_probackup.spec + rpmbuild -ba pg_probackup.spec #2>&1 | tee -ai /app/out/build.log + + # build repo files + rpmbuild -bs pg_probackup-repo.spec + rpmbuild -ba pg_probackup-repo.spec + + # write artefacts to out directory + rm -rf /app/out/* + cp -arv /root/rpmbuild/{RPMS,SRPMS} /app/out +else + # install dependencies + yum-builddep -y pg_probackup-pgpro.spec + # build pg_probackup + rpmbuild -ba pg_probackup-pgpro.spec #2>&1 | tee -ai /app/out/build.log + + # write artefacts to out directory + rm -rf /app/out/* + cp -arv /root/rpmbuild/RPMS /app/out +fi diff --git a/packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP b/packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP new file mode 100644 index 000000000..c11d9c015 --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQINBFpy9DABEADd44hR3o4i4DrUephrr7iHPHcRH0Zego3A36NdOf0ymP94H8Bi +U8C6YyKFbltShh18IC3QZJK04hLRQEs6sPKC2XHwlz+Tndi49Z45pfV54xEVKmBS +IZ5AM9y1FxwQAOzu6pZGu32DWDXZzhI7nLuY8rqAMMuzKeRcGm3sQ6ZcAwYOLT+e +ZAxkUL05MBGDaLc91HtKiurRlHuMySiVdkNu9ebTGV4zZv+ocBK8iC5rJjTJCv78 +eLkrRgjp7/MuLQ7mmiwfZx5lUIO9S87HDeH940mcYWRGUsdCbj0791wHY0PXlqhH +6lCLGur9/5yM88pGU79uahCblxsYdue6fdgIZR0hQBUxnLphI2SCshP89VDEwaP2 +dlC/qESJ3xyULkdJz67wlhOrIPC9T1d2pa5MUurOK0yTFH7j4JLWjBgU59h31ZEF +NMHde+Fwv+lL/yRht2Xz7HG5Rt8ogn4/rPBloXr1v83iN34aZnnqanyhSbE9xUhP +RNK3fBxXmX9IjFsBhRelPcv5NWNnxnnMkEfhoZvrAy+ykUGLP+J+Rj+d5v/8nAUc +taxqAXlUz1VabR0BVISBsRY+ket4O2dJ1WbZ8KXG6q/F9UMpS0v9aRdb1JyzrWCw +wT/l3q9x89i27SgDZgAfEFhvbMN6hUmFyVoMBgk8kqvi4b3lZZGCeuLX5wARAQAB +tCxQb3N0Z3JlU1FMIFByb2Zlc3Npb25hbCA8ZGJhQHBvc3RncmVzcHJvLnJ1PokC +OQQTAQIAIwUCWnL0MAIbAwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEKeJ +efZjbXF+zDUP/RfYxlq3erzP/cG6/LghZlJy6hGuUgyDFj2zUVAbpoFhqCAmaNLc ++bBYMCyNRhS8/oXushCSxUV8D7LRIRIRdtbNAnd4MNl6U4ORF6JcdPPNLROzwMik +3TmIVACMdjb9IRF5+8jVrIgDPI/FVtf5qp0Ot6OBtpD5oWQ7ubZ31RPR3pacdujK +jlbzL5Y6HsonhMbSJU/d0d9DylMvX4Gcxdw7M2Pfe3E6mjPJmcHiKuCKln2eLOsg +53HA/RWKy+uYDo+vdefUsQCIdnC5VghnXG8FTuvVqeqiSeU2XdyuzjndqxKZNrMw +YK1POK7R55R1aKJaOKEwnfd5oN02p77U+R/vb/mDcfZWbXI8JrHwPKVOQiEl0S+G +ePPW57EmX9yFuWAzcOPp9yCt/+roVry1ICifrFaLOhtT+/vle0j3+rbn31BMPsjf +QbREVetHfWB0N78k/hKC8SivDdrXsdqovcGgSAjFzPEdznvx9vKopwz2CQ6DK25Q +3M4j79Akcaa08k5Wphyx48PbhzSeE/d4xVzey7ge0BwYMdNGXKeyBjT6h9e+iySE +UTZ3/3c7O1D8p2EfPUMT/aI5fWlLBXlT5fDp2yX0HMTt/NUIXAiTHb5BDnZ+4ld3 +KXjHw4WzaOfHBfGDjJDtHPgdTEJTsQbH8//D+wwU3ueNS1ho4DpLqc+YuQINBFpy +9DABEADJMkgQ2m4g4LX7FNnmQbRgDcuhL8Y0VRGST+5x6xvb2em1boQHUaTt7/3z +DnaIRrZqrFP09O6xblSjEu9FZE+JuQGNyC4TH9fjvKnkRlqTF6X87nRVGByRmrdL +lPp9XPJY2Mc7c0PisncI/j7d9PmUHOSmaWeLG/WqMbzZA+s1IWjC0tqIN2k5ivTN +PfRm+9ebEHMUN+D7yZQMBlCmFexwy6h5pAioyj4tAOHqxfNDE33qezaeBn/E1BpW +NyegKwNtPUL0t2kXTO5tspKKCcny4HJ7K60gak0fWp42qVygwSPR54ztFM+6XjCh +0MmZ/mAdzLd6OJiP8RfMCfXbXpK4793+Cw0AK3Mu+mnJ26kz1KEZ9DKiAEhBhK3r +Z3/isUc8LcVYLHIduH9b/K50FjgR0T1Lm4r6Hpf6nTROlfiFSMXJU0HepAzMPHRq +EWqTJ49UgI7Llf+aBP7fGLqRPvWJpAJaQkMiUxfP5JYYCb+45d7I54iXQCD6ToK1 +bDnh+zZIrwyUIxPfFQh1xPYyFWRELJpeOFzm+espqiVFPXpBoimVlytwNrGdbxbY +SO0eEVlE41AjD8cgk+ibAvt/moT2+Mps/t083LR+J92kj+iX/D4NHVy4CjJTrhwO +rI3FrxtdU+NFXULyj0KslOKuyG5WuHLQvfL5P3JGuTkP4iJOTQARAQABiQIfBBgB +AgAJBQJacvQwAhsMAAoJEKeJefZjbXF+8JgQAJqlO1ftIsJvZ/+4ZVVOTPx5ZmYs +ABp4/2gaiLdhajN8ynbZqtCyjtQwSCLJFf2CcDL8XUooJzdQECkqdiI7ouYSFBzO +ui3jjCuFz5oHv88OtX2cIRxHqlZQmXEHvk0gH61xDV5CWBJmjxdRcsC7n1I8DSVg +Qmuq06S+xIX6rHf2CRxYKahBip71u7OIH4BRV44y26xf1a8an+8BkqF9+mYt7zqO +vyMCJ1UftXcuE5SxY54jnNAavF7Kq/2Yp7v3aYqFREngxtbWudyo7QW5EuToSvY2 +qY6tpInahWjuXxeARsFzp4fB0Eo/yH+iqG30zkQCuxLyxzbMMcNQP4if3yV6uO14 +LqapZLrMp6IMTfHDKmbbtDQ2RpRRut3K4khXRQ1LjGKziOU4ZCEazrXEijm2AlKw +7JS3POGvM+VAiaGNBqfdHpTwXXT7zkxJjfJC3Et/6fHy1xuCtUtMs41PjHS/HWi8 +w70T8XpKub+ewVElxq2D83rx07w3HuBtVUyqG0XgcACwqQA1vMLJaR3VoX1024ho +sf2PtZqQ7SCgt0hkZAT72j05nz4bIxUIcDkAGtd9FDPQ4Ixi6fRfTJpZ7lIEV5as +Zs9C0hrxmWgJwSGgQa2Waylvw47fMwfMn+gUNRqwanyOjVYfpSJafLc6Ol43bQN/ +jCKs4enncezhjcAh +=TVZj +-----END PGP PUBLIC KEY BLOCK----- \ No newline at end of file diff --git a/packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS b/packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS new file mode 100644 index 000000000..c11d9c015 --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQINBFpy9DABEADd44hR3o4i4DrUephrr7iHPHcRH0Zego3A36NdOf0ymP94H8Bi +U8C6YyKFbltShh18IC3QZJK04hLRQEs6sPKC2XHwlz+Tndi49Z45pfV54xEVKmBS +IZ5AM9y1FxwQAOzu6pZGu32DWDXZzhI7nLuY8rqAMMuzKeRcGm3sQ6ZcAwYOLT+e +ZAxkUL05MBGDaLc91HtKiurRlHuMySiVdkNu9ebTGV4zZv+ocBK8iC5rJjTJCv78 +eLkrRgjp7/MuLQ7mmiwfZx5lUIO9S87HDeH940mcYWRGUsdCbj0791wHY0PXlqhH +6lCLGur9/5yM88pGU79uahCblxsYdue6fdgIZR0hQBUxnLphI2SCshP89VDEwaP2 +dlC/qESJ3xyULkdJz67wlhOrIPC9T1d2pa5MUurOK0yTFH7j4JLWjBgU59h31ZEF +NMHde+Fwv+lL/yRht2Xz7HG5Rt8ogn4/rPBloXr1v83iN34aZnnqanyhSbE9xUhP +RNK3fBxXmX9IjFsBhRelPcv5NWNnxnnMkEfhoZvrAy+ykUGLP+J+Rj+d5v/8nAUc +taxqAXlUz1VabR0BVISBsRY+ket4O2dJ1WbZ8KXG6q/F9UMpS0v9aRdb1JyzrWCw +wT/l3q9x89i27SgDZgAfEFhvbMN6hUmFyVoMBgk8kqvi4b3lZZGCeuLX5wARAQAB +tCxQb3N0Z3JlU1FMIFByb2Zlc3Npb25hbCA8ZGJhQHBvc3RncmVzcHJvLnJ1PokC +OQQTAQIAIwUCWnL0MAIbAwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEKeJ +efZjbXF+zDUP/RfYxlq3erzP/cG6/LghZlJy6hGuUgyDFj2zUVAbpoFhqCAmaNLc ++bBYMCyNRhS8/oXushCSxUV8D7LRIRIRdtbNAnd4MNl6U4ORF6JcdPPNLROzwMik +3TmIVACMdjb9IRF5+8jVrIgDPI/FVtf5qp0Ot6OBtpD5oWQ7ubZ31RPR3pacdujK +jlbzL5Y6HsonhMbSJU/d0d9DylMvX4Gcxdw7M2Pfe3E6mjPJmcHiKuCKln2eLOsg +53HA/RWKy+uYDo+vdefUsQCIdnC5VghnXG8FTuvVqeqiSeU2XdyuzjndqxKZNrMw +YK1POK7R55R1aKJaOKEwnfd5oN02p77U+R/vb/mDcfZWbXI8JrHwPKVOQiEl0S+G +ePPW57EmX9yFuWAzcOPp9yCt/+roVry1ICifrFaLOhtT+/vle0j3+rbn31BMPsjf +QbREVetHfWB0N78k/hKC8SivDdrXsdqovcGgSAjFzPEdznvx9vKopwz2CQ6DK25Q +3M4j79Akcaa08k5Wphyx48PbhzSeE/d4xVzey7ge0BwYMdNGXKeyBjT6h9e+iySE +UTZ3/3c7O1D8p2EfPUMT/aI5fWlLBXlT5fDp2yX0HMTt/NUIXAiTHb5BDnZ+4ld3 +KXjHw4WzaOfHBfGDjJDtHPgdTEJTsQbH8//D+wwU3ueNS1ho4DpLqc+YuQINBFpy +9DABEADJMkgQ2m4g4LX7FNnmQbRgDcuhL8Y0VRGST+5x6xvb2em1boQHUaTt7/3z +DnaIRrZqrFP09O6xblSjEu9FZE+JuQGNyC4TH9fjvKnkRlqTF6X87nRVGByRmrdL +lPp9XPJY2Mc7c0PisncI/j7d9PmUHOSmaWeLG/WqMbzZA+s1IWjC0tqIN2k5ivTN +PfRm+9ebEHMUN+D7yZQMBlCmFexwy6h5pAioyj4tAOHqxfNDE33qezaeBn/E1BpW +NyegKwNtPUL0t2kXTO5tspKKCcny4HJ7K60gak0fWp42qVygwSPR54ztFM+6XjCh +0MmZ/mAdzLd6OJiP8RfMCfXbXpK4793+Cw0AK3Mu+mnJ26kz1KEZ9DKiAEhBhK3r +Z3/isUc8LcVYLHIduH9b/K50FjgR0T1Lm4r6Hpf6nTROlfiFSMXJU0HepAzMPHRq +EWqTJ49UgI7Llf+aBP7fGLqRPvWJpAJaQkMiUxfP5JYYCb+45d7I54iXQCD6ToK1 +bDnh+zZIrwyUIxPfFQh1xPYyFWRELJpeOFzm+espqiVFPXpBoimVlytwNrGdbxbY +SO0eEVlE41AjD8cgk+ibAvt/moT2+Mps/t083LR+J92kj+iX/D4NHVy4CjJTrhwO +rI3FrxtdU+NFXULyj0KslOKuyG5WuHLQvfL5P3JGuTkP4iJOTQARAQABiQIfBBgB +AgAJBQJacvQwAhsMAAoJEKeJefZjbXF+8JgQAJqlO1ftIsJvZ/+4ZVVOTPx5ZmYs +ABp4/2gaiLdhajN8ynbZqtCyjtQwSCLJFf2CcDL8XUooJzdQECkqdiI7ouYSFBzO +ui3jjCuFz5oHv88OtX2cIRxHqlZQmXEHvk0gH61xDV5CWBJmjxdRcsC7n1I8DSVg +Qmuq06S+xIX6rHf2CRxYKahBip71u7OIH4BRV44y26xf1a8an+8BkqF9+mYt7zqO +vyMCJ1UftXcuE5SxY54jnNAavF7Kq/2Yp7v3aYqFREngxtbWudyo7QW5EuToSvY2 +qY6tpInahWjuXxeARsFzp4fB0Eo/yH+iqG30zkQCuxLyxzbMMcNQP4if3yV6uO14 +LqapZLrMp6IMTfHDKmbbtDQ2RpRRut3K4khXRQ1LjGKziOU4ZCEazrXEijm2AlKw +7JS3POGvM+VAiaGNBqfdHpTwXXT7zkxJjfJC3Et/6fHy1xuCtUtMs41PjHS/HWi8 +w70T8XpKub+ewVElxq2D83rx07w3HuBtVUyqG0XgcACwqQA1vMLJaR3VoX1024ho +sf2PtZqQ7SCgt0hkZAT72j05nz4bIxUIcDkAGtd9FDPQ4Ixi6fRfTJpZ7lIEV5as +Zs9C0hrxmWgJwSGgQa2Waylvw47fMwfMn+gUNRqwanyOjVYfpSJafLc6Ol43bQN/ +jCKs4enncezhjcAh +=TVZj +-----END PGP PUBLIC KEY BLOCK----- \ No newline at end of file diff --git a/packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo b/packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo new file mode 100644 index 000000000..fcef58a9c --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo @@ -0,0 +1,6 @@ +[pg_probackup-forks] +name=PG_PROBACKUP @SHORT_CODENAME@ packages for PostgresPro Standart and Enterprise - $basearch +baseurl=https://repo.postgrespro.ru/pg_probackup-forks/rpm/latest/@DISTRIB@-$releasever-$basearch +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-PG_PROBACKUP diff --git a/packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo b/packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo new file mode 100644 index 000000000..33dc31a24 --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo @@ -0,0 +1,13 @@ +[pg_probackup] +name=PG_PROBACKUP Packages for @SHORT_CODENAME@ Linux - $basearch +baseurl=https://repo.postgrespro.ru/pg_probackup/rpm/latest/@DISTRIB@-$releasever-$basearch +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-PG_PROBACKUP + +[pg_probackup-sources] +name=PG_PROBACKUP Source Packages for @SHORT_CODENAME@ Linux - $basearch +baseurl=https://repo.postgrespro.ru/pg_probackup/srpm/latest/@DISTRIB@-$releasever-$basearch +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-PG_PROBACKUP diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec new file mode 100644 index 000000000..a0ec9580b --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec @@ -0,0 +1,72 @@ +%global version @PKG_VERSION@ +%global release @PKG_RELEASE@ +%global hash @PKG_HASH@ +%global pgsql_major @PG_VERSION@ +%global pgsql_full @PG_FULL_VERSION@ +%global edition @EDITION@ +%global edition_full @EDITION_FULL@ +%global prefix @PREFIX@ + +Name: pg_probackup-%{edition}-%{pgsql_major} +Version: %{version} +Release: %{release}.%{hash} +Summary: Backup utility for PostgresPro %{edition_full} +Group: Applications/Databases +License: BSD +Url: http://postgrespro.ru/ +#Source0: postgrespro-%{edition}-%{pgsql_full}.tar.bz2 +#Source1: pg_probackup-%{version}.tar.bz2 +Source0: postgrespro-%{edition}-%{pgsql_full} +Source1: pg_probackup-%{version} +BuildRequires: gcc make perl glibc-devel bison flex +BuildRequires: readline-devel openssl-devel gettext zlib-devel + + +%description +Backup tool for PostgresPro %{edition_full}. + +%prep +#%setup -q -b1 -n pg_probackup-%{version}.tar.bz2 +#cd %{_topdir}/BUILD +mv %{_topdir}/SOURCES/postgrespro-%{edition}-%{pgsql_full} %{_topdir}/BUILD +cd %{_topdir}/BUILD/postgrespro-%{edition}-%{pgsql_full} +mv %{_topdir}/SOURCES/pg_probackup-%{version} contrib/pg_probackup + +mkdir %{_topdir}/SOURCES/postgrespro-%{edition}-%{pgsql_full} +mkdir %{_topdir}/SOURCES/pg_probackup-%{version} + +%build +#cd %{_topdir}/SOURCES/postgrespro-%{edition}-%{pgsql_full} +#mv %{_topdir}/SOURCES/postgrespro-%{edition}-%{pgsql_full} ./ +#cd postgrespro-%{edition}-%{pgsql_full} +#mv %{_topdir}/SOURCES/pg_probackup-%{version} contrib/pg_probackup +cd %{_topdir}/BUILD/postgrespro-%{edition}-%{pgsql_full} + +%if "%{pgsql_major}" == "9.6" +./configure --enable-debug +%else +./configure --enable-debug --prefix=%{prefix} +%endif +make -C 'src/common' +make -C 'src/port' +make -C 'src/interfaces' +cd contrib/pg_probackup && make + +%install +cd %{_topdir}/BUILD/postgrespro-%{edition}-%{pgsql_full} +%{__mkdir} -p %{buildroot}%{_bindir} +%{__install} -p -m 755 contrib/pg_probackup/pg_probackup %{buildroot}%{_bindir}/%{name} + +%files +%{_bindir}/%{name} + +%clean +rm -rf $RPM_BUILD_ROOT + + +%changelog +* Wed Feb 9 2018 Grigory Smolkin - %{version}-%{release}.%{hash} +- @PKG_VERSION@ + +* Fri Jan 29 2018 Grigory Smolkin - 2.0.14-1 +- Initial release. diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec new file mode 100644 index 000000000..fd4a99f2c --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec @@ -0,0 +1,49 @@ +%global version @PKG_VERSION@ +%global release @PKG_RELEASE@ + +Summary: pg_probackup repo RPM +Name: pg_probackup-repo-forks +Version: %{version} +Release: %{release} +Group: Applications/Databases +License: BSD +Url: http://postgrespro.ru/ + +Source0: http://repo.postgrespro.ru/pg_probackup-forks/keys/GPG-KEY-PG_PROBACKUP +Source1: pg_probackup-forks.repo + +BuildArch: noarch + +%description +This package contains yum configuration for @SHORT_CODENAME@, and also the GPG key +for pg_probackup RPMs for PostgresPro Standart and Enterprise. + +%prep +%setup -q -c -T +install -pm 644 %{SOURCE0} . +install -pm 644 %{SOURCE1} . + +%build + +%install +rm -rf $RPM_BUILD_ROOT + +#GPG Key +install -Dpm 644 %{SOURCE0} \ + $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/GPG-KEY-PG_PROBACKUP + +# yum +install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d +install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%config(noreplace) /etc/yum.repos.d/* +/etc/pki/rpm-gpg/* + +%changelog +* Fri Oct 26 2019 Grigory Smolkin +- Initial package diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec new file mode 100644 index 000000000..6721003d0 --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec @@ -0,0 +1,59 @@ +%global pgsql_major @PG_VERSION@ +%global version @PKG_VERSION@ +%global release @PKG_RELEASE@ + +Summary: PG_PROBACKUP RPMs +Name: pg_probackup-repo +Version: %{version} +Release: %{release} +Group: Applications/Databases +License: BSD +Url: http://postgrespro.ru/ + +Source0: http://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP +Source1: pg_probackup.repo + +BuildArch: noarch + +%description +This package contains yum configuration for Centos, and also the GPG key for PG_PROBACKUP RPMs. + +%prep +%setup -q -c -T +install -pm 644 %{SOURCE0} . +install -pm 644 %{SOURCE1} . + +%build + +%install +rm -rf $RPM_BUILD_ROOT + +#GPG Key +install -Dpm 644 %{SOURCE0} \ + $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/GPG-KEY-PG_PROBACKUP + +# yum /etc/zypp/repos.d/repo-update.repo + +%if 0%{?suse_version} + install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d + install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d +%else + install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d + install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%if 0%{?suse_version} + %config(noreplace) /etc/zypp/repos.d/* +%else + %config(noreplace) /etc/yum.repos.d/* +%endif +/etc/pki/rpm-gpg/* + +%changelog +* Mon Jun 29 2020 Grigory Smolkin +- release update diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec new file mode 100644 index 000000000..d81c5e152 --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec @@ -0,0 +1,57 @@ +%global version @PKG_VERSION@ +%global release @PKG_RELEASE@ +%global hash @PKG_HASH@ +%global pgsql_major @PG_VERSION@ +%global pgsql_full @PG_FULL_VERSION@ +%global edition @EDITION@ +%global edition_full @EDITION_FULL@ +%global prefix @PREFIX@ + +#%set_verify_elf_method unresolved=relaxed, rpath=relaxed +%set_verify_elf_method rpath=relaxed,unresolved=relaxed + +Name: pg_probackup-%{edition}-%{pgsql_major} +Version: %{version} +Release: %{release}.%{hash} +Summary: Backup utility for PostgresPro %{edition_full} +Group: Applications/Databases +License: BSD +Url: http://postgrespro.ru/ +Source0: postgrespro-%{edition}-%{pgsql_full}.tar.bz2 +Source1: pg_probackup-%{edition}-%{version}.tar.bz2 +BuildRequires: gcc make perl glibc-devel bison flex +BuildRequires: readline-devel openssl-devel gettext zlib-devel + + +%description +Backup tool for PostgresPro %{edition_full}. + +%prep +%setup -q -b1 -n postgrespro-%{edition}-%{pgsql_full} + +%build +mv %{_builddir}/pg_probackup-%{edition}-%{version} contrib/pg_probackup +%if "%{pgsql_major}" == "9.6" +./configure --enable-debug +%else +./configure --enable-debug --prefix=%{prefix} +%endif +make -C 'src/common' +make -C 'src/port' +make -C 'src/interfaces' +cd contrib/pg_probackup && make + +%install +%{__mkdir} -p %{buildroot}%{_bindir} +%{__install} -p -m 755 contrib/pg_probackup/pg_probackup %{buildroot}%{_bindir}/%{name} + +%files +%{_bindir}/%{name} + +%clean +rm -rf $RPM_BUILD_ROOT + + +%changelog +* Mon Nov 17 2019 Grigory Smolkin - 2.2.6-1 +- Initial release. diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec new file mode 100644 index 000000000..3a84635fc --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec @@ -0,0 +1,48 @@ +%global version @PKG_VERSION@ +%global release @PKG_RELEASE@ +%global hash @PKG_HASH@ +%global pgsql_major @PG_VERSION@ +%global pgsql_full @PG_FULL_VERSION@ +%set_verify_elf_method rpath=relaxed + +Name: pg_probackup-%{pgsql_major} +Version: %{version} +Release: %{release}.%{hash} +Summary: Backup utility for PostgreSQL +Group: Applications/Databases +License: BSD +Url: http://postgrespro.ru/ +Source0: http://ftp.postgresql.org/pub/source/v%{pgsql_full}/postgresql-%{pgsql_major}.tar.bz2 +Source1: pg_probackup-%{version}.tar.bz2 +BuildRequires: gcc make perl glibc-devel bison flex +BuildRequires: readline-devel openssl-devel gettext zlib-devel + + +%description +Backup tool for PostgreSQL. + +%prep +%setup -q -b1 -n postgresql-%{pgsql_full} + +%build +mv %{_builddir}/pg_probackup-%{version} contrib/pg_probackup +./configure --enable-debug +make -C 'src/common' +make -C 'src/port' +make -C 'src/interfaces' +cd contrib/pg_probackup && make + +%install +%{__mkdir} -p %{buildroot}%{_bindir} +%{__install} -p -m 755 contrib/pg_probackup/pg_probackup %{buildroot}%{_bindir}/%{name} + +%files +%{_bindir}/%{name} + +%clean +rm -rf $RPM_BUILD_ROOT + + +%changelog +* Mon Nov 17 2019 Grigory Smolkin - 2.2.6-1 +- Initial release. diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.spec b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.spec new file mode 100644 index 000000000..bf6e112ff --- /dev/null +++ b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.spec @@ -0,0 +1,48 @@ +%global version @PKG_VERSION@ +%global release @PKG_RELEASE@ +%global hash @PKG_HASH@ +%global pgsql_major @PG_VERSION@ +%global pgsql_full @PG_FULL_VERSION@ + +Name: pg_probackup-%{pgsql_major} +Version: %{version} +Release: %{release}.%{hash} +Summary: Backup utility for PostgreSQL +Group: Applications/Databases +License: BSD +Url: http://postgrespro.ru/ +Source0: http://ftp.postgresql.org/pub/source/v%{pgsql_full}/postgresql-%{pgsql_major}.tar.bz2 +Source1: pg_probackup-%{version}.tar.bz2 +BuildRequires: gcc make perl glibc-devel bison flex readline-devel openssl-devel gettext zlib-devel + +%description +Backup tool for PostgreSQL. + +%prep +%setup -q -b1 -n postgresql-%{pgsql_full} + +%build +mv %{_builddir}/pg_probackup-%{version} contrib/pg_probackup +./configure --enable-debug +make -C 'src/common' +make -C 'src/port' +make -C 'src/interfaces' +cd contrib/pg_probackup && make + +%install +%{__mkdir} -p %{buildroot}%{_bindir} +%{__install} -p -m 755 contrib/pg_probackup/pg_probackup %{buildroot}%{_bindir}/%{name} + +%files +%{_bindir}/%{name} + +%clean +rm -rf $RPM_BUILD_ROOT + + +%changelog +* Wed Feb 9 2018 Grigory Smolkin - %{version}-%{release}.%{hash} +- @PKG_VERSION@ + +* Fri Jan 29 2018 Grigory Smolkin - 2.0.14-1 +- Initial release. From 77a8a42454342a55af79d5f1c5d5006ec8b046cb Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Tue, 3 Aug 2021 01:30:22 +0300 Subject: [PATCH 03/54] [Issue #413] minor fixes --- packaging/Makefile.pkg | 216 ++++++++++++++++++----------------------- 1 file changed, 94 insertions(+), 122 deletions(-) diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index de46eda1c..1955187c7 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -66,7 +66,6 @@ prepare_builddir: build/all: build/centos @echo Packaging is done - ### DEBIAN build/debian: build/debian_8 build/debian_9 build/debian_10 @echo Debian: done @@ -96,9 +95,6 @@ build/ubuntu_18.04: build/ubuntu_18.04_9.5 build/ubuntu_18.04_9.6 build/ubuntu_1 build/ubuntu_20.04: build/ubuntu_20.04_9.5 build/ubuntu_20.04_9.6 build/ubuntu_20.04_10 build/ubuntu_20.04_11 build/ubuntu_20.04_12 build/ubuntu_20.04_13 @echo Ubuntu 20.04: done -#build/centos: build/centos_6 build/centos_7 build/rpm_repo_package_centos -# @echo Centos: done - define build_deb docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ @@ -115,10 +111,10 @@ include packaging/Makefile.debian include packaging/Makefile.ubuntu # CENTOS -build/centos: build/centos_6 #build/centos_7 build/centos_7 build/rpm_repo_package_centos +build/centos: build/centos_6 build/centos_7 build/centos_7 #build/rpm_repo_package_centos @echo Centos: done -build/centos_6: build/centos_6_9.5 build/centos_6_9.6 #build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 +build/centos_6: build/centos_6_9.5 build/centos_6_9.6 build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 @echo Centos 6: done build/centos_7: build/centos_7_9.5 build/centos_7_9.6 build/centos_7_10 build/centos_7_11 build/centos_7_12 build/centos_7_13 @@ -128,30 +124,30 @@ build/centos_8: build/centos_8_9.5 build/centos_8_9.6 build/centos_8_10 build/ce @echo Centos 8: done # Oracle Linux -build/oraclelinux: build/oraclelinux_6 build/oraclelinux_7 build/oraclelinux_7 build/rpm_repo_package_oraclelinux - @echo Oraclelinux: done - -build/oraclelinux_6: build/oraclelinux_6_9.5 build/oraclelinux_6_9.6 build/oraclelinux_6_10 build/oraclelinux_6_11 build/oraclelinux_6_12 build/oraclelinux_6_13 - @echo Oraclelinux 6: done - -build/oraclelinux_7: build/oraclelinux_7_9.5 build/oraclelinux_7_9.6 build/oraclelinux_7_10 build/oraclelinux_7_11 build/oraclelinux_7_12 build/oraclelinux_7_13 - @echo Oraclelinux 7: done - -build/oraclelinux_8: build/oraclelinux_8_9.5 build/oraclelinux_8_9.6 build/oraclelinux_8_10 build/oraclelinux_8_11 build/oraclelinux_8_12 build/oraclelinux_8_13 - @echo Oraclelinux 8: done - -# RHEL -build/rhel: build/rhel_6 build/rhel_7 build/rhel_8 build/rpm_repo_package_rhel - @echo Rhel: done - -build/rhel_6: build/rhel_6_9.5 build/rhel_6_9.6 build/rhel_6_10 build/rhel_6_11 build/rhel_6_12 build/rhel_6_13 - @echo Rhel 6: done - -build/rhel_7: build/rhel_7_9.5 build/rhel_7_9.6 build/rhel_7_10 build/rhel_7_11 build/rhel_7_12 build/rhel_7_13 - @echo Rhel 7: done - -build/rhel_8: build/rhel_8_9.5 build/rhel_8_9.6 build/rhel_8_10 build/rhel_8_11 build/rhel_8_12 build/rhel_8_13 - @echo Rhel 8: done +#build/oraclelinux: build/oraclelinux_6 build/oraclelinux_7 build/oraclelinux_7 #build/rpm_repo_package_oraclelinux +# @echo Oraclelinux: done +# +#build/oraclelinux_6: build/oraclelinux_6_9.5 build/oraclelinux_6_9.6 build/oraclelinux_6_10 build/oraclelinux_6_11 build/oraclelinux_6_12 build/oraclelinux_6_13 +# @echo Oraclelinux 6: done +# +#build/oraclelinux_7: build/oraclelinux_7_9.5 build/oraclelinux_7_9.6 build/oraclelinux_7_10 build/oraclelinux_7_11 build/oraclelinux_7_12 build/oraclelinux_7_13 +# @echo Oraclelinux 7: done +# +#build/oraclelinux_8: build/oraclelinux_8_9.5 build/oraclelinux_8_9.6 build/oraclelinux_8_10 build/oraclelinux_8_11 build/oraclelinux_8_12 build/oraclelinux_8_13 +# @echo Oraclelinux 8: done +# +## RHEL +#build/rhel: build/rhel_6 build/rhel_7 build/rhel_8 #build/rpm_repo_package_rhel +# @echo Rhel: done +# +#build/rhel_6: build/rhel_6_9.5 build/rhel_6_9.6 build/rhel_6_10 build/rhel_6_11 build/rhel_6_12 build/rhel_6_13 +# @echo Rhel 6: done +# +#build/rhel_7: build/rhel_7_9.5 build/rhel_7_9.6 build/rhel_7_10 build/rhel_7_11 build/rhel_7_12 build/rhel_7_13 +# @echo Rhel 7: done +# +#build/rhel_8: build/rhel_8_9.5 build/rhel_8_9.6 build/rhel_8_10 build/rhel_8_11 build/rhel_8_12 build/rhel_8_13 +# @echo Rhel 8: done define build_rpm @@ -181,99 +177,75 @@ include packaging/Makefile.centos # touch build/rpm_repo_package_centos # -#build/ubuntu_14_04: -# $(call build_deb,ubuntu,14.04,trusty) -# touch build/ubuntu_14_04 +#repo/all: repo/debian repo/ubuntu repo/centos repo/finish +# @echo Build repo for all platform: done +# touch build/repo_all # -#build/ubuntu_16_04: -# $(call build_deb,ubuntu,16.04,xenial) -# touch build/ubuntu_16_04 +#repo/debian: repo/debian_8 repo/debian_9 repo/debian_10 +# @echo Build repo for debian platforms: done +# touch build/repo_debian # -#build/ubuntu_18_04: -# $(call build_deb,ubuntu,18.04,bionic) -# touch build/ubuntu_18_04 +#repo/ubuntu: repo/ubuntu_16_04 repo/ubuntu_18_04 +# @echo Build repo for ubuntu platforms: done +# touch build/repo_ubuntu # -#build/centos_6: -# $(call build_rpm,centos,6) -# touch build/centos_6 +#repo/centos: repo/centos_6 repo/centos_7 +# @echo Build repo for centos platforms: done +# touch build/repo_centos # -#build/centos_7: -# $(call build_rpm,centos,7) -# touch build/centos_7 - -#build/centos_8: -# $(call build_rpm,centos,8) -# touch build/centos_8 - -repo/all: repo/debian repo/ubuntu repo/centos repo/finish - @echo Build repo for all platform: done - touch build/repo_all - -repo/debian: repo/debian_8 repo/debian_9 repo/debian_10 - @echo Build repo for debian platforms: done - touch build/repo_debian - -repo/ubuntu: repo/ubuntu_16_04 repo/ubuntu_18_04 - @echo Build repo for ubuntu platforms: done - touch build/repo_ubuntu - -repo/centos: repo/centos_6 repo/centos_7 - @echo Build repo for centos platforms: done - touch build/repo_centos - -repo/centos_6: - $(call build_repo_rpm,centos,6,6) - touch build/repo_centos_6 - -repo/centos_7: - $(call build_repo_rpm,centos,7,7) - touch build/repo_centos_7 - -repo/debian_8: - $(call build_repo_deb,debian,8,jessie) - touch build/repo_debian_8 - -repo/debian_9: - $(call build_repo_deb,debian,9,stretch) - touch build/repo_debian_9 - -repo/debian_10: - $(call build_repo_deb,debian,10,buster) - touch build/repo_debian_10 - -repo/ubuntu_14_04: - $(call build_repo_deb,ubuntu,14.04,trusty) - touch build/repo_ubuntu_14_04 - -repo/ubuntu_16_04: - $(call build_repo_deb,ubuntu,16.04,xenial) - touch build/repo_ubuntu_16_04 - -repo/ubuntu_18_04: - $(call build_repo_deb,ubuntu,18.04,bionic) - touch build/repo_ubuntu_18_04 - -repo/finish: - $(call repo_finish,centos,7) - touch build/repo_finish - -define build_repo_deb - docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \ - -v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \ - -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ - --rm $1:$2 /app/repo/scripts/deb.sh -endef - -define build_repo_rpm - docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \ - -v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \ - -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ - --rm $1:$2 /app/repo/scripts/rpm.sh -endef - -define repo_finish - docker run -v $(WORKDIR)/build/pkg/keys:/app/in -v $(WORKDIR)/build/www:/app/www \ - -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ - --rm $1:$2 bash -exc "cp -av /app/in/*rpm /app/www/mamonsu/keys && cd /app/www/mamonsu/ && \ - ln -s $(VERSION) latest" -endef +#repo/centos_6: +# $(call build_repo_rpm,centos,6,6) +# touch build/repo_centos_6 +# +#repo/centos_7: +# $(call build_repo_rpm,centos,7,7) +# touch build/repo_centos_7 +# +#repo/debian_8: +# $(call build_repo_deb,debian,8,jessie) +# touch build/repo_debian_8 +# +#repo/debian_9: +# $(call build_repo_deb,debian,9,stretch) +# touch build/repo_debian_9 +# +#repo/debian_10: +# $(call build_repo_deb,debian,10,buster) +# touch build/repo_debian_10 +# +#repo/ubuntu_14_04: +# $(call build_repo_deb,ubuntu,14.04,trusty) +# touch build/repo_ubuntu_14_04 +# +#repo/ubuntu_16_04: +# $(call build_repo_deb,ubuntu,16.04,xenial) +# touch build/repo_ubuntu_16_04 +# +#repo/ubuntu_18_04: +# $(call build_repo_deb,ubuntu,18.04,bionic) +# touch build/repo_ubuntu_18_04 + +#repo/finish: +# $(call repo_finish,centos,7) +# touch build/repo_finish + +#define build_repo_deb +# docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \ +# -v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \ +# -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ +# --rm $1:$2 /app/repo/scripts/deb.sh +#endef +# +#define build_repo_rpm +# docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \ +# -v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \ +# -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ +# --rm $1:$2 /app/repo/scripts/rpm.sh +#endef +# +#define repo_finish +# docker run -v $(WORKDIR)/build/pkg/keys:/app/in -v $(WORKDIR)/build/www:/app/www \ +# -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ +# --rm $1:$2 bash -exc "cp -av /app/in/*rpm /app/www/mamonsu/keys && cd /app/www/mamonsu/ && \ +# ln -s $(VERSION) latest" +#endef From 0d50b5dccf5f0093d0b7b7621ce0a5a3282dec29 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Tue, 3 Aug 2021 14:53:38 +0300 Subject: [PATCH 04/54] [Issue #413] packaging for Alt Linux --- packaging/Makefile.alt | 24 ++++ packaging/Makefile.pkg | 94 ++++++++----- packaging/scripts/alt.sh | 123 ++++++++++++++++++ .../rpmbuild/SPECS/pg_probackup-pgpro.spec | 1 - .../SPECS/pg_probackup.alt.forks.spec | 18 ++- 5 files changed, 219 insertions(+), 41 deletions(-) create mode 100644 packaging/Makefile.alt create mode 100755 packaging/scripts/alt.sh diff --git a/packaging/Makefile.alt b/packaging/Makefile.alt new file mode 100644 index 000000000..c5f7441eb --- /dev/null +++ b/packaging/Makefile.alt @@ -0,0 +1,24 @@ +# ALT 7 +build/alt_7_9.5: + $(call build_alt,alt,7,,9.5,9.5.25) + touch build/alt_7_9.5 + +build/alt_7_9.6: + $(call build_alt,alt,7,,9.6,9.6.21) + touch build/alt_7_9.6 + +build/alt_7_10: + $(call build_alt,alt,7,,10,10.17) + touch build/alt_7_10 + +build/alt_7_11: + $(call build_alt,alt,7,,11,11.11) + touch build/alt_7_11 + +build/alt_7_12: + $(call build_alt,alt,7,,12,12.6) + touch build/alt_7_12 + +build/alt_7_13: + $(call build_alt,alt,7,,13,13.2) + touch build/alt_7_13 diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 1955187c7..cbdb2891f 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -42,10 +42,6 @@ prepare_builddir: fi mkdir -p $(BUILDDIR) -#deb: prepare_builddir -# cd $(BUILDDIR) && cp -a $(WORKDIR)/packaging/debian . && dpkg-buildpackage -b -# cp -av build/mamonsu*.deb . - #rpm: prepare_builddir $(BUILDDIR)/packaging/rpm/SPECS/$(SPEC) # mkdir -p $(BUILDDIR)/packaging/rpm/RPMS $(BUILDDIR)/packaging/rpm/BUILD $(BUILDDIR)/packaging/rpm/SRPMS # rpmbuild -ba --define '_topdir $(BUILDDIR)/packaging/rpm'\ @@ -60,10 +56,10 @@ prepare_builddir: # @echo Build for all platform: done # touch build/all -#build/all: build/debian build/ubuntu +#build/all: build/debian build/ubuntu build/centos # @echo Packaging is done -build/all: build/centos +build/all: build/alt @echo Packaging is done ### DEBIAN @@ -98,13 +94,13 @@ build/ubuntu_20.04: build/ubuntu_20.04_9.5 build/ubuntu_20.04_9.6 build/ubuntu_2 define build_deb docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ - -v "$(WORKDIR)":/app/in \ - -v $(WORKDIR)/build/data/$1/$2/$(PBK_PKG_REPO)/pg-probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ + -v $(WORKDIR)/packaging:/app/in \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg-probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ - --rm pgpro/$1:$2 /app/in/packaging/scripts/deb.sh + --rm pgpro/$1:$2 /app/in/scripts/deb.sh endef include packaging/Makefile.debian @@ -124,46 +120,72 @@ build/centos_8: build/centos_8_9.5 build/centos_8_9.6 build/centos_8_10 build/ce @echo Centos 8: done # Oracle Linux -#build/oraclelinux: build/oraclelinux_6 build/oraclelinux_7 build/oraclelinux_7 #build/rpm_repo_package_oraclelinux -# @echo Oraclelinux: done -# -#build/oraclelinux_6: build/oraclelinux_6_9.5 build/oraclelinux_6_9.6 build/oraclelinux_6_10 build/oraclelinux_6_11 build/oraclelinux_6_12 build/oraclelinux_6_13 -# @echo Oraclelinux 6: done -# -#build/oraclelinux_7: build/oraclelinux_7_9.5 build/oraclelinux_7_9.6 build/oraclelinux_7_10 build/oraclelinux_7_11 build/oraclelinux_7_12 build/oraclelinux_7_13 -# @echo Oraclelinux 7: done -# -#build/oraclelinux_8: build/oraclelinux_8_9.5 build/oraclelinux_8_9.6 build/oraclelinux_8_10 build/oraclelinux_8_11 build/oraclelinux_8_12 build/oraclelinux_8_13 -# @echo Oraclelinux 8: done -# -## RHEL -#build/rhel: build/rhel_6 build/rhel_7 build/rhel_8 #build/rpm_repo_package_rhel -# @echo Rhel: done -# -#build/rhel_6: build/rhel_6_9.5 build/rhel_6_9.6 build/rhel_6_10 build/rhel_6_11 build/rhel_6_12 build/rhel_6_13 -# @echo Rhel 6: done -# -#build/rhel_7: build/rhel_7_9.5 build/rhel_7_9.6 build/rhel_7_10 build/rhel_7_11 build/rhel_7_12 build/rhel_7_13 -# @echo Rhel 7: done -# -#build/rhel_8: build/rhel_8_9.5 build/rhel_8_9.6 build/rhel_8_10 build/rhel_8_11 build/rhel_8_12 build/rhel_8_13 -# @echo Rhel 8: done +build/oraclelinux: build/oraclelinux_6 build/oraclelinux_7 build/oraclelinux_7 #build/rpm_repo_package_oraclelinux + @echo Oraclelinux: done + +build/oraclelinux_6: build/oraclelinux_6_9.5 build/oraclelinux_6_9.6 build/oraclelinux_6_10 build/oraclelinux_6_11 build/oraclelinux_6_12 build/oraclelinux_6_13 + @echo Oraclelinux 6: done + +build/oraclelinux_7: build/oraclelinux_7_9.5 build/oraclelinux_7_9.6 build/oraclelinux_7_10 build/oraclelinux_7_11 build/oraclelinux_7_12 build/oraclelinux_7_13 + @echo Oraclelinux 7: done + +build/oraclelinux_8: build/oraclelinux_8_9.5 build/oraclelinux_8_9.6 build/oraclelinux_8_10 build/oraclelinux_8_11 build/oraclelinux_8_12 build/oraclelinux_8_13 + @echo Oraclelinux 8: done + +# RHEL +build/rhel: build/rhel_6 build/rhel_7 build/rhel_8 #build/rpm_repo_package_rhel + @echo Rhel: done + +build/rhel_6: build/rhel_6_9.5 build/rhel_6_9.6 build/rhel_6_10 build/rhel_6_11 build/rhel_6_12 build/rhel_6_13 + @echo Rhel 6: done + +build/rhel_7: build/rhel_7_9.5 build/rhel_7_9.6 build/rhel_7_10 build/rhel_7_11 build/rhel_7_12 build/rhel_7_13 + @echo Rhel 7: done + +build/rhel_8: build/rhel_8_9.5 build/rhel_8_9.6 build/rhel_8_10 build/rhel_8_11 build/rhel_8_12 build/rhel_8_13 + @echo Rhel 8: done define build_rpm docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ - -v "$(WORKDIR)":/app/in \ - -v $(WORKDIR)/build/data/$1/$2/$(PBK_PKG_REPO)/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ + -v $(WORKDIR)/packaging:/app/in \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ - --rm pgpro/$1:$2 /app/in/packaging/scripts/rpm.sh + --rm pgpro/$1:$2 /app/in/scripts/rpm.sh endef include packaging/Makefile.centos +include packaging/Makefile.rhel +include packaging/Makefile.oraclelinux + + +# Alt Linux +build/alt: build/alt_7 #build/alt_8 build/alt_9 + @echo Alt Linux: done + +build/alt_7: build/alt_7_9.5 build/alt_7_9.6 build/alt_7_10 build/alt_7_11 build/alt_7_12 build/alt_7_13 + @echo Alt Linux 7: done + +define build_alt + docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging:/app/in \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ + -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ + -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ + --rm pgpro/$1:$2 /app/in/scripts/alt.sh +endef + +include packaging/Makefile.alt + +#### REPO BUILD #### # #define build_rpm_repo_pkg # docker run -v "$(WORKDIR)":/app/in \ diff --git a/packaging/scripts/alt.sh b/packaging/scripts/alt.sh new file mode 100755 index 000000000..5190e5083 --- /dev/null +++ b/packaging/scripts/alt.sh @@ -0,0 +1,123 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +# THere is no std/ent packages for PG 9.5 +if [[ ${PG_VERSION} == '9.5' ]] && [[ ${PBK_EDITION} != '' ]] ; then + exit 0 +fi + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 +apt-get update -y + +mkdir /root/build +cd /root/build + +# Copy rpmbuild +cp -rv /app/in/specs/rpm/rpmbuild /root/ + +# download pbk +git clone $PKG_URL pg_probackup-${PKG_VERSION} +cd pg_probackup-${PKG_VERSION} +git checkout ${PKG_HASH} +cd .. + +# tarball it +if [[ ${PBK_EDITION} == '' ]] ; then + tar -cjf pg_probackup-${PKG_VERSION}.tar.bz2 pg_probackup-${PKG_VERSION} + mv pg_probackup-${PKG_VERSION}.tar.bz2 /root/rpmbuild/SOURCES + rm -rf pg_probackup-${PKG_VERSION} +else + mv pg_probackup-${PKG_VERSION} /root/rpmbuild/SOURCES +fi + + +if [[ ${PBK_EDITION} == '' ]] ; then + # Download PostgreSQL source + wget -q http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 -O postgresql-${PG_VERSION}.tar.bz2 + mv postgresql-${PG_VERSION}.tar.bz2 /root/rpmbuild/SOURCES/ + +else + tar -xf /app/in/tarballs/pgpro.tar.bz2 -C /root/rpmbuild/SOURCES/ + cd /root/rpmbuild/SOURCES/pgpro + + PGPRO_TOC=$(echo ${PG_FULL_VERSION} | sed 's|\.|_|g') + if [[ ${PBK_EDITION} == 'std' ]] ; then + git checkout "PGPRO${PGPRO_TOC}_1" + else + git checkout "PGPROEE${PGPRO_TOC}_1" + fi + rm -rf .git + + cd /root/rpmbuild/SOURCES/ + mv pgpro postgrespro-${PBK_EDITION}-${PG_FULL_VERSION} + chown -R root:root postgrespro-${PBK_EDITION}-${PG_FULL_VERSION} +fi + + +cd /root/rpmbuild/SOURCES +sed -i "s/@PG_VERSION@/${PKG_VERSION}/" pg_probackup.repo + +# build postgresql +echo '%_allow_root_build yes' > /root/.rpmmacros +echo '%_topdir %{getenv:HOME}/rpmbuild' >> /root/.rpmmacros + +cd /root/rpmbuild/SPECS +if [[ ${PBK_EDITION} == '' ]] ; then + sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup.alt.spec + sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup.alt.spec + sed -i "s/@PKG_HASH@/${PKG_HASH}/" pg_probackup.alt.spec + sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup.alt.spec + sed -i "s/@PG_FULL_VERSION@/${PG_FULL_VERSION}/" pg_probackup.alt.spec +else + sed -i "s/@EDITION@/${PBK_EDITION}/" pg_probackup.alt.forks.spec + sed -i "s/@EDITION_FULL@/${PBK_EDITION_FULL}/" pg_probackup.alt.forks.spec + sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup.alt.forks.spec + sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup.alt.forks.spec + sed -i "s/@PKG_HASH@/${PKG_HASH}/" pg_probackup.alt.forks.spec + sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup.alt.forks.spec + sed -i "s/@PG_FULL_VERSION@/${PG_FULL_VERSION}/" pg_probackup.alt.forks.spec + + if [ ${PG_VERSION} != '9.6' ]; then + sed -i "s|@PREFIX@|/opt/pgpro/${EDITION}-${PG_VERSION}|g" pg_probackup.alt.forks.spec + fi +fi + +# ALT Linux suck as detecting dependecies, so the manual hint is required +if [ ${DISTRIB_VERSION} == '7' ]; then + apt-get install libpq5.10 + +elif [ ${DISTRIB_VERSION} == '8' ]; then + apt-get install libpq5.12 + +else + apt-get install libpq5 +fi + +# install dependencies +#stolen from postgrespro +apt-get install -y flex libldap-devel libpam-devel libreadline-devel libssl-devel + +if [[ ${PBK_EDITION} == '' ]] ; then + + # build pg_probackup + rpmbuild -bs pg_probackup.alt.spec + rpmbuild -ba pg_probackup.alt.spec #2>&1 | tee -ai /app/out/build.log + + # write artefacts to out directory + rm -rf /app/out/* + cp -arv /root/rpmbuild/{RPMS,SRPMS} /app/out +else + rpmbuild -ba pg_probackup.alt.forks.spec #2>&1 | tee -ai /app/out/build.log + # write artefacts to out directory + rm -rf /app/out/* + # cp -arv /root/rpmbuild/{RPMS,SRPMS} /app/out + cp -arv /root/rpmbuild/RPMS /app/out +fi diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec index a0ec9580b..11b3d8c6c 100644 --- a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec +++ b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec @@ -27,7 +27,6 @@ Backup tool for PostgresPro %{edition_full}. %prep #%setup -q -b1 -n pg_probackup-%{version}.tar.bz2 -#cd %{_topdir}/BUILD mv %{_topdir}/SOURCES/postgrespro-%{edition}-%{pgsql_full} %{_topdir}/BUILD cd %{_topdir}/BUILD/postgrespro-%{edition}-%{pgsql_full} mv %{_topdir}/SOURCES/pg_probackup-%{version} contrib/pg_probackup diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec index d81c5e152..cbfd61a0f 100644 --- a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec +++ b/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec @@ -17,8 +17,10 @@ Summary: Backup utility for PostgresPro %{edition_full} Group: Applications/Databases License: BSD Url: http://postgrespro.ru/ -Source0: postgrespro-%{edition}-%{pgsql_full}.tar.bz2 -Source1: pg_probackup-%{edition}-%{version}.tar.bz2 +#Source0: postgrespro-%{edition}-%{pgsql_full}.tar.bz2 +#Source1: pg_probackup-%{edition}-%{version}.tar.bz2 +Source0: postgrespro-%{edition}-%{pgsql_full} +Source1: pg_probackup-%{version} BuildRequires: gcc make perl glibc-devel bison flex BuildRequires: readline-devel openssl-devel gettext zlib-devel @@ -27,10 +29,17 @@ BuildRequires: readline-devel openssl-devel gettext zlib-devel Backup tool for PostgresPro %{edition_full}. %prep -%setup -q -b1 -n postgrespro-%{edition}-%{pgsql_full} +#%setup -q -b1 -n postgrespro-%{edition}-%{pgsql_full} +mv %{_topdir}/SOURCES/postgrespro-%{edition}-%{pgsql_full} %{_topdir}/BUILD +cd %{_topdir}/BUILD/postgrespro-%{edition}-%{pgsql_full} +mv %{_topdir}/SOURCES/pg_probackup-%{version} contrib/pg_probackup + +mkdir %{_topdir}/SOURCES/postgrespro-%{edition}-%{pgsql_full} +mkdir %{_topdir}/SOURCES/pg_probackup-%{edition}-%{version} +mkdir %{_topdir}/SOURCES/pg_probackup-%{version} %build -mv %{_builddir}/pg_probackup-%{edition}-%{version} contrib/pg_probackup +cd %{_topdir}/BUILD/postgrespro-%{edition}-%{pgsql_full} %if "%{pgsql_major}" == "9.6" ./configure --enable-debug %else @@ -42,6 +51,7 @@ make -C 'src/interfaces' cd contrib/pg_probackup && make %install +cd %{_topdir}/BUILD/postgrespro-%{edition}-%{pgsql_full} %{__mkdir} -p %{buildroot}%{_bindir} %{__install} -p -m 755 contrib/pg_probackup/pg_probackup %{buildroot}%{_bindir}/%{name} From cad265f1f3afc28d4e948c5ea85113fc971301d6 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Tue, 3 Aug 2021 14:54:32 +0300 Subject: [PATCH 05/54] [Issue #413] packaging for Oracle Linux and Rhel --- packaging/Makefile.centos | 50 +++++++++++++++++++++++ packaging/Makefile.oraclelinux | 74 ++++++++++++++++++++++++++++++++++ packaging/Makefile.rhel | 74 ++++++++++++++++++++++++++++++++++ packaging/scripts/deb.sh | 4 +- packaging/scripts/rpm.sh | 6 +-- 5 files changed, 202 insertions(+), 6 deletions(-) create mode 100644 packaging/Makefile.oraclelinux create mode 100644 packaging/Makefile.rhel diff --git a/packaging/Makefile.centos b/packaging/Makefile.centos index b60dc0df6..da8bac1f3 100644 --- a/packaging/Makefile.centos +++ b/packaging/Makefile.centos @@ -22,3 +22,53 @@ build/centos_6_12: build/centos_6_13: $(call build_rpm,centos,6,,13,13.3) touch build/centos_6_13 + +# CENTOS 7 +build/centos_7_9.5: + $(call build_rpm,centos,7,,9.5,9.5.25) + touch build/centos_7_9.5 + +build/centos_7_9.6: + $(call build_rpm,centos,7,,9.6,9.6.21) + touch build/centos_7_9.6 + +build/centos_7_10: + $(call build_rpm,centos,7,,10,10.16) + touch build/centos_7_10 + +build/centos_7_11: + $(call build_rpm,centos,7,,11,11.11) + touch build/centos_7_11 + +build/centos_7_12: + $(call build_rpm,centos,7,,12,12.6) + touch build/centos_7_12 + +build/centos_7_13: + $(call build_rpm,centos,7,,13,13.3) + touch build/centos_7_13 + +# CENTOS 8 +build/centos_8_9.5: + $(call build_rpm,centos,8,,9.5,9.5.25) + touch build/centos_8_9.5 + +build/centos_8_9.6: + $(call build_rpm,centos,8,,9.6,9.6.21) + touch build/centos_8_9.6 + +build/centos_8_10: + $(call build_rpm,centos,8,,10,10.16) + touch build/centos_8_10 + +build/centos_8_11: + $(call build_rpm,centos,8,,11,11.11) + touch build/centos_8_11 + +build/centos_8_12: + $(call build_rpm,centos,8,,12,12.6) + touch build/centos_8_12 + +build/centos_8_13: + $(call build_rpm,centos,8,,13,13.3) + touch build/centos_8_13 diff --git a/packaging/Makefile.oraclelinux b/packaging/Makefile.oraclelinux new file mode 100644 index 000000000..58b25d80f --- /dev/null +++ b/packaging/Makefile.oraclelinux @@ -0,0 +1,74 @@ +# ORACLE LINUX 6 +build/oraclelinux_6_9.5: + $(call build_rpm,oraclelinux,6,,9.5,9.5.25) + touch build/oraclelinux_6_9.5 + +build/oraclelinux_6_9.6: + $(call build_rpm,oraclelinux,6,,9.6,9.6.21) + touch build/oraclelinux_6_9.6 + +build/oraclelinux_6_10: + $(call build_rpm,oraclelinux,6,,10,10.16) + touch build/oraclelinux_6_10 + +build/oraclelinux_6_11: + $(call build_rpm,oraclelinux,6,,11,11.11) + touch build/oraclelinux_6_11 + +build/oraclelinux_6_12: + $(call build_rpm,oraclelinux,6,,12,12.6) + touch build/oraclelinux_6_12 + +build/oraclelinux_6_13: + $(call build_rpm,oraclelinux,6,,13,13.3) + touch build/oraclelinux_6_13 + +# ORACLE LINUX 7 +build/oraclelinux_7_9.5: + $(call build_rpm,oraclelinux,7,,9.5,9.5.25) + touch build/oraclelinux_7_9.5 + +build/oraclelinux_7_9.6: + $(call build_rpm,oraclelinux,7,,9.6,9.6.21) + touch build/oraclelinux_7_9.6 + +build/oraclelinux_7_10: + $(call build_rpm,oraclelinux,7,,10,10.16) + touch build/oraclelinux_7_10 + +build/oraclelinux_7_11: + $(call build_rpm,oraclelinux,7,,11,11.11) + touch build/oraclelinux_7_11 + +build/oraclelinux_7_12: + $(call build_rpm,oraclelinux,7,,12,12.6) + touch build/oraclelinux_7_12 + +build/oraclelinux_7_13: + $(call build_rpm,oraclelinux,7,,13,13.3) + touch build/oraclelinux_7_13 + +# ORACLE LINUX 8 +build/oraclelinux_8_9.5: + $(call build_rpm,oraclelinux,8,,9.5,9.5.25) + touch build/oraclelinux_8_9.5 + +build/oraclelinux_8_9.6: + $(call build_rpm,oraclelinux,8,,9.6,9.6.21) + touch build/oraclelinux_8_9.6 + +build/oraclelinux_8_10: + $(call build_rpm,oraclelinux,8,,10,10.16) + touch build/oraclelinux_8_10 + +build/oraclelinux_8_11: + $(call build_rpm,oraclelinux,8,,11,11.11) + touch build/oraclelinux_8_11 + +build/oraclelinux_8_12: + $(call build_rpm,oraclelinux,8,,12,12.6) + touch build/oraclelinux_8_12 + +build/oraclelinux_8_13: + $(call build_rpm,oraclelinux,8,,13,13.3) + touch build/oraclelinux_8_13 diff --git a/packaging/Makefile.rhel b/packaging/Makefile.rhel new file mode 100644 index 000000000..24581fc93 --- /dev/null +++ b/packaging/Makefile.rhel @@ -0,0 +1,74 @@ +# RHEL 6 +build/rhel_6_9.5: + $(call build_rpm,rhel,6,6Server,9.5,9.5.25) + touch build/rhel_6_9.5 + +build/rhel_6_9.6: + $(call build_rpm,rhel,6,6Server,9.6,9.6.21) + touch build/rhel_6_9.6 + +build/rhel_6_10: + $(call build_rpm,rhel,6,6Server,10,10.16) + touch build/rhel_6_10 + +build/rhel_6_11: + $(call build_rpm,rhel,6,6Server,11,11.11) + touch build/rhel_6_11 + +build/rhel_6_12: + $(call build_rpm,rhel,6,6Server,12,12.6) + touch build/rhel_6_12 + +build/rhel_6_13: + $(call build_rpm,rhel,6,6Server,13,13.3) + touch build/rhel_6_13 + +# RHEL 7 +build/rhel_7_9.5: + $(call build_rpm,rhel,7,7Server,9.5,9.5.25) + touch build/rhel_7_9.5 + +build/rhel_7_9.6: + $(call build_rpm,rhel,7,7Server,9.6,9.6.21) + touch build/rhel_7_9.6 + +build/rhel_7_10: + $(call build_rpm,rhel,7,7Server,10,10.16) + touch build/rhel_7_10 + +build/rhel_7_11: + $(call build_rpm,rhel,7,7Server,11,11.11) + touch build/rhel_7_11 + +build/rhel_7_12: + $(call build_rpm,rhel,7,7Server,12,12.6) + touch build/rhel_7_12 + +build/rhel_7_13: + $(call build_rpm,rhel,7,7Server,13,13.3) + touch build/rhel_7_13 + +# RHEL 8 +build/rhel_8_9.5: + $(call build_rpm,rhel,8,8Server,9.5,9.5.25) + touch build/rhel_8_9.5 + +build/rhel_8_9.6: + $(call build_rpm,rhel,8,8Server,9.6,9.6.21) + touch build/rhel_8_9.6 + +build/rhel_8_10: + $(call build_rpm,rhel,8,8Server,10,10.16) + touch build/rhel_8_10 + +build/rhel_8_11: + $(call build_rpm,rhel,8,8Server,11,11.11) + touch build/rhel_8_11 + +build/rhel_8_12: + $(call build_rpm,rhel,8,8Server,12,12.6) + touch build/rhel_8_12 + +build/rhel_8_13: + $(call build_rpm,rhel,8,8Server,13,13.3) + touch build/rhel_8_13 diff --git a/packaging/scripts/deb.sh b/packaging/scripts/deb.sh index 9166e5e40..2fe2018b6 100755 --- a/packaging/scripts/deb.sh +++ b/packaging/scripts/deb.sh @@ -46,7 +46,7 @@ if [[ ${PBK_EDITION} == '' ]] ; then fi cd /root/build/${PKG_NAME}_${PKG_VERSION} -cp -av /app/in/packaging/specs/deb/pg_probackup/debian ./ +cp -av /app/in/specs/deb/pg_probackup/debian ./ if [[ ${PBK_EDITION} == '' ]] ; then sed -i "s/@PKG_NAME@/${PKG_NAME}/g" debian/changelog sed -i "s/@PKG_VERSION@/${PKG_VERSION}/g" debian/changelog @@ -114,7 +114,7 @@ if [[ ${PBK_EDITION} == '' ]] ; then cd /root/build/${PKG_NAME}_${PKG_VERSION} tar -xf /root/build/dsc/${PKG_NAME}_${PKG_VERSION}.orig-postgresql${PG_TOC}.tar.bz2 else - tar -xf /app/in/packaging/tarballs/pgpro.tar.bz2 -C /root/build/dsc/ + tar -xf /app/in/tarballs/pgpro.tar.bz2 -C /root/build/dsc/ cd /root/build/dsc/pgpro PGPRO_TOC=$(echo ${PG_FULL_VERSION} | sed 's|\.|_|g') diff --git a/packaging/scripts/rpm.sh b/packaging/scripts/rpm.sh index 210a23a77..aa23bcc7c 100755 --- a/packaging/scripts/rpm.sh +++ b/packaging/scripts/rpm.sh @@ -31,7 +31,7 @@ cd /root/build rpm --rebuilddb && yum clean all # Copy rpmbuild -cp -rv /app/in/packaging/specs/rpm/rpmbuild /root/ +cp -rv /app/in/specs/rpm/rpmbuild /root/ # download pbk git clone $PKG_URL pg_probackup-${PKG_VERSION} @@ -66,9 +66,7 @@ if [[ ${PBK_EDITION} == '' ]] ; then then sed -i "s/@SHORT_CODENAME@/Oracle/" pg_probackup.repo fi else -# cp /app/tarballs/postgrespro-${EDITION}-${PG_FULL_VERSION}.tar.bz2 /root/rpmbuild/SOURCES/ -# cp /app/in/packaging/tarballs/pgpro.tar.bz2 - tar -xf /app/in/packaging/tarballs/pgpro.tar.bz2 -C /root/rpmbuild/SOURCES/ + tar -xf /app/in/tarballs/pgpro.tar.bz2 -C /root/rpmbuild/SOURCES/ cd /root/rpmbuild/SOURCES/pgpro PGPRO_TOC=$(echo ${PG_FULL_VERSION} | sed 's|\.|_|g') From 1ed4848d27cad089ae5cc0ad380d74559948d288 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Tue, 3 Aug 2021 15:02:52 +0300 Subject: [PATCH 06/54] [Issue #413] fallback to PG 13.2 --- packaging/Makefile.alt | 50 ++++++++++++++++++++++++++++++++++ packaging/Makefile.centos | 6 ++-- packaging/Makefile.debian | 6 ++-- packaging/Makefile.oraclelinux | 6 ++-- packaging/Makefile.pkg | 9 +++++- packaging/Makefile.rhel | 6 ++-- packaging/Makefile.ubuntu | 8 +++--- 7 files changed, 74 insertions(+), 17 deletions(-) diff --git a/packaging/Makefile.alt b/packaging/Makefile.alt index c5f7441eb..e3fbae26e 100644 --- a/packaging/Makefile.alt +++ b/packaging/Makefile.alt @@ -22,3 +22,53 @@ build/alt_7_12: build/alt_7_13: $(call build_alt,alt,7,,13,13.2) touch build/alt_7_13 + +# ALT 8 +build/alt_8_9.5: + $(call build_alt,alt,8,,9.5,9.5.25) + touch build/alt_8_9.5 + +build/alt_8_9.6: + $(call build_alt,alt,8,,9.6,9.6.21) + touch build/alt_8_9.6 + +build/alt_8_10: + $(call build_alt,alt,8,,10,10.17) + touch build/alt_8_10 + +build/alt_8_11: + $(call build_alt,alt,8,,11,11.11) + touch build/alt_8_11 + +build/alt_8_12: + $(call build_alt,alt,8,,12,12.6) + touch build/alt_8_12 + +build/alt_8_13: + $(call build_alt,alt,8,,13,13.2) + touch build/alt_8_13 + +# ALT 9 +build/alt_9_9.5: + $(call build_alt,alt,9,,9.5,9.5.25) + touch build/alt_9_9.5 + +build/alt_9_9.6: + $(call build_alt,alt,9,,9.6,9.6.21) + touch build/alt_9_9.6 + +build/alt_9_10: + $(call build_alt,alt,9,,10,10.17) + touch build/alt_9_10 + +build/alt_9_11: + $(call build_alt,alt,9,,11,11.11) + touch build/alt_9_11 + +build/alt_9_12: + $(call build_alt,alt,9,,12,12.6) + touch build/alt_9_12 + +build/alt_9_13: + $(call build_alt,alt,9,,13,13.2) + touch build/alt_9_13 diff --git a/packaging/Makefile.centos b/packaging/Makefile.centos index da8bac1f3..7b248bb13 100644 --- a/packaging/Makefile.centos +++ b/packaging/Makefile.centos @@ -20,7 +20,7 @@ build/centos_6_12: touch build/centos_6_12 build/centos_6_13: - $(call build_rpm,centos,6,,13,13.3) + $(call build_rpm,centos,6,,13,13.2) touch build/centos_6_13 # CENTOS 7 @@ -45,7 +45,7 @@ build/centos_7_12: touch build/centos_7_12 build/centos_7_13: - $(call build_rpm,centos,7,,13,13.3) + $(call build_rpm,centos,7,,13,13.2) touch build/centos_7_13 # CENTOS 8 @@ -70,5 +70,5 @@ build/centos_8_12: touch build/centos_8_12 build/centos_8_13: - $(call build_rpm,centos,8,,13,13.3) + $(call build_rpm,centos,8,,13,13.2) touch build/centos_8_13 diff --git a/packaging/Makefile.debian b/packaging/Makefile.debian index 016dce381..e9e2536ba 100644 --- a/packaging/Makefile.debian +++ b/packaging/Makefile.debian @@ -20,7 +20,7 @@ build/debian_8_12: touch build/debian_8_12 build/debian_8_13: - $(call build_deb,debian,8,jessie,13,13.3) + $(call build_deb,debian,8,jessie,13,13.2) touch build/debian_8_13 # DEBIAN 9 @@ -45,7 +45,7 @@ build/debian_9_12: touch build/debian_9_12 build/debian_9_13: - $(call build_deb,debian,9,stretch,13,13.3) + $(call build_deb,debian,9,stretch,13,13.2) touch build/debian_9_13 # DEBIAN 10 @@ -70,5 +70,5 @@ build/debian_10_12: touch build/debian_10_12 build/debian_10_13: - $(call build_deb,debian,10,buster,13,13.3) + $(call build_deb,debian,10,buster,13,13.2) touch build/debian_10_13 diff --git a/packaging/Makefile.oraclelinux b/packaging/Makefile.oraclelinux index 58b25d80f..f4eada23f 100644 --- a/packaging/Makefile.oraclelinux +++ b/packaging/Makefile.oraclelinux @@ -20,7 +20,7 @@ build/oraclelinux_6_12: touch build/oraclelinux_6_12 build/oraclelinux_6_13: - $(call build_rpm,oraclelinux,6,,13,13.3) + $(call build_rpm,oraclelinux,6,,13,13.2) touch build/oraclelinux_6_13 # ORACLE LINUX 7 @@ -45,7 +45,7 @@ build/oraclelinux_7_12: touch build/oraclelinux_7_12 build/oraclelinux_7_13: - $(call build_rpm,oraclelinux,7,,13,13.3) + $(call build_rpm,oraclelinux,7,,13,13.2) touch build/oraclelinux_7_13 # ORACLE LINUX 8 @@ -70,5 +70,5 @@ build/oraclelinux_8_12: touch build/oraclelinux_8_12 build/oraclelinux_8_13: - $(call build_rpm,oraclelinux,8,,13,13.3) + $(call build_rpm,oraclelinux,8,,13,13.2) touch build/oraclelinux_8_13 diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index cbdb2891f..3f2ee60f2 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -164,12 +164,18 @@ include packaging/Makefile.oraclelinux # Alt Linux -build/alt: build/alt_7 #build/alt_8 build/alt_9 +build/alt: build/alt_7 build/alt_8 build/alt_9 @echo Alt Linux: done build/alt_7: build/alt_7_9.5 build/alt_7_9.6 build/alt_7_10 build/alt_7_11 build/alt_7_12 build/alt_7_13 @echo Alt Linux 7: done +build/alt_8: build/alt_8_9.5 build/alt_8_9.6 build/alt_8_10 build/alt_8_11 build/alt_8_12 build/alt_8_13 + @echo Alt Linux 8: done + +build/alt_9: build/alt_9_9.5 build/alt_9_9.6 build/alt_9_10 build/alt_9_11 build/alt_9_12 build/alt_9_13 + @echo Alt Linux 9: done + define build_alt docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ @@ -184,6 +190,7 @@ endef include packaging/Makefile.alt +# Suse Linux #### REPO BUILD #### # diff --git a/packaging/Makefile.rhel b/packaging/Makefile.rhel index 24581fc93..31348cbec 100644 --- a/packaging/Makefile.rhel +++ b/packaging/Makefile.rhel @@ -20,7 +20,7 @@ build/rhel_6_12: touch build/rhel_6_12 build/rhel_6_13: - $(call build_rpm,rhel,6,6Server,13,13.3) + $(call build_rpm,rhel,6,6Server,13,13.2) touch build/rhel_6_13 # RHEL 7 @@ -45,7 +45,7 @@ build/rhel_7_12: touch build/rhel_7_12 build/rhel_7_13: - $(call build_rpm,rhel,7,7Server,13,13.3) + $(call build_rpm,rhel,7,7Server,13,13.2) touch build/rhel_7_13 # RHEL 8 @@ -70,5 +70,5 @@ build/rhel_8_12: touch build/rhel_8_12 build/rhel_8_13: - $(call build_rpm,rhel,8,8Server,13,13.3) + $(call build_rpm,rhel,8,8Server,13,13.2) touch build/rhel_8_13 diff --git a/packaging/Makefile.ubuntu b/packaging/Makefile.ubuntu index 74bbfd875..3f76de516 100644 --- a/packaging/Makefile.ubuntu +++ b/packaging/Makefile.ubuntu @@ -20,7 +20,7 @@ build/ubuntu_20.04_12: touch build/ubuntu_20.04_12 build/ubuntu_20.04_13: - $(call build_deb,ubuntu,20.04,focal,13,13.3) + $(call build_deb,ubuntu,20.04,focal,13,13.2) touch build/ubuntu_20.04_13 # UBUNTU 18.04 @@ -45,7 +45,7 @@ build/ubuntu_18.04_12: touch build/ubuntu_18.04_12 build/ubuntu_18.04_13: - $(call build_deb,ubuntu,18.04,bionic,13,13.3) + $(call build_deb,ubuntu,18.04,bionic,13,13.2) touch build/ubuntu_18.04_13 # UBUNTU 16.04 @@ -70,7 +70,7 @@ build/ubuntu_16.04_12: touch build/ubuntu_16.04_12 build/ubuntu_16.04_13: - $(call build_deb,ubuntu,16.04,xenial,13,13.3) + $(call build_deb,ubuntu,16.04,xenial,13,13.2) touch build/ubuntu_16.04_13 # UBUNTU 14.04 @@ -95,5 +95,5 @@ build/ubuntu_14.04_12: touch build/ubuntu_14.04_12 build/ubuntu_14.04_13: - $(call build_deb,ubuntu,14.04,trusty,13,13.3) + $(call build_deb,ubuntu,14.04,trusty,13,13.2) touch build/ubuntu_14.04_13 From c85babfd92a0e3edf1e466e55777c332bc4eff67 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Tue, 3 Aug 2021 22:50:31 +0300 Subject: [PATCH 07/54] [skip travis] packaging for suse --- .gitignore | 3 ++ packaging/Makefile.pkg | 54 ++++++++++++--------- packaging/Makefile.suse | 49 +++++++++++++++++++ packaging/Readme.md | 2 +- packaging/scripts/suse.sh | 99 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 184 insertions(+), 23 deletions(-) create mode 100644 packaging/Makefile.suse create mode 100755 packaging/scripts/suse.sh diff --git a/.gitignore b/.gitignore index 474df1c73..0da401f82 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,9 @@ /make_dockerfile.sh /backup_restore.sh +# Packaging +/build + # Misc .python-version .vscode diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 3f2ee60f2..67c9e6204 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -21,11 +21,11 @@ endif #PG_VERSIONS = $(PG_VERSIONS_DEFAULT) #endif -pkg: prepare_builddir build/all +pkg: check_env build/prepare build/all @echo Build for all platform: done # echo "HELLO" -prepare_builddir: +check_env: @if [ -z ${PBK_VERSION} ] ; then \ echo "Env variable PBK_VERSION is not set" ; \ false ; \ @@ -40,26 +40,14 @@ prepare_builddir: echo "Env variable PBK_HASH is not set" ; \ false ; \ fi - mkdir -p $(BUILDDIR) -#rpm: prepare_builddir $(BUILDDIR)/packaging/rpm/SPECS/$(SPEC) -# mkdir -p $(BUILDDIR)/packaging/rpm/RPMS $(BUILDDIR)/packaging/rpm/BUILD $(BUILDDIR)/packaging/rpm/SRPMS -# rpmbuild -ba --define '_topdir $(BUILDDIR)/packaging/rpm'\ -# $(BUILDDIR)/packaging/rpm/SPECS/$(SPEC) -# cp -av $(BUILDDIR)/packaging/rpm/RPMS/noarch/mamonsu*.rpm . +build/prepare: + mkdir -p build -#build/prepare: -# mkdir -p build -# touch build/prepare +build/clean: build/prepare + rm -f build/build* -#build/all: build/debian build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/pkg_suse -# @echo Build for all platform: done -# touch build/all - -#build/all: build/debian build/ubuntu build/centos -# @echo Packaging is done - -build/all: build/alt +build/all: build/debian build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/suse @echo Packaging is done ### DEBIAN @@ -107,7 +95,7 @@ include packaging/Makefile.debian include packaging/Makefile.ubuntu # CENTOS -build/centos: build/centos_6 build/centos_7 build/centos_7 #build/rpm_repo_package_centos +build/centos: build/centos_6 build/centos_7 build/centos_8 #build/rpm_repo_package_centos @echo Centos: done build/centos_6: build/centos_6_9.5 build/centos_6_9.6 build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 @@ -120,7 +108,7 @@ build/centos_8: build/centos_8_9.5 build/centos_8_9.6 build/centos_8_10 build/ce @echo Centos 8: done # Oracle Linux -build/oraclelinux: build/oraclelinux_6 build/oraclelinux_7 build/oraclelinux_7 #build/rpm_repo_package_oraclelinux +build/oraclelinux: build/oraclelinux_6 build/oraclelinux_7 build/oraclelinux_8 #build/rpm_repo_package_oraclelinux @echo Oraclelinux: done build/oraclelinux_6: build/oraclelinux_6_9.5 build/oraclelinux_6_9.6 build/oraclelinux_6_10 build/oraclelinux_6_11 build/oraclelinux_6_12 build/oraclelinux_6_13 @@ -190,7 +178,29 @@ endef include packaging/Makefile.alt -# Suse Linux +# SUSE Linux +build/suse: build/suse_15.1 build/suse_15.2 + @echo Suse: done + +build/suse_15.1: build/suse_15.1_9.5 build/suse_15.1_9.6 build/suse_15.1_10 build/suse_15.1_11 build/suse_15.1_12 build/suse_15.1_13 + @echo Rhel 15.1: done + +build/suse_15.2: build/suse_15.2_9.5 build/suse_15.2_9.6 build/suse_15.2_10 build/suse_15.2_11 build/suse_15.2_12 build/suse_15.2_13 + @echo Rhel 15.1: done + +define build_suse + docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging:/app/in \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ + -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ + -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ + --rm pgpro/$1:$2 /app/in/scripts/suse.sh +endef + +include packaging/Makefile.suse #### REPO BUILD #### # diff --git a/packaging/Makefile.suse b/packaging/Makefile.suse new file mode 100644 index 000000000..a9f1eaa36 --- /dev/null +++ b/packaging/Makefile.suse @@ -0,0 +1,49 @@ +# Suse 15.1 +build/suse_15.1_9.5: + $(call build_suse,suse,15.1,,9.5,9.5.25) + touch build/suse_15.1_9.5 + +build/suse_15.1_9.6: + $(call build_suse,suse,15.1,,9.6,9.6.21) + touch build/suse_15.1_9.6 + +build/suse_15.1_10: + $(call build_suse,suse,15.1,,10,10.16) + touch build/suse_15.1_10 + +build/suse_15.1_11: + $(call build_suse,suse,15.1,,11,11.11) + touch build/suse_15.1_11 + +build/suse_15.1_12: + $(call build_suse,suse,15.1,,12,12.6) + touch build/suse_15.1_12 + +build/suse_15.1_13: + $(call build_suse,suse,15.1,,13,13.2) + touch build/suse_15.1_13 + +# Suse 15.2 +build/suse_15.2_9.5: + $(call build_suse,suse,15.2,,9.5,9.5.25) + touch build/suse_15.2_9.5 + +build/suse_15.2_9.6: + $(call build_suse,suse,15.2,,9.6,9.6.21) + touch build/suse_15.2_9.6 + +build/suse_15.2_10: + $(call build_suse,suse,15.2,,10,10.16) + touch build/suse_15.2_10 + +build/suse_15.2_11: + $(call build_suse,suse,15.2,,11,11.11) + touch build/suse_15.2_11 + +build/suse_15.2_12: + $(call build_suse,suse,15.2,,12,12.6) + touch build/suse_15.2_12 + +build/suse_15.2_13: + $(call build_suse,suse,15.2,,13,13.2) + touch build/suse_15.2_13 diff --git a/packaging/Readme.md b/packaging/Readme.md index cb2c4027c..9c22bdc76 100644 --- a/packaging/Readme.md +++ b/packaging/Readme.md @@ -1,7 +1,7 @@ ``` export PBK_VERSION=2.4.17 -export PG_VERSIONS=9.5 export PBK_HASH=57f871accce2604 +export PBK_RELEASE=1 export PBK_EDITION=std make pkg ``` diff --git a/packaging/scripts/suse.sh b/packaging/scripts/suse.sh new file mode 100755 index 000000000..396e85598 --- /dev/null +++ b/packaging/scripts/suse.sh @@ -0,0 +1,99 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + + +#yum upgrade -y || echo "some packages in docker fail to install" +#if [ -f /etc/rosa-release ]; then +# # Avoids old yum bugs on rosa-6 +# yum upgrade -y || echo "some packages in docker fail to install" +#fi + +set -xe +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 +zypper clean + +# PACKAGES NEEDED +zypper install -y git wget bzip2 rpm-build + +mkdir /root/build +cd /root/build + +# Copy rpmbuild +cp -rv /app/in/specs/rpm/rpmbuild /root/ + +# download pbk +git clone $PKG_URL pg_probackup-${PKG_VERSION} +cd pg_probackup-${PKG_VERSION} +git checkout ${PKG_HASH} +cd .. + +# tarball it +tar -cjf pg_probackup-${PKG_VERSION}.tar.bz2 pg_probackup-${PKG_VERSION} +mv pg_probackup-${PKG_VERSION}.tar.bz2 /root/rpmbuild/SOURCES +rm -rf pg_probackup-${PKG_VERSION} + +# Download PostgreSQL source +wget -q http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 -O /root/rpmbuild/SOURCES/postgresql-${PG_VERSION}.tar.bz2 + +#mv pg_probackup-${PKG_VERSION}.tar.bz2 /usr/src/packages/SOURCES/ +#mv postgresql-${PG_VERSION}.tar.bz2 /usr/src/packages/SOURCES/ +#cp -av /root/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP /usr/src/packages/SOURCES/GPG-KEY-PG_PROBACKUP +#cp -av /root/rpmbuild/SOURCES/pg_probackup.repo /usr/src/packages/SOURCES/pg_probackup.repo + +rm -rf /usr/src/packages +ln -s /root/rpmbuild /usr/src/packages + +cd /root/rpmbuild/SOURCES +sed -i "s/@PG_VERSION@/${PKG_VERSION}/" pg_probackup.repo + + +# change to build dir +cd /root/rpmbuild/SOURCES +sed -i "s/@DISTRIB@/${DISTRIB}/" pg_probackup.repo +if [ $DISTRIB == 'centos' ] + then sed -i "s/@SHORT_CODENAME@/Centos/" pg_probackup.repo +elif [ $DISTRIB == 'rhel' ] + then sed -i "s/@SHORT_CODENAME@/RedHat/" pg_probackup.repo +elif [ $DISTRIB == 'oraclelinux' ] + then sed -i "s/@SHORT_CODENAME@/Oracle/" pg_probackup.repo +elif [ $DISTRIB == 'suse' ] + then sed -i "s/@SHORT_CODENAME@/SUSE/" pg_probackup.repo +fi + +cd /root/rpmbuild/SPECS +sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup.spec +sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup.spec +sed -i "s/@PKG_HASH@/${PKG_HASH}/" pg_probackup.spec +sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup.spec +sed -i "s/@PG_FULL_VERSION@/${PG_FULL_VERSION}/" pg_probackup.spec + +sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup-repo.spec +sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup-repo.spec +sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup-repo.spec + +# install dependencies +zypper -n install \ + $(rpmspec --parse pg_probackup.spec | grep BuildRequires | cut -d':' -f2 | xargs) + +# build pg_probackup +rpmbuild -bs pg_probackup.spec +rpmbuild -ba pg_probackup.spec #2>&1 | tee -ai /app/out/build.log + +# build repo files, TODO: move to separate repo +rpmbuild -ba pg_probackup-repo.spec + +# write artefacts to out directory +rm -rf /app/out/* +#sleep 100500 +cp -arv /root/rpmbuild/{RPMS,SRPMS} /app/out +#mkdir -p /app/out/RPMS/x86_64 +#mkdir -p /app/out/RPMS/noarch +#cp -arv /usr/src/packages/RPMS/x86_64/*rpm /app/out/RPMS/x86_64/ +#cp -arv /usr/src/packages/RPMS/noarch/*rpm /app/out/RPMS/noarch/ From ae7334f206d751afaa1bf370da6ae9bdaa56237a Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Wed, 4 Aug 2021 02:23:55 +0300 Subject: [PATCH 08/54] [skip travis] repo for debian and centos --- .gitignore | 1 + packaging/Makefile.pkg | 85 ++++++++++++++++++++-------- packaging/repo/scripts/deb.sh | 51 +++++++++++++++++ packaging/repo/scripts/rpm.sh | 103 ++++++++++++++++++++++++++++++++++ 4 files changed, 216 insertions(+), 24 deletions(-) create mode 100755 packaging/repo/scripts/deb.sh create mode 100755 packaging/repo/scripts/rpm.sh diff --git a/.gitignore b/.gitignore index 0da401f82..3892c0da7 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ # Packaging /build +/packaging/tarballs/pgpro.tar.bz2 # Misc .python-version diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 67c9e6204..44365a116 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -47,14 +47,14 @@ build/prepare: build/clean: build/prepare rm -f build/build* -build/all: build/debian build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/suse +build/all: build/debian build/centos #build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/suse @echo Packaging is done ### DEBIAN -build/debian: build/debian_8 build/debian_9 build/debian_10 +build/debian: build/debian_8 #build/debian_9 build/debian_10 @echo Debian: done -build/debian_8: build/debian_8_9.5 build/debian_8_9.6 build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13 +build/debian_8: build/debian_8_9.5 #build/debian_8_9.6 build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13 @echo Debian 8: done build/debian_9: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13 @@ -95,10 +95,10 @@ include packaging/Makefile.debian include packaging/Makefile.ubuntu # CENTOS -build/centos: build/centos_6 build/centos_7 build/centos_8 #build/rpm_repo_package_centos +build/centos: build/centos_6 #build/centos_7 build/centos_8 #build/rpm_repo_package_centos @echo Centos: done -build/centos_6: build/centos_6_9.5 build/centos_6_9.6 build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 +build/centos_6: build/centos_6_9.5 #build/centos_6_9.6 build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 @echo Centos 6: done build/centos_7: build/centos_7_9.5 build/centos_7_9.6 build/centos_7_10 build/centos_7_11 build/centos_7_12 build/centos_7_13 @@ -203,27 +203,40 @@ endef include packaging/Makefile.suse #### REPO BUILD #### -# -#define build_rpm_repo_pkg -# docker run -v "$(WORKDIR)":/app/in \ -# -v "$(WORKDIR)/build/pkg/keys":/app/out \ -# -e "VERSION=$(VERSION)" -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" \ -# --rm $1:$2 /app/in/packaging/scripts/repo_rpm.sh -#endef -#build/rpm_repo_package_centos: -# $(call build_rpm_repo_pkg,centos,7) -# touch build/rpm_repo_package_centos -# +repo: repo/debian repo/centos #repo/ubuntu repo/centos repo/finish + @echo Build repo for all platform: done + +repo/debian: build/repo_debian_8 repo/debian_9 repo/debian_10 + @echo Build repo for debian platforms: done + +build/repo_debian_8: + $(call build_repo_deb,debian,8,jessie) + touch build/repo_debian_8 + +build/repo_debian_9: + $(call build_repo_deb,debian,9,stretch) + touch build/repo_debian_9 + +build/repo_debian_10: + $(call build_repo_deb,debian,10,buster) + touch build/repo_debian_10 + +repo/centos: build/repo_centos_6 build/repo_centos_7 build/repo_centos_8 + @echo Build repo for centos platforms: done + +build/repo_centos_6: + $(call build_repo_rpm,centos,6,,) + touch build/repo_centos_6 + +build/repo_centos_7: + $(call build_repo_rpm,centos,7,,) + touch build/repo_centos_7 + +build/repo_centos_8: + $(call build_repo_rpm,centos,8,,) + touch build/repo_centos_8 -#repo/all: repo/debian repo/ubuntu repo/centos repo/finish -# @echo Build repo for all platform: done -# touch build/repo_all -# -#repo/debian: repo/debian_8 repo/debian_9 repo/debian_10 -# @echo Build repo for debian platforms: done -# touch build/repo_debian -# #repo/ubuntu: repo/ubuntu_16_04 repo/ubuntu_18_04 # @echo Build repo for ubuntu platforms: done # touch build/repo_ubuntu @@ -288,3 +301,27 @@ include packaging/Makefile.suse # --rm $1:$2 bash -exc "cp -av /app/in/*rpm /app/www/mamonsu/keys && cd /app/www/mamonsu/ && \ # ln -s $(VERSION) latest" #endef + +define build_repo_deb + docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/build/data/www:/app/www \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ + --name $1_$2_pbk_repo \ + --rm pgpro/repo /app/repo/scripts/deb.sh +endef + +define build_repo_rpm + docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/build/data/www:/app/www \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ + --name $1_$2_pbk_repo \ + --rm pgpro/repo /app/repo/scripts/rpm.sh +endef diff --git a/packaging/repo/scripts/deb.sh b/packaging/repo/scripts/deb.sh new file mode 100755 index 000000000..6515e6b42 --- /dev/null +++ b/packaging/repo/scripts/deb.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -exu +set -o errexit +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +export INPUT_DIR=/app/in # dir with builded deb +export OUT_DIR=/app/www/${PBK_PKG_REPO} +#export REPO_DIR=/app/repo + +cd $INPUT_DIR + +export DEB_DIR=$OUT_DIR/deb +export KEYS_DIR=$OUT_DIR/keys +export CONF=/app/repo/${PBK_PKG_REPO}/conf +mkdir -p "$KEYS_DIR" +cp -av /app/repo/${PBK_PKG_REPO}/gnupg /root/.gnupg + +rsync /app/repo/${PBK_PKG_REPO}/gnupg/key.public $KEYS_DIR/GPG-KEY-PG_PROBACKUP +echo -e 'User-agent: *\nDisallow: /' > $OUT_DIR/robots.txt + +mkdir -p $DEB_DIR +cd $DEB_DIR +cp -av $CONF ./ + +# make remove-debpkg tool +echo -n "#!" > remove-debpkg +echo "/bin/sh" >> remove-debpkg +echo "CODENAME=\$1" >> remove-debpkg +echo "DEBFILE=\$2" >> remove-debpkg +echo "DEBNAME=\`basename \$DEBFILE | sed -e 's/_.*//g'\`" >> remove-debpkg +echo "reprepro --waitforlock 5 remove \$CODENAME \$DEBNAME" >> remove-debpkg +chmod +x remove-debpkg + +#find $INPUT_DIR/ -name '*.changes' -exec reprepro -P optional -Vb . include ${CODENAME} {} \; +find $INPUT_DIR -name "*${CODENAME}*.deb" -exec ./remove-debpkg $CODENAME {} \; +find $INPUT_DIR -name "*${CODENAME}*.dsc" -exec reprepro --waitforlock 5 -i undefinedtarget --ignore=missingfile -P optional -S main -Vb . includedsc $CODENAME {} \; +find $INPUT_DIR -name "*${CODENAME}*.deb" -exec reprepro --waitforlock 5 -i undefinedtarget --ignore=missingfile -P optional -Vb . includedeb $CODENAME {} \; +reprepro export $CODENAME + +rm -f remove-debpkg +rm -rf ./conf +rm -rf /root/.gnupg diff --git a/packaging/repo/scripts/rpm.sh b/packaging/repo/scripts/rpm.sh new file mode 100755 index 000000000..65962abb7 --- /dev/null +++ b/packaging/repo/scripts/rpm.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -ex +set -o errexit +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +export INPUT_DIR=/app/in #dir with builded rpm +export OUT_DIR=/app/www/${PBK_PKG_REPO} +export KEYS_DIR=$OUT_DIR/keys + +# deploy keys +mkdir -p "$KEYS_DIR" +rsync /app/repo/$PBK_PKG_REPO/gnupg/key.public $KEYS_DIR/GPG-KEY-PG_PROBACKUP +chmod 755 $KEYS_DIR +chmod +x /app/repo/$PBK_PKG_REPO/autosign.sh +echo -e 'User-agent: *\nDisallow: /' > $OUT_DIR/robots.txt + +cd $INPUT_DIR + +cp -arv /app/repo/$PBK_PKG_REPO/rpmmacros /root/.rpmmacros +cp -arv /app/repo/$PBK_PKG_REPO/gnupg /root/.gnupg +chmod -R 0600 /root/.gnupg +chown -R root:root /root/.gnupg + +for pkg in $(ls); do + for pkg_full_version in $(ls ./$pkg); do + + cp $INPUT_DIR/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ + $KEYS_DIR/pg_probackup-repo-$DISTRIB.noarch.rpm + [ ! -z "$CODENAME" ] && export DISTRIB_VERSION=$CODENAME + RPM_DIR=$OUT_DIR/rpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 + SRPM_DIR=$OUT_DIR/srpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 + + # rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" + # rm -rf "$SRPM_DIR" && mkdir -p "$SRPM_DIR" + mkdir -p "$RPM_DIR" + mkdir -p "$SRPM_DIR" + + cp -arv $INPUT_DIR/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ + cp -arv $INPUT_DIR/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ + + for f in $(ls $RPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done + for f in $(ls $SRPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done + createrepo $RPM_DIR/ + createrepo $SRPM_DIR/ + done +done + +# if [ $repo_name == 'pg_probackup-forks' ] +# then +# #/app/www/pg_probackup_repo/ +# export KEYS_DIR=$OUT_DIR/$repo_name/keys +# mkdir -p "$KEYS_DIR" +# rsync /app/src/$repo_name/gnupg/key.public $KEYS_DIR/GPG-KEY-PG_PROBACKUP +# chmod 755 $KEYS_DIR +# chmod +x /app/src/$repo_name/autosign.sh +# echo -e 'User-agent: *\nDisallow: /' > $OUT_DIR/$repo_name/robots.txt +# +# cp -arv /app/src/$repo_name/rpmmacros /root/.rpmmacros +# cp -arv /app/src/$repo_name/gnupg /root/.gnupg +# chmod -R 0600 /root/.gnupg +# +# cd $INPUT_DIR/$repo_name +# for pkg in $(ls); do +# for pkg_full_version in $(ls ./$pkg); do +# +# if [ $pkg == 'pg_probackup-repo-forks' ]; then +# cp $INPUT_DIR/$repo_name/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ +# $KEYS_DIR/pg_probackup-repo-forks-$DISTRIB.noarch.rpm +# continue +# fi +# +# [ ! -z "$CODENAME" ] && export DISTRIB_VERSION=$CODENAME +# RPM_DIR=$OUT_DIR/$repo_name/rpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 +## SRPM_DIR=$OUT_DIR/$repo_name/srpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 +# +## rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" +## rm -rf "$SRPM_DIR" && mkdir -p "$SRPM_DIR" +# mkdir -p "$RPM_DIR" +## mkdir -p "$SRPM_DIR" +# +# cp -arv $INPUT_DIR/$repo_name/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ +## cp -arv $INPUT_DIR/$repo_name/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ +# +# for f in $(ls $RPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done +## for f in $(ls $SRPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done +# createrepo $RPM_DIR/ +## createrepo $SRPM_DIR/ +# done +# done +# +# # repo cleanup +# rm -rf /root/.rpmmacros +# rm -rf /root/.gnupg +# fi From 41dba2b645e3e80ef26b1cdfad313a4a83ee7add Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Wed, 4 Aug 2021 14:30:45 +0300 Subject: [PATCH 09/54] [skip travis] repo for suse --- packaging/Makefile.pkg | 160 +++++++++++++++++++++------------ packaging/Readme.md | 4 + packaging/repo/scripts/alt.sh | 80 +++++++++++++++++ packaging/repo/scripts/suse.sh | 67 ++++++++++++++ packaging/scripts/suse.sh | 11 +-- 5 files changed, 256 insertions(+), 66 deletions(-) create mode 100755 packaging/repo/scripts/alt.sh create mode 100755 packaging/repo/scripts/suse.sh diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 44365a116..c40332887 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -204,9 +204,10 @@ include packaging/Makefile.suse #### REPO BUILD #### -repo: repo/debian repo/centos #repo/ubuntu repo/centos repo/finish +repo: repo/debian repo/ubuntu repo/centos repo/rhel repo/oraclelinux repo/alt repo/suse @echo Build repo for all platform: done +# Debian repo/debian: build/repo_debian_8 repo/debian_9 repo/debian_10 @echo Build repo for debian platforms: done @@ -222,6 +223,27 @@ build/repo_debian_10: $(call build_repo_deb,debian,10,buster) touch build/repo_debian_10 +# Ubuntu +repo/ubuntu: build/repo_ubuntu_14.04 build/repo_ubuntu_16.04 build/repo_ubuntu_18.04 build/repo_ubuntu_20.04 + @echo Build repo for ubuntu platforms: done + +build/repo_ubuntu_14.04: + $(call build_repo_deb,ubuntu,14.04,trusty) + touch build/repo_ubuntu_14.04 + +build/repo_ubuntu_16.04: + $(call build_repo_deb,ubuntu,16.04,xenial) + touch build/repo_ubuntu_16.04 + +build/repo_ubuntu_18.04: + $(call build_repo_deb,ubuntu,18.04,bionic) + touch build/repo_ubuntu_18.04 + +build/repo_ubuntu_20.04: + $(call build_repo_deb,ubuntu,20.04,focal) + touch build/repo_ubuntu_20.04 + +# Centos repo/centos: build/repo_centos_6 build/repo_centos_7 build/repo_centos_8 @echo Build repo for centos platforms: done @@ -237,63 +259,65 @@ build/repo_centos_8: $(call build_repo_rpm,centos,8,,) touch build/repo_centos_8 -#repo/ubuntu: repo/ubuntu_16_04 repo/ubuntu_18_04 -# @echo Build repo for ubuntu platforms: done -# touch build/repo_ubuntu -# -#repo/centos: repo/centos_6 repo/centos_7 -# @echo Build repo for centos platforms: done -# touch build/repo_centos -# -#repo/centos_6: -# $(call build_repo_rpm,centos,6,6) -# touch build/repo_centos_6 -# -#repo/centos_7: -# $(call build_repo_rpm,centos,7,7) -# touch build/repo_centos_7 -# -#repo/debian_8: -# $(call build_repo_deb,debian,8,jessie) -# touch build/repo_debian_8 -# -#repo/debian_9: -# $(call build_repo_deb,debian,9,stretch) -# touch build/repo_debian_9 -# -#repo/debian_10: -# $(call build_repo_deb,debian,10,buster) -# touch build/repo_debian_10 -# -#repo/ubuntu_14_04: -# $(call build_repo_deb,ubuntu,14.04,trusty) -# touch build/repo_ubuntu_14_04 -# -#repo/ubuntu_16_04: -# $(call build_repo_deb,ubuntu,16.04,xenial) -# touch build/repo_ubuntu_16_04 -# -#repo/ubuntu_18_04: -# $(call build_repo_deb,ubuntu,18.04,bionic) -# touch build/repo_ubuntu_18_04 +# Oraclelinux +repo/oraclelinux: build/repo_oraclelinux_6 build/repo_oraclelinux_7 build/repo_oraclelinux_8 + @echo Build repo for oraclelinux platforms: done -#repo/finish: -# $(call repo_finish,centos,7) -# touch build/repo_finish +build/repo_oraclelinux_6: + $(call build_repo_rpm,oraclelinux,6,,) + touch build/repo_oraclelinux_6 -#define build_repo_deb -# docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \ -# -v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \ -# -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ -# --rm $1:$2 /app/repo/scripts/deb.sh -#endef -# -#define build_repo_rpm -# docker run -v $(WORKDIR)/build/pkg/$1/$2:/app/in -v $(WORKDIR)/packaging/repo:/app/repo \ -# -v $(WORKDIR)/packaging/repo:/app/repo -v $(WORKDIR)/build/www:/app/www \ -# -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ -# --rm $1:$2 /app/repo/scripts/rpm.sh -#endef +build/repo_oraclelinux_7: + $(call build_repo_rpm,oraclelinux,7,,) + touch build/repo_oraclelinux_7 + +build/repo_oraclelinux_8: + $(call build_repo_rpm,oraclelinux,8,,) + touch build/repo_oraclelinux_8 + +# RHEL +repo/rhel: build/repo_rhel_6 build/repo_rhel_7 build/repo_rhel_8 + @echo Build repo for rhel platforms: done + +build/repo_rhel_6: + $(call build_repo_rpm,rhel,6,,) + touch build/repo_rhel_6 + +build/repo_rhel_7: + $(call build_repo_rpm,rhel,7,,) + touch build/repo_rhel_7 + +build/repo_rhel_8: + $(call build_repo_rpm,rhel,8,,) + touch build/repo_rhel_8 + +# ALT +repo/alt: build/repo_alt_7 build/repo_alt_8 build/repo_alt_9 + @echo Build repo for alt platforms: done + +build/repo_alt_7: + $(call build_repo_alt,alt,7,,) + touch build/repo_alt_7 + +build/repo_alt_8: + $(call build_repo_alt,alt,8,,) + touch build/repo_alt_8 + +build/repo_alt_9: + $(call build_repo_alt,alt,9,,) + touch build/repo_alt_9 + +# SUSE +repo/suse: build/repo_suse_15.1 build/repo_suse_15.2 + @echo Build repo for suse platforms: done + +build/repo_suse_15.1: + $(call build_repo_suse,suse,15.1,,) + touch build/repo_suse_15.1 + +build/repo_suse_15.2: + $(call build_repo_suse,suse,15.2,,) + touch build/repo_suse_15.2 # #define repo_finish # docker run -v $(WORKDIR)/build/pkg/keys:/app/in -v $(WORKDIR)/build/www:/app/www \ @@ -325,3 +349,27 @@ define build_repo_rpm --name $1_$2_pbk_repo \ --rm pgpro/repo /app/repo/scripts/rpm.sh endef + +define build_repo_alt + docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/build/data/www:/app/www \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ + --name $1_$2_pbk_repo \ + --rm pgpro/$1:$2 /app/repo/scripts/alt.sh +endef + +define build_repo_suse + docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/build/data/www:/app/www \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ + --name $1_$2_pbk_repo \ + --rm pgpro/$1:$2 /app/repo/scripts/suse.sh +endef diff --git a/packaging/Readme.md b/packaging/Readme.md index 9c22bdc76..bd7ee081b 100644 --- a/packaging/Readme.md +++ b/packaging/Readme.md @@ -14,3 +14,7 @@ tar -cjSf pgpro.tar.bz2 pgpro ``` To build repo the gpg keys for package signing must be present ... +Repo must be build with 1 thread: +``` +make repo -j1 +``` diff --git a/packaging/repo/scripts/alt.sh b/packaging/repo/scripts/alt.sh new file mode 100755 index 000000000..283c347f2 --- /dev/null +++ b/packaging/repo/scripts/alt.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -exu +set -o errexit +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +export INPUT_DIR=/app/in #dir with builded rpm +export OUT_DIR=/app/www/${PBK_PKG_REPO} + +apt-get update -y +apt-get install -qq -y apt-repo-tools gnupg rsync perl less wget + +cd $INPUT_DIR + +cp -arv /app/repo/$PBK_PKG_REPO/gnupg /root/.gnupg +chmod -R 0600 /root/.gnupg +for pkg in $(ls); do + for pkg_full_version in $(ls ./$pkg); do + RPM_DIR=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/RPMS.vanilla + SRPM_DIR=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/SRPMS.vanilla + + # rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" + # rm -rf "$SRPM_DIR" && mkdir -p "$SRPM_DIR" + mkdir -p "$RPM_DIR" + mkdir -p "$SRPM_DIR" + + cp -arv $INPUT_DIR/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ + cp -arv $INPUT_DIR/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ + + genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ + --label='PostgreSQL backup utility pg_probackup' --description 'PostgreSQL pg_probackup repo' \ + --version=$pkg_full_version --bloat --progress --create \ + --topdir=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla + + genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ + --label='PostgreSQL backup utility pg_probackup sources' --description 'PostgreSQL pg_probackup repo' \ + --version=$pkg_full_version --bloat --progress --create \ + --topdir=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla + + # genbasedir --bloat --progress --create \ + # --topdir=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla + + # genbasedir --bloat --progress --create \ + # --topdir=${OUT_DIR}/$repo_name/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla + done +done + +# if [[ $repo_name == 'pg_probackup-forks' ]] +# then +# cd $INPUT_DIR/$repo_name +# cp -arv /app/src/$repo_name/gnupg /root/.gnupg +# chmod -R 0600 /root/.gnupg +# for pkg in $(ls); do +# for pkg_full_version in $(ls ./$pkg); do +# RPM_DIR=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/RPMS.forks +# +# # rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" +# mkdir -p "$RPM_DIR" +# +# cp -arv $INPUT_DIR/$repo_name/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ +# +# genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ +# --label='PostgrePro backup utility pg_probackup' --description 'PostgresPro pg_probackup repo' \ +# --version=$pkg_full_version --bloat --progress --create \ +# --topdir=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 forks +# +## genbasedir --bloat --progress --create \ +## --topdir=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 forks +# done +# done +# rm -rf /root/.gnupg +# fi diff --git a/packaging/repo/scripts/suse.sh b/packaging/repo/scripts/suse.sh new file mode 100755 index 000000000..f3ee95c30 --- /dev/null +++ b/packaging/repo/scripts/suse.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -ex +set -o errexit +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +export INPUT_DIR=/app/in #dir with builded rpm +export OUT_DIR=/app/www/${PBK_PKG_REPO} +export KEYS_DIR=$OUT_DIR/keys +# deploy keys + +zypper install -y createrepo +rm -rf /root/.gnupg + +cd $INPUT_DIR + +mkdir -p $KEYS_DIR +chmod 755 $KEYS_DIR +rsync /app/repo/$PBK_PKG_REPO/gnupg/key.public $KEYS_DIR/GPG-KEY-PG_PROBACKUP + +echo -e 'User-agent: *\nDisallow: /' > $OUT_DIR/robots.txt + +cp -arv /app/repo/$PBK_PKG_REPO/rpmmacros /root/.rpmmacros +cp -arv /app/repo/$PBK_PKG_REPO/gnupg /root/.gnupg +chmod -R 0600 /root/.gnupg + +for pkg in $(ls); do + for pkg_full_version in $(ls ./$pkg); do + + cp $INPUT_DIR/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ + $KEYS_DIR/pg_probackup-repo-$DISTRIB.noarch.rpm + [ ! -z "$CODENAME" ] && export DISTRIB_VERSION=$CODENAME + RPM_DIR=$OUT_DIR/rpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 + SRPM_DIR=$OUT_DIR/srpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 + + # rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" + # rm -rf "$SRPM_DIR" && mkdir -p "$SRPM_DIR" + mkdir -p "$RPM_DIR" + mkdir -p "$SRPM_DIR" + + cp -arv $INPUT_DIR/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ + cp -arv $INPUT_DIR/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ + + for f in $(ls $RPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done + for f in $(ls $SRPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done + + createrepo $RPM_DIR/ + createrepo $SRPM_DIR/ + + # rpm --addsign $RPM_DIR/repodata/repomd.xml + # rpm --addsign $SRPM_DIR/repodata/repomd.xml + done +done + +gpg -a --detach-sign $RPM_DIR/repodata/repomd.xml +gpg -a --detach-sign $SRPM_DIR/repodata/repomd.xml + +cp -a /root/.gnupg/key.public $RPM_DIR/repodata/repomd.xml.key +cp -a /root/.gnupg/key.public $SRPM_DIR/repodata/repomd.xml.key diff --git a/packaging/scripts/suse.sh b/packaging/scripts/suse.sh index 396e85598..5b9717e72 100755 --- a/packaging/scripts/suse.sh +++ b/packaging/scripts/suse.sh @@ -42,11 +42,6 @@ rm -rf pg_probackup-${PKG_VERSION} # Download PostgreSQL source wget -q http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 -O /root/rpmbuild/SOURCES/postgresql-${PG_VERSION}.tar.bz2 -#mv pg_probackup-${PKG_VERSION}.tar.bz2 /usr/src/packages/SOURCES/ -#mv postgresql-${PG_VERSION}.tar.bz2 /usr/src/packages/SOURCES/ -#cp -av /root/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP /usr/src/packages/SOURCES/GPG-KEY-PG_PROBACKUP -#cp -av /root/rpmbuild/SOURCES/pg_probackup.repo /usr/src/packages/SOURCES/pg_probackup.repo - rm -rf /usr/src/packages ln -s /root/rpmbuild /usr/src/packages @@ -91,9 +86,5 @@ rpmbuild -ba pg_probackup-repo.spec # write artefacts to out directory rm -rf /app/out/* -#sleep 100500 + cp -arv /root/rpmbuild/{RPMS,SRPMS} /app/out -#mkdir -p /app/out/RPMS/x86_64 -#mkdir -p /app/out/RPMS/noarch -#cp -arv /usr/src/packages/RPMS/x86_64/*rpm /app/out/RPMS/x86_64/ -#cp -arv /usr/src/packages/RPMS/noarch/*rpm /app/out/RPMS/noarch/ From a06638e36fc938a5fee8321c2754c20a0e42e617 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Wed, 4 Aug 2021 16:02:49 +0300 Subject: [PATCH 10/54] [skip travis] repo refactoring --- .gitignore | 4 +- Makefile | 17 ++ packaging/Makefile.pkg | 218 ++---------------- packaging/Makefile.repo | 175 ++++++++++++++ packaging/{ => pkg}/Makefile.alt | 0 packaging/{ => pkg}/Makefile.centos | 0 packaging/{ => pkg}/Makefile.debian | 0 packaging/{ => pkg}/Makefile.oraclelinux | 0 packaging/{ => pkg}/Makefile.rhel | 0 packaging/{ => pkg}/Makefile.suse | 0 packaging/{ => pkg}/Makefile.ubuntu | 0 packaging/{ => pkg}/scripts/alt.sh | 0 packaging/{ => pkg}/scripts/deb.sh | 0 .../pkg/scripts/pg_probackup-repo-forks.sh | 51 ++++ packaging/{ => pkg}/scripts/rpm.sh | 0 packaging/{ => pkg}/scripts/suse.sh | 0 .../specs/deb/pg_probackup/debian/changelog | 0 .../specs/deb/pg_probackup/debian/compat | 0 .../specs/deb/pg_probackup/debian/control | 0 .../pg_probackup/debian/pg_probackup.install | 0 .../specs/deb/pg_probackup/debian/rules | 0 .../deb/pg_probackup/debian/source/format | 0 .../rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP | 0 .../SOURCES/GPG-KEY-PG_PROBACKUP-FORKS | 0 .../rpmbuild/SOURCES/pg_probackup-forks.repo | 0 .../rpm/rpmbuild/SOURCES/pg_probackup.repo | 0 .../rpmbuild/SPECS/pg_probackup-pgpro.spec | 0 .../SPECS/pg_probackup-repo-forks.spec | 0 .../rpm/rpmbuild/SPECS/pg_probackup-repo.spec | 0 .../SPECS/pg_probackup.alt.forks.spec | 0 .../rpm/rpmbuild/SPECS/pg_probackup.alt.spec | 0 .../rpm/rpmbuild/SPECS/pg_probackup.spec | 0 packaging/{ => pkg}/tarballs/.gitkeep | 0 packaging/repo/scripts/rpm.sh | 4 +- packaging/repo/scripts/suse.sh | 12 +- 35 files changed, 267 insertions(+), 214 deletions(-) create mode 100644 packaging/Makefile.repo rename packaging/{ => pkg}/Makefile.alt (100%) rename packaging/{ => pkg}/Makefile.centos (100%) rename packaging/{ => pkg}/Makefile.debian (100%) rename packaging/{ => pkg}/Makefile.oraclelinux (100%) rename packaging/{ => pkg}/Makefile.rhel (100%) rename packaging/{ => pkg}/Makefile.suse (100%) rename packaging/{ => pkg}/Makefile.ubuntu (100%) rename packaging/{ => pkg}/scripts/alt.sh (100%) rename packaging/{ => pkg}/scripts/deb.sh (100%) create mode 100755 packaging/pkg/scripts/pg_probackup-repo-forks.sh rename packaging/{ => pkg}/scripts/rpm.sh (100%) rename packaging/{ => pkg}/scripts/suse.sh (100%) rename packaging/{ => pkg}/specs/deb/pg_probackup/debian/changelog (100%) rename packaging/{ => pkg}/specs/deb/pg_probackup/debian/compat (100%) rename packaging/{ => pkg}/specs/deb/pg_probackup/debian/control (100%) rename packaging/{ => pkg}/specs/deb/pg_probackup/debian/pg_probackup.install (100%) rename packaging/{ => pkg}/specs/deb/pg_probackup/debian/rules (100%) rename packaging/{ => pkg}/specs/deb/pg_probackup/debian/source/format (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec (100%) rename packaging/{ => pkg}/specs/rpm/rpmbuild/SPECS/pg_probackup.spec (100%) rename packaging/{ => pkg}/tarballs/.gitkeep (100%) diff --git a/.gitignore b/.gitignore index 3892c0da7..c0b4de331 100644 --- a/.gitignore +++ b/.gitignore @@ -56,7 +56,9 @@ # Packaging /build -/packaging/tarballs/pgpro.tar.bz2 +/packaging/pkg/tarballs/pgpro.tar.bz2 +/packaging/repo/pg_probackup +/packaging/repo/pg_probackup-forks # Misc .python-version diff --git a/Makefile b/Makefile index 8b2a26d56..bf0ffa120 100644 --- a/Makefile +++ b/Makefile @@ -81,4 +81,21 @@ ifeq ($(PORTNAME), aix) CC=xlc_r endif +check_env: + @if [ -z ${PBK_VERSION} ] ; then \ + echo "Env variable PBK_VERSION is not set" ; \ + false ; \ + fi + + @if [ -z ${PBK_RELEASE} ] ; then \ + echo "Env variable PBK_RELEASE is not set" ; \ + false ; \ + fi + + @if [ -z ${PBK_HASH} ] ; then \ + echo "Env variable PBK_HASH is not set" ; \ + false ; \ + fi + include packaging/Makefile.pkg +include packaging/Makefile.repo diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index c40332887..761d8094c 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -17,37 +17,17 @@ else PKG_NAME_SUFFIX = endif -#ifndef $(PG_VERSIONS) -#PG_VERSIONS = $(PG_VERSIONS_DEFAULT) -#endif pkg: check_env build/prepare build/all @echo Build for all platform: done -# echo "HELLO" - -check_env: - @if [ -z ${PBK_VERSION} ] ; then \ - echo "Env variable PBK_VERSION is not set" ; \ - false ; \ - fi - - @if [ -z ${PBK_RELEASE} ] ; then \ - echo "Env variable PBK_RELEASE is not set" ; \ - false ; \ - fi - - @if [ -z ${PBK_HASH} ] ; then \ - echo "Env variable PBK_HASH is not set" ; \ - false ; \ - fi build/prepare: mkdir -p build build/clean: build/prepare - rm -f build/build* + find build/ -maxdepth 1 -type f -exec rm -f {} \; -build/all: build/debian build/centos #build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/suse +build/all: build/debian build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/suse @echo Packaging is done ### DEBIAN @@ -82,7 +62,7 @@ build/ubuntu_20.04: build/ubuntu_20.04_9.5 build/ubuntu_20.04_9.6 build/ubuntu_2 define build_deb docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ - -v $(WORKDIR)/packaging:/app/in \ + -v $(WORKDIR)/packaging/pkg:/app/in \ -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg-probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \ @@ -91,8 +71,8 @@ define build_deb --rm pgpro/$1:$2 /app/in/scripts/deb.sh endef -include packaging/Makefile.debian -include packaging/Makefile.ubuntu +include packaging/pkg/Makefile.debian +include packaging/pkg/Makefile.ubuntu # CENTOS build/centos: build/centos_6 #build/centos_7 build/centos_8 #build/rpm_repo_package_centos @@ -137,7 +117,7 @@ build/rhel_8: build/rhel_8_9.5 build/rhel_8_9.6 build/rhel_8_10 build/rhel_8_11 define build_rpm docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ - -v $(WORKDIR)/packaging:/app/in \ + -v $(WORKDIR)/packaging/pkg:/app/in \ -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ @@ -146,9 +126,9 @@ define build_rpm --rm pgpro/$1:$2 /app/in/scripts/rpm.sh endef -include packaging/Makefile.centos -include packaging/Makefile.rhel -include packaging/Makefile.oraclelinux +include packaging/pkg/Makefile.centos +include packaging/pkg/Makefile.rhel +include packaging/pkg/Makefile.oraclelinux # Alt Linux @@ -167,7 +147,7 @@ build/alt_9: build/alt_9_9.5 build/alt_9_9.6 build/alt_9_10 build/alt_9_11 build define build_alt docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ - -v $(WORKDIR)/packaging:/app/in \ + -v $(WORKDIR)/packaging/pkg:/app/in \ -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ @@ -176,7 +156,7 @@ define build_alt --rm pgpro/$1:$2 /app/in/scripts/alt.sh endef -include packaging/Makefile.alt +include packaging/pkg/Makefile.alt # SUSE Linux build/suse: build/suse_15.1 build/suse_15.2 @@ -191,7 +171,7 @@ build/suse_15.2: build/suse_15.2_9.5 build/suse_15.2_9.6 build/suse_15.2_10 buil define build_suse docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ - -v $(WORKDIR)/packaging:/app/in \ + -v $(WORKDIR)/packaging/pkg:/app/in \ -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2/pg_probackup-$(PKG_NAME_SUFFIX)$4/$(PBK_VERSION):/app/out \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ @@ -200,176 +180,4 @@ define build_suse --rm pgpro/$1:$2 /app/in/scripts/suse.sh endef -include packaging/Makefile.suse - -#### REPO BUILD #### - -repo: repo/debian repo/ubuntu repo/centos repo/rhel repo/oraclelinux repo/alt repo/suse - @echo Build repo for all platform: done - -# Debian -repo/debian: build/repo_debian_8 repo/debian_9 repo/debian_10 - @echo Build repo for debian platforms: done - -build/repo_debian_8: - $(call build_repo_deb,debian,8,jessie) - touch build/repo_debian_8 - -build/repo_debian_9: - $(call build_repo_deb,debian,9,stretch) - touch build/repo_debian_9 - -build/repo_debian_10: - $(call build_repo_deb,debian,10,buster) - touch build/repo_debian_10 - -# Ubuntu -repo/ubuntu: build/repo_ubuntu_14.04 build/repo_ubuntu_16.04 build/repo_ubuntu_18.04 build/repo_ubuntu_20.04 - @echo Build repo for ubuntu platforms: done - -build/repo_ubuntu_14.04: - $(call build_repo_deb,ubuntu,14.04,trusty) - touch build/repo_ubuntu_14.04 - -build/repo_ubuntu_16.04: - $(call build_repo_deb,ubuntu,16.04,xenial) - touch build/repo_ubuntu_16.04 - -build/repo_ubuntu_18.04: - $(call build_repo_deb,ubuntu,18.04,bionic) - touch build/repo_ubuntu_18.04 - -build/repo_ubuntu_20.04: - $(call build_repo_deb,ubuntu,20.04,focal) - touch build/repo_ubuntu_20.04 - -# Centos -repo/centos: build/repo_centos_6 build/repo_centos_7 build/repo_centos_8 - @echo Build repo for centos platforms: done - -build/repo_centos_6: - $(call build_repo_rpm,centos,6,,) - touch build/repo_centos_6 - -build/repo_centos_7: - $(call build_repo_rpm,centos,7,,) - touch build/repo_centos_7 - -build/repo_centos_8: - $(call build_repo_rpm,centos,8,,) - touch build/repo_centos_8 - -# Oraclelinux -repo/oraclelinux: build/repo_oraclelinux_6 build/repo_oraclelinux_7 build/repo_oraclelinux_8 - @echo Build repo for oraclelinux platforms: done - -build/repo_oraclelinux_6: - $(call build_repo_rpm,oraclelinux,6,,) - touch build/repo_oraclelinux_6 - -build/repo_oraclelinux_7: - $(call build_repo_rpm,oraclelinux,7,,) - touch build/repo_oraclelinux_7 - -build/repo_oraclelinux_8: - $(call build_repo_rpm,oraclelinux,8,,) - touch build/repo_oraclelinux_8 - -# RHEL -repo/rhel: build/repo_rhel_6 build/repo_rhel_7 build/repo_rhel_8 - @echo Build repo for rhel platforms: done - -build/repo_rhel_6: - $(call build_repo_rpm,rhel,6,,) - touch build/repo_rhel_6 - -build/repo_rhel_7: - $(call build_repo_rpm,rhel,7,,) - touch build/repo_rhel_7 - -build/repo_rhel_8: - $(call build_repo_rpm,rhel,8,,) - touch build/repo_rhel_8 - -# ALT -repo/alt: build/repo_alt_7 build/repo_alt_8 build/repo_alt_9 - @echo Build repo for alt platforms: done - -build/repo_alt_7: - $(call build_repo_alt,alt,7,,) - touch build/repo_alt_7 - -build/repo_alt_8: - $(call build_repo_alt,alt,8,,) - touch build/repo_alt_8 - -build/repo_alt_9: - $(call build_repo_alt,alt,9,,) - touch build/repo_alt_9 - -# SUSE -repo/suse: build/repo_suse_15.1 build/repo_suse_15.2 - @echo Build repo for suse platforms: done - -build/repo_suse_15.1: - $(call build_repo_suse,suse,15.1,,) - touch build/repo_suse_15.1 - -build/repo_suse_15.2: - $(call build_repo_suse,suse,15.2,,) - touch build/repo_suse_15.2 -# -#define repo_finish -# docker run -v $(WORKDIR)/build/pkg/keys:/app/in -v $(WORKDIR)/build/www:/app/www \ -# -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ -# --rm $1:$2 bash -exc "cp -av /app/in/*rpm /app/www/mamonsu/keys && cd /app/www/mamonsu/ && \ -# ln -s $(VERSION) latest" -#endef - -define build_repo_deb - docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ - docker run \ - -v $(WORKDIR)/packaging/repo:/app/repo \ - -v $(WORKDIR)/build/data/www:/app/www \ - -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ - -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ - -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ - --name $1_$2_pbk_repo \ - --rm pgpro/repo /app/repo/scripts/deb.sh -endef - -define build_repo_rpm - docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ - docker run \ - -v $(WORKDIR)/packaging/repo:/app/repo \ - -v $(WORKDIR)/build/data/www:/app/www \ - -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ - -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ - -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ - --name $1_$2_pbk_repo \ - --rm pgpro/repo /app/repo/scripts/rpm.sh -endef - -define build_repo_alt - docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ - docker run \ - -v $(WORKDIR)/packaging/repo:/app/repo \ - -v $(WORKDIR)/build/data/www:/app/www \ - -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ - -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ - -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ - --name $1_$2_pbk_repo \ - --rm pgpro/$1:$2 /app/repo/scripts/alt.sh -endef - -define build_repo_suse - docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ - docker run \ - -v $(WORKDIR)/packaging/repo:/app/repo \ - -v $(WORKDIR)/build/data/www:/app/www \ - -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ - -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ - -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ - --name $1_$2_pbk_repo \ - --rm pgpro/$1:$2 /app/repo/scripts/suse.sh -endef +include packaging/pkg/Makefile.suse diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo new file mode 100644 index 000000000..e4eb08961 --- /dev/null +++ b/packaging/Makefile.repo @@ -0,0 +1,175 @@ +#### REPO BUILD #### +repo: check_env repo/debian repo/ubuntu repo/centos repo/rhel repo/oraclelinux repo/alt repo/suse repo_finish + @echo Build repo for all platform: done + +# Debian +repo/debian: build/repo_debian_8 build/repo_debian_9 build/repo_debian_10 + @echo Build repo for debian platforms: done + +build/repo_debian_8: + $(call build_repo_deb,debian,8,jessie) + touch build/repo_debian_8 + +build/repo_debian_9: + $(call build_repo_deb,debian,9,stretch) + touch build/repo_debian_9 + +build/repo_debian_10: + $(call build_repo_deb,debian,10,buster) + touch build/repo_debian_10 + +# Ubuntu +repo/ubuntu: build/repo_ubuntu_14.04 build/repo_ubuntu_16.04 build/repo_ubuntu_18.04 build/repo_ubuntu_20.04 + @echo Build repo for ubuntu platforms: done + +build/repo_ubuntu_14.04: + $(call build_repo_deb,ubuntu,14.04,trusty) + touch build/repo_ubuntu_14.04 + +build/repo_ubuntu_16.04: + $(call build_repo_deb,ubuntu,16.04,xenial) + touch build/repo_ubuntu_16.04 + +build/repo_ubuntu_18.04: + $(call build_repo_deb,ubuntu,18.04,bionic) + touch build/repo_ubuntu_18.04 + +build/repo_ubuntu_20.04: + $(call build_repo_deb,ubuntu,20.04,focal) + touch build/repo_ubuntu_20.04 + +# Centos +repo/centos: build/repo_centos_6 build/repo_centos_7 build/repo_centos_8 + @echo Build repo for centos platforms: done + +build/repo_centos_6: + $(call build_repo_rpm,centos,6,,) + touch build/repo_centos_6 + +build/repo_centos_7: + $(call build_repo_rpm,centos,7,,) + touch build/repo_centos_7 + +build/repo_centos_8: + $(call build_repo_rpm,centos,8,,) + touch build/repo_centos_8 + +# Oraclelinux +repo/oraclelinux: build/repo_oraclelinux_6 build/repo_oraclelinux_7 build/repo_oraclelinux_8 + @echo Build repo for oraclelinux platforms: done + +build/repo_oraclelinux_6: + $(call build_repo_rpm,oraclelinux,6,,) + touch build/repo_oraclelinux_6 + +build/repo_oraclelinux_7: + $(call build_repo_rpm,oraclelinux,7,,) + touch build/repo_oraclelinux_7 + +build/repo_oraclelinux_8: + $(call build_repo_rpm,oraclelinux,8,,) + touch build/repo_oraclelinux_8 + +# RHEL +repo/rhel: build/repo_rhel_6 build/repo_rhel_7 build/repo_rhel_8 + @echo Build repo for rhel platforms: done + +build/repo_rhel_6: + $(call build_repo_rpm,rhel,6,,) + touch build/repo_rhel_6 + +build/repo_rhel_7: + $(call build_repo_rpm,rhel,7,,) + touch build/repo_rhel_7 + +build/repo_rhel_8: + $(call build_repo_rpm,rhel,8,,) + touch build/repo_rhel_8 + +# ALT +repo/alt: build/repo_alt_7 build/repo_alt_8 build/repo_alt_9 + @echo Build repo for alt platforms: done + +build/repo_alt_7: + $(call build_repo_alt,alt,7,,) + touch build/repo_alt_7 + +build/repo_alt_8: + $(call build_repo_alt,alt,8,,) + touch build/repo_alt_8 + +build/repo_alt_9: + $(call build_repo_alt,alt,9,,) + touch build/repo_alt_9 + +# SUSE +repo/suse: build/repo_suse_15.1 build/repo_suse_15.2 + @echo Build repo for suse platforms: done + +build/repo_suse_15.1: + $(call build_repo_suse,suse,15.1,,) + touch build/repo_suse_15.1 + +build/repo_suse_15.2: + $(call build_repo_suse,suse,15.2,,) + touch build/repo_suse_15.2 + +repo_finish: + cd build/data/www/$(PBK_PKG_REPO)/rpm + sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/rpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/rpm/latest + sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/srpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/srpm/latest + +#define repo_finish +# docker run -v $(WORKDIR)/build/pkg/keys:/app/in -v $(WORKDIR)/build/www:/app/www \ +# -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ +# --rm $1:$2 bash -exc "cp -av /app/in/*rpm /app/www/mamonsu/keys && cd /app/www/mamonsu/ && \ +# ln -s $(VERSION) latest" +#endef + +define build_repo_deb + docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/build/data/www:/app/www \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ + --name $1_$2_pbk_repo \ + --rm pgpro/repo /app/repo/scripts/deb.sh +endef + +define build_repo_rpm + docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/build/data/www:/app/www \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ + --name $1_$2_pbk_repo \ + --rm pgpro/repo /app/repo/scripts/rpm.sh +endef + +define build_repo_alt + docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/build/data/www:/app/www \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ + --name $1_$2_pbk_repo \ + --rm pgpro/$1:$2 /app/repo/scripts/alt.sh +endef + +define build_repo_suse + docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/repo:/app/repo \ + -v $(WORKDIR)/build/data/www:/app/www \ + -v $(WORKDIR)/build/data/$(PBK_PKG_REPO)/$1/$2:/app/in \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ + -e "PBK_PKG_REPO=$(PBK_PKG_REPO)" -e "PBK_EDITION=$(PBK_EDITION)" \ + --name $1_$2_pbk_repo \ + --rm pgpro/$1:$2 /app/repo/scripts/suse.sh +endef diff --git a/packaging/Makefile.alt b/packaging/pkg/Makefile.alt similarity index 100% rename from packaging/Makefile.alt rename to packaging/pkg/Makefile.alt diff --git a/packaging/Makefile.centos b/packaging/pkg/Makefile.centos similarity index 100% rename from packaging/Makefile.centos rename to packaging/pkg/Makefile.centos diff --git a/packaging/Makefile.debian b/packaging/pkg/Makefile.debian similarity index 100% rename from packaging/Makefile.debian rename to packaging/pkg/Makefile.debian diff --git a/packaging/Makefile.oraclelinux b/packaging/pkg/Makefile.oraclelinux similarity index 100% rename from packaging/Makefile.oraclelinux rename to packaging/pkg/Makefile.oraclelinux diff --git a/packaging/Makefile.rhel b/packaging/pkg/Makefile.rhel similarity index 100% rename from packaging/Makefile.rhel rename to packaging/pkg/Makefile.rhel diff --git a/packaging/Makefile.suse b/packaging/pkg/Makefile.suse similarity index 100% rename from packaging/Makefile.suse rename to packaging/pkg/Makefile.suse diff --git a/packaging/Makefile.ubuntu b/packaging/pkg/Makefile.ubuntu similarity index 100% rename from packaging/Makefile.ubuntu rename to packaging/pkg/Makefile.ubuntu diff --git a/packaging/scripts/alt.sh b/packaging/pkg/scripts/alt.sh similarity index 100% rename from packaging/scripts/alt.sh rename to packaging/pkg/scripts/alt.sh diff --git a/packaging/scripts/deb.sh b/packaging/pkg/scripts/deb.sh similarity index 100% rename from packaging/scripts/deb.sh rename to packaging/pkg/scripts/deb.sh diff --git a/packaging/pkg/scripts/pg_probackup-repo-forks.sh b/packaging/pkg/scripts/pg_probackup-repo-forks.sh new file mode 100755 index 000000000..eaac9eca6 --- /dev/null +++ b/packaging/pkg/scripts/pg_probackup-repo-forks.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +# PACKAGES NEEDED +yum install -y rpm-build + +mkdir /root/build +cd /root/build +rpm --rebuilddb && yum clean all + +if [ $DISTRIB == 'centos' ] + then export SHORT_CODENAME='Centos' +elif [ $DISTRIB == 'rhel' ] + then export SHORT_CODENAME='RedHat' +elif [ $DISTRIB == 'oraclelinux' ] + then export SHORT_CODENAME='Oracle Linux' +fi + +# Copy rpmbuild +cp -rv /app/src/rpm/rpmbuild /root/ + +# change to build dir +cd /root/rpmbuild/SOURCES +sed -i "s/@DISTRIB@/${DISTRIB}/" pg_probackup-forks.repo +sed -i "s/@SHORT_CODENAME@/${SHORT_CODENAME}/" pg_probackup-forks.repo + +cd /root/rpmbuild/SPECS +sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup-repo-forks.spec +sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup-repo-forks.spec + +# install dependencies +yum-builddep -y pg_probackup-repo-forks.spec + +# build repo files +# rpmbuild -bs pg_probackup-repo-pgpro.spec +rpmbuild -ba pg_probackup-repo-forks.spec + +# write artefacts to out directory +rm -rf /app/out/* +# cp -arv /root/rpmbuild/{RPMS,SRPMS} /app/out +cp -arv /root/rpmbuild/RPMS /app/out diff --git a/packaging/scripts/rpm.sh b/packaging/pkg/scripts/rpm.sh similarity index 100% rename from packaging/scripts/rpm.sh rename to packaging/pkg/scripts/rpm.sh diff --git a/packaging/scripts/suse.sh b/packaging/pkg/scripts/suse.sh similarity index 100% rename from packaging/scripts/suse.sh rename to packaging/pkg/scripts/suse.sh diff --git a/packaging/specs/deb/pg_probackup/debian/changelog b/packaging/pkg/specs/deb/pg_probackup/debian/changelog similarity index 100% rename from packaging/specs/deb/pg_probackup/debian/changelog rename to packaging/pkg/specs/deb/pg_probackup/debian/changelog diff --git a/packaging/specs/deb/pg_probackup/debian/compat b/packaging/pkg/specs/deb/pg_probackup/debian/compat similarity index 100% rename from packaging/specs/deb/pg_probackup/debian/compat rename to packaging/pkg/specs/deb/pg_probackup/debian/compat diff --git a/packaging/specs/deb/pg_probackup/debian/control b/packaging/pkg/specs/deb/pg_probackup/debian/control similarity index 100% rename from packaging/specs/deb/pg_probackup/debian/control rename to packaging/pkg/specs/deb/pg_probackup/debian/control diff --git a/packaging/specs/deb/pg_probackup/debian/pg_probackup.install b/packaging/pkg/specs/deb/pg_probackup/debian/pg_probackup.install similarity index 100% rename from packaging/specs/deb/pg_probackup/debian/pg_probackup.install rename to packaging/pkg/specs/deb/pg_probackup/debian/pg_probackup.install diff --git a/packaging/specs/deb/pg_probackup/debian/rules b/packaging/pkg/specs/deb/pg_probackup/debian/rules similarity index 100% rename from packaging/specs/deb/pg_probackup/debian/rules rename to packaging/pkg/specs/deb/pg_probackup/debian/rules diff --git a/packaging/specs/deb/pg_probackup/debian/source/format b/packaging/pkg/specs/deb/pg_probackup/debian/source/format similarity index 100% rename from packaging/specs/deb/pg_probackup/debian/source/format rename to packaging/pkg/specs/deb/pg_probackup/debian/source/format diff --git a/packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP b/packaging/pkg/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP similarity index 100% rename from packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP rename to packaging/pkg/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP diff --git a/packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS b/packaging/pkg/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS similarity index 100% rename from packaging/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS rename to packaging/pkg/specs/rpm/rpmbuild/SOURCES/GPG-KEY-PG_PROBACKUP-FORKS diff --git a/packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo b/packaging/pkg/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo similarity index 100% rename from packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo rename to packaging/pkg/specs/rpm/rpmbuild/SOURCES/pg_probackup-forks.repo diff --git a/packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo b/packaging/pkg/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo similarity index 100% rename from packaging/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo rename to packaging/pkg/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec similarity index 100% rename from packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec rename to packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec similarity index 100% rename from packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec rename to packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-repo-forks.spec diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec similarity index 100% rename from packaging/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec rename to packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec similarity index 100% rename from packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec rename to packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.forks.spec diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec similarity index 100% rename from packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec rename to packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec diff --git a/packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec similarity index 100% rename from packaging/specs/rpm/rpmbuild/SPECS/pg_probackup.spec rename to packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec diff --git a/packaging/tarballs/.gitkeep b/packaging/pkg/tarballs/.gitkeep similarity index 100% rename from packaging/tarballs/.gitkeep rename to packaging/pkg/tarballs/.gitkeep diff --git a/packaging/repo/scripts/rpm.sh b/packaging/repo/scripts/rpm.sh index 65962abb7..cf6ae9a59 100755 --- a/packaging/repo/scripts/rpm.sh +++ b/packaging/repo/scripts/rpm.sh @@ -30,8 +30,8 @@ cp -arv /app/repo/$PBK_PKG_REPO/gnupg /root/.gnupg chmod -R 0600 /root/.gnupg chown -R root:root /root/.gnupg -for pkg in $(ls); do - for pkg_full_version in $(ls ./$pkg); do +for pkg in $(ls ${INPUT_DIR}); do + for pkg_full_version in $(ls ${INPUT_DIR}/$pkg); do cp $INPUT_DIR/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ $KEYS_DIR/pg_probackup-repo-$DISTRIB.noarch.rpm diff --git a/packaging/repo/scripts/suse.sh b/packaging/repo/scripts/suse.sh index f3ee95c30..dcd9e8811 100755 --- a/packaging/repo/scripts/suse.sh +++ b/packaging/repo/scripts/suse.sh @@ -57,11 +57,11 @@ for pkg in $(ls); do # rpm --addsign $RPM_DIR/repodata/repomd.xml # rpm --addsign $SRPM_DIR/repodata/repomd.xml - done -done -gpg -a --detach-sign $RPM_DIR/repodata/repomd.xml -gpg -a --detach-sign $SRPM_DIR/repodata/repomd.xml + gpg --batch --yes -a --detach-sign $RPM_DIR/repodata/repomd.xml + gpg --batch --yes -a --detach-sign $SRPM_DIR/repodata/repomd.xml -cp -a /root/.gnupg/key.public $RPM_DIR/repodata/repomd.xml.key -cp -a /root/.gnupg/key.public $SRPM_DIR/repodata/repomd.xml.key + cp -a /root/.gnupg/key.public $RPM_DIR/repodata/repomd.xml.key + cp -a /root/.gnupg/key.public $SRPM_DIR/repodata/repomd.xml.key + done +done From ec734f37613b4ec4962e43e9a1255abf84585eaf Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Wed, 4 Aug 2021 16:03:56 +0300 Subject: [PATCH 11/54] [skip travis] minor cleanup --- .../pkg/scripts/pg_probackup-repo-forks.sh | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100755 packaging/pkg/scripts/pg_probackup-repo-forks.sh diff --git a/packaging/pkg/scripts/pg_probackup-repo-forks.sh b/packaging/pkg/scripts/pg_probackup-repo-forks.sh deleted file mode 100755 index eaac9eca6..000000000 --- a/packaging/pkg/scripts/pg_probackup-repo-forks.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -# Copyright Notice: -# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ -# Distributed under Apache License 2.0 -# Распространяется по лицензии Apache 2.0 - -set -xe -set -o pipefail - -# fix https://github.com/moby/moby/issues/23137 -ulimit -n 1024 - -# PACKAGES NEEDED -yum install -y rpm-build - -mkdir /root/build -cd /root/build -rpm --rebuilddb && yum clean all - -if [ $DISTRIB == 'centos' ] - then export SHORT_CODENAME='Centos' -elif [ $DISTRIB == 'rhel' ] - then export SHORT_CODENAME='RedHat' -elif [ $DISTRIB == 'oraclelinux' ] - then export SHORT_CODENAME='Oracle Linux' -fi - -# Copy rpmbuild -cp -rv /app/src/rpm/rpmbuild /root/ - -# change to build dir -cd /root/rpmbuild/SOURCES -sed -i "s/@DISTRIB@/${DISTRIB}/" pg_probackup-forks.repo -sed -i "s/@SHORT_CODENAME@/${SHORT_CODENAME}/" pg_probackup-forks.repo - -cd /root/rpmbuild/SPECS -sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup-repo-forks.spec -sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup-repo-forks.spec - -# install dependencies -yum-builddep -y pg_probackup-repo-forks.spec - -# build repo files -# rpmbuild -bs pg_probackup-repo-pgpro.spec -rpmbuild -ba pg_probackup-repo-forks.spec - -# write artefacts to out directory -rm -rf /app/out/* -# cp -arv /root/rpmbuild/{RPMS,SRPMS} /app/out -cp -arv /root/rpmbuild/RPMS /app/out From 52462a1272ab9b0ff62dbea2e6fde36efd2d1039 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Wed, 4 Aug 2021 16:49:48 +0300 Subject: [PATCH 12/54] [skip travis] minor fix --- packaging/Makefile.pkg | 13 ++++++------- packaging/Readme.md | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 761d8094c..da1bb8a73 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -17,7 +17,6 @@ else PKG_NAME_SUFFIX = endif - pkg: check_env build/prepare build/all @echo Build for all platform: done @@ -31,10 +30,10 @@ build/all: build/debian build/ubuntu build/centos build/oraclelinux build/rhel b @echo Packaging is done ### DEBIAN -build/debian: build/debian_8 #build/debian_9 build/debian_10 +build/debian: build/debian_8 build/debian_9 build/debian_10 @echo Debian: done -build/debian_8: build/debian_8_9.5 #build/debian_8_9.6 build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13 +build/debian_8: build/debian_8_9.5 build/debian_8_9.6 build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13 @echo Debian 8: done build/debian_9: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13 @@ -67,7 +66,7 @@ define build_deb -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ - --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ --rm pgpro/$1:$2 /app/in/scripts/deb.sh endef @@ -122,7 +121,7 @@ define build_rpm -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ - --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ --rm pgpro/$1:$2 /app/in/scripts/rpm.sh endef @@ -152,7 +151,7 @@ define build_alt -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ - --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ --rm pgpro/$1:$2 /app/in/scripts/alt.sh endef @@ -176,7 +175,7 @@ define build_suse -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ - --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ --rm pgpro/$1:$2 /app/in/scripts/suse.sh endef diff --git a/packaging/Readme.md b/packaging/Readme.md index bd7ee081b..67f702f1b 100644 --- a/packaging/Readme.md +++ b/packaging/Readme.md @@ -2,7 +2,7 @@ export PBK_VERSION=2.4.17 export PBK_HASH=57f871accce2604 export PBK_RELEASE=1 -export PBK_EDITION=std +export PBK_EDITION=std|ent make pkg ``` From 9c89134d04fe1a9897ab129b3845daa4eb20d5c8 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Wed, 4 Aug 2021 17:15:36 +0300 Subject: [PATCH 13/54] [skip travis] minor fix --- packaging/Makefile.pkg | 4 ++-- packaging/Makefile.repo | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index da1bb8a73..2d148653e 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -74,10 +74,10 @@ include packaging/pkg/Makefile.debian include packaging/pkg/Makefile.ubuntu # CENTOS -build/centos: build/centos_6 #build/centos_7 build/centos_8 #build/rpm_repo_package_centos +build/centos: build/centos_6 build/centos_7 build/centos_8 #build/rpm_repo_package_centos @echo Centos: done -build/centos_6: build/centos_6_9.5 #build/centos_6_9.6 build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 +build/centos_6: build/centos_6_9.5 build/centos_6_9.6 build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 @echo Centos 6: done build/centos_7: build/centos_7_9.5 build/centos_7_9.6 build/centos_7_10 build/centos_7_11 build/centos_7_12 build/centos_7_13 diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index e4eb08961..ee2535ce8 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -119,13 +119,6 @@ repo_finish: sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/rpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/rpm/latest sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/srpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/srpm/latest -#define repo_finish -# docker run -v $(WORKDIR)/build/pkg/keys:/app/in -v $(WORKDIR)/build/www:/app/www \ -# -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" \ -# --rm $1:$2 bash -exc "cp -av /app/in/*rpm /app/www/mamonsu/keys && cd /app/www/mamonsu/ && \ -# ln -s $(VERSION) latest" -#endef - define build_repo_deb docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ docker run \ From ad111ce850c395527c501fa48379fa00a31f9c3b Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 13:29:46 +0300 Subject: [PATCH 14/54] [skip travis] pkg testing infrastructure --- Makefile | 20 ++++--------------- packaging/Makefile.pkg | 18 ++++++++++++++--- packaging/Readme.md | 3 ++- packaging/pkg/scripts/rpm.sh | 2 +- .../rpmbuild/SPECS/pg_probackup-pgpro.spec | 2 +- .../rpm/rpmbuild/SPECS/pg_probackup.alt.spec | 2 +- .../rpm/rpmbuild/SPECS/pg_probackup.spec | 2 +- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index bf0ffa120..4e463bf7c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,7 @@ PROGRAM = pg_probackup +WORKDIR ?= $(CURDIR) +BUILDDIR = $(WORKDIR)/build/ +PBK_GIT_REPO = http://github.com/postgrespro/pg_probackup # utils OBJS = src/utils/configuration.o src/utils/json.o src/utils/logger.o \ @@ -81,21 +84,6 @@ ifeq ($(PORTNAME), aix) CC=xlc_r endif -check_env: - @if [ -z ${PBK_VERSION} ] ; then \ - echo "Env variable PBK_VERSION is not set" ; \ - false ; \ - fi - - @if [ -z ${PBK_RELEASE} ] ; then \ - echo "Env variable PBK_RELEASE is not set" ; \ - false ; \ - fi - - @if [ -z ${PBK_HASH} ] ; then \ - echo "Env variable PBK_HASH is not set" ; \ - false ; \ - fi - include packaging/Makefile.pkg include packaging/Makefile.repo +include packaging/Makefile.test diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 2d148653e..2a4bbf2e2 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -1,6 +1,18 @@ -WORKDIR ?= $(CURDIR) -BUILDDIR = $(WORKDIR)/build/ -PBK_GIT_REPO = http://github.com/postgrespro/pg_probackup +check_env: + @if [ -z ${PBK_VERSION} ] ; then \ + echo "Env variable PBK_VERSION is not set" ; \ + false ; \ + fi + + @if [ -z ${PBK_RELEASE} ] ; then \ + echo "Env variable PBK_RELEASE is not set" ; \ + false ; \ + fi + + @if [ -z ${PBK_HASH} ] ; then \ + echo "Env variable PBK_HASH is not set" ; \ + false ; \ + fi ifeq ($(PBK_EDITION),std) PBK_PKG_REPO = pg_probackup-forks diff --git a/packaging/Readme.md b/packaging/Readme.md index 67f702f1b..c6cbf16b5 100644 --- a/packaging/Readme.md +++ b/packaging/Readme.md @@ -1,3 +1,4 @@ +Example: ``` export PBK_VERSION=2.4.17 export PBK_HASH=57f871accce2604 @@ -14,7 +15,7 @@ tar -cjSf pgpro.tar.bz2 pgpro ``` To build repo the gpg keys for package signing must be present ... -Repo must be build with 1 thread: +Repo must be build using 1 thread (due to debian bullshit): ``` make repo -j1 ``` diff --git a/packaging/pkg/scripts/rpm.sh b/packaging/pkg/scripts/rpm.sh index aa23bcc7c..9ed90a6a1 100755 --- a/packaging/pkg/scripts/rpm.sh +++ b/packaging/pkg/scripts/rpm.sh @@ -53,7 +53,7 @@ if [[ ${PBK_EDITION} == '' ]] ; then sed -i "s/@PG_VERSION@/${PKG_VERSION}/" pg_probackup.repo # Download PostgreSQL source - wget http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 -O /root/rpmbuild/SOURCES/postgresql-${PG_VERSION}.tar.bz2 + wget -q http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 -O /root/rpmbuild/SOURCES/postgresql-${PG_VERSION}.tar.bz2 # change to build dir cd /root/rpmbuild/SOURCES diff --git a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec index 11b3d8c6c..80d7087d1 100644 --- a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec +++ b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec @@ -44,7 +44,7 @@ cd %{_topdir}/BUILD/postgrespro-%{edition}-%{pgsql_full} %if "%{pgsql_major}" == "9.6" ./configure --enable-debug %else -./configure --enable-debug --prefix=%{prefix} +./configure --enable-debug --without-readline --prefix=%{prefix} %endif make -C 'src/common' make -C 'src/port' diff --git a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec index 3a84635fc..3105ffa67 100644 --- a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec +++ b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec @@ -26,7 +26,7 @@ Backup tool for PostgreSQL. %build mv %{_builddir}/pg_probackup-%{version} contrib/pg_probackup -./configure --enable-debug +./configure --enable-debug --without-readline make -C 'src/common' make -C 'src/port' make -C 'src/interfaces' diff --git a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec index bf6e112ff..927642074 100644 --- a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec +++ b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec @@ -23,7 +23,7 @@ Backup tool for PostgreSQL. %build mv %{_builddir}/pg_probackup-%{version} contrib/pg_probackup -./configure --enable-debug +./configure --enable-debug --without-readline make -C 'src/common' make -C 'src/port' make -C 'src/interfaces' From a748784b086adbddd743936ae3a730b7dde40867 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 13:32:41 +0300 Subject: [PATCH 15/54] [skip travis] pkg testing infrastructure --- packaging/Dockerfiles/Dockerfile-altlinux_8 | 5 + packaging/Dockerfiles/Dockerfile-altlinux_9 | 5 + packaging/Dockerfiles/Dockerfile-astra_1.11 | 7 + packaging/Dockerfiles/Dockerfile-centos_6 | 5 + packaging/Dockerfiles/Dockerfile-centos_7 | 5 + packaging/Dockerfiles/Dockerfile-centos_8 | 5 + packaging/Dockerfiles/Dockerfile-createrepo1C | 4 + packaging/Dockerfiles/Dockerfile-debian_10 | 7 + packaging/Dockerfiles/Dockerfile-debian_8 | 7 + packaging/Dockerfiles/Dockerfile-debian_9 | 7 + .../Dockerfiles/Dockerfile-oraclelinux_6 | 5 + .../Dockerfiles/Dockerfile-oraclelinux_7 | 5 + .../Dockerfiles/Dockerfile-oraclelinux_8 | 5 + packaging/Dockerfiles/Dockerfile-rhel_7 | 5 + packaging/Dockerfiles/Dockerfile-rhel_8 | 5 + packaging/Dockerfiles/Dockerfile-rosa_6 | 5 + packaging/Dockerfiles/Dockerfile-suse_15.1 | 4 + packaging/Dockerfiles/Dockerfile-suse_15.2 | 4 + packaging/Dockerfiles/Dockerfile-ubuntu_14.04 | 7 + packaging/Dockerfiles/Dockerfile-ubuntu_16.04 | 7 + packaging/Dockerfiles/Dockerfile-ubuntu_18.04 | 7 + packaging/Dockerfiles/Dockerfile-ubuntu_18.10 | 7 + packaging/Dockerfiles/Dockerfile-ubuntu_20.04 | 8 + packaging/Makefile.test | 156 ++++++++++++++++ packaging/test/Makefile.alt | 74 ++++++++ packaging/test/Makefile.centos | 74 ++++++++ packaging/test/Makefile.debian | 74 ++++++++ packaging/test/Makefile.oraclelinux | 74 ++++++++ packaging/test/Makefile.rhel | 74 ++++++++ packaging/test/Makefile.suse | 49 +++++ packaging/test/Makefile.ubuntu | 99 ++++++++++ packaging/test/scripts/alt.sh | 71 +++++++ packaging/test/scripts/deb.sh | 153 +++++++++++++++ .../test/scripts/pg_probackup_alt_forks.sh | 75 ++++++++ .../test/scripts/pg_probackup_forks_deb.sh | 155 ++++++++++++++++ .../test/scripts/pg_probackup_forks_rpm.sh | 173 +++++++++++++++++ packaging/test/scripts/rpm.sh | 166 +++++++++++++++++ packaging/test/scripts/suse.sh | 174 ++++++++++++++++++ 38 files changed, 1772 insertions(+) create mode 100644 packaging/Dockerfiles/Dockerfile-altlinux_8 create mode 100644 packaging/Dockerfiles/Dockerfile-altlinux_9 create mode 100644 packaging/Dockerfiles/Dockerfile-astra_1.11 create mode 100644 packaging/Dockerfiles/Dockerfile-centos_6 create mode 100644 packaging/Dockerfiles/Dockerfile-centos_7 create mode 100644 packaging/Dockerfiles/Dockerfile-centos_8 create mode 100644 packaging/Dockerfiles/Dockerfile-createrepo1C create mode 100644 packaging/Dockerfiles/Dockerfile-debian_10 create mode 100644 packaging/Dockerfiles/Dockerfile-debian_8 create mode 100644 packaging/Dockerfiles/Dockerfile-debian_9 create mode 100644 packaging/Dockerfiles/Dockerfile-oraclelinux_6 create mode 100644 packaging/Dockerfiles/Dockerfile-oraclelinux_7 create mode 100644 packaging/Dockerfiles/Dockerfile-oraclelinux_8 create mode 100644 packaging/Dockerfiles/Dockerfile-rhel_7 create mode 100644 packaging/Dockerfiles/Dockerfile-rhel_8 create mode 100644 packaging/Dockerfiles/Dockerfile-rosa_6 create mode 100644 packaging/Dockerfiles/Dockerfile-suse_15.1 create mode 100644 packaging/Dockerfiles/Dockerfile-suse_15.2 create mode 100644 packaging/Dockerfiles/Dockerfile-ubuntu_14.04 create mode 100644 packaging/Dockerfiles/Dockerfile-ubuntu_16.04 create mode 100644 packaging/Dockerfiles/Dockerfile-ubuntu_18.04 create mode 100644 packaging/Dockerfiles/Dockerfile-ubuntu_18.10 create mode 100644 packaging/Dockerfiles/Dockerfile-ubuntu_20.04 create mode 100644 packaging/Makefile.test create mode 100644 packaging/test/Makefile.alt create mode 100644 packaging/test/Makefile.centos create mode 100644 packaging/test/Makefile.debian create mode 100644 packaging/test/Makefile.oraclelinux create mode 100644 packaging/test/Makefile.rhel create mode 100644 packaging/test/Makefile.suse create mode 100644 packaging/test/Makefile.ubuntu create mode 100755 packaging/test/scripts/alt.sh create mode 100755 packaging/test/scripts/deb.sh create mode 100755 packaging/test/scripts/pg_probackup_alt_forks.sh create mode 100755 packaging/test/scripts/pg_probackup_forks_deb.sh create mode 100755 packaging/test/scripts/pg_probackup_forks_rpm.sh create mode 100755 packaging/test/scripts/rpm.sh create mode 100755 packaging/test/scripts/suse.sh diff --git a/packaging/Dockerfiles/Dockerfile-altlinux_8 b/packaging/Dockerfiles/Dockerfile-altlinux_8 new file mode 100644 index 000000000..961aa43dd --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-altlinux_8 @@ -0,0 +1,5 @@ +FROM alt:p8 +RUN ulimit -n 1024 && apt-get update -y && apt-get install -y tar wget rpm-build +RUN ulimit -n 1024 && apt-get install -y make perl libicu-devel glibc-devel bison flex +RUN ulimit -n 1024 && apt-get install -y git perl-devel readline-devel libxml2-devel libxslt-devel python-devel zlib-devel openssl-devel libkrb5 libkrb5-devel +RUN ulimit -n 1024 && apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-altlinux_9 b/packaging/Dockerfiles/Dockerfile-altlinux_9 new file mode 100644 index 000000000..a75728720 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-altlinux_9 @@ -0,0 +1,5 @@ +FROM alt:p9 +RUN ulimit -n 1024 && apt-get update -y && apt-get install -y tar wget rpm-build +RUN ulimit -n 1024 && apt-get install -y make perl libicu-devel glibc-devel bison flex +RUN ulimit -n 1024 && apt-get install -y git perl-devel readline-devel libxml2-devel libxslt-devel python-devel zlib-devel openssl-devel libkrb5 libkrb5-devel +RUN ulimit -n 1024 && apt-get dist-upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-astra_1.11 b/packaging/Dockerfiles/Dockerfile-astra_1.11 new file mode 100644 index 000000000..7db4999cd --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-astra_1.11 @@ -0,0 +1,7 @@ +FROM pgpro/astra:1.11 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install reprepro -y +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-centos_6 b/packaging/Dockerfiles/Dockerfile-centos_6 new file mode 100644 index 000000000..5a83c79bb --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-centos_6 @@ -0,0 +1,5 @@ +FROM centos:6 +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-centos_7 b/packaging/Dockerfiles/Dockerfile-centos_7 new file mode 100644 index 000000000..363440e85 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-centos_7 @@ -0,0 +1,5 @@ +FROM centos:7 +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-centos_8 b/packaging/Dockerfiles/Dockerfile-centos_8 new file mode 100644 index 000000000..9de1d31b1 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-centos_8 @@ -0,0 +1,5 @@ +FROM centos:8 +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-createrepo1C b/packaging/Dockerfiles/Dockerfile-createrepo1C new file mode 100644 index 000000000..d987c4f5f --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-createrepo1C @@ -0,0 +1,4 @@ +FROM ubuntu:17.10 +RUN apt-get -qq update -y +RUN apt-get -qq install -y reprepro rpm createrepo gnupg rsync perl less wget expect rsync dpkg-dev +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-debian_10 b/packaging/Dockerfiles/Dockerfile-debian_10 new file mode 100644 index 000000000..f25ceeac5 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-debian_10 @@ -0,0 +1,7 @@ +FROM debian:10 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install -y reprepro +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-debian_8 b/packaging/Dockerfiles/Dockerfile-debian_8 new file mode 100644 index 000000000..0be9528bb --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-debian_8 @@ -0,0 +1,7 @@ +FROM debian:8 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install -y reprepro +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-debian_9 b/packaging/Dockerfiles/Dockerfile-debian_9 new file mode 100644 index 000000000..6ca10faa8 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-debian_9 @@ -0,0 +1,7 @@ +FROM debian:9 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install -y reprepro +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-oraclelinux_6 b/packaging/Dockerfiles/Dockerfile-oraclelinux_6 new file mode 100644 index 000000000..04325e869 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-oraclelinux_6 @@ -0,0 +1,5 @@ +FROM oraclelinux:6 +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git openssl +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-oraclelinux_7 b/packaging/Dockerfiles/Dockerfile-oraclelinux_7 new file mode 100644 index 000000000..871d920eb --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-oraclelinux_7 @@ -0,0 +1,5 @@ +FROM oraclelinux:7 +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git openssl +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-oraclelinux_8 b/packaging/Dockerfiles/Dockerfile-oraclelinux_8 new file mode 100644 index 000000000..32e7cb03f --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-oraclelinux_8 @@ -0,0 +1,5 @@ +FROM oraclelinux:8 +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git openssl +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-rhel_7 b/packaging/Dockerfiles/Dockerfile-rhel_7 new file mode 100644 index 000000000..ad283adf2 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-rhel_7 @@ -0,0 +1,5 @@ +FROM registry.access.redhat.com/rhel7 +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-rhel_8 b/packaging/Dockerfiles/Dockerfile-rhel_8 new file mode 100644 index 000000000..16c4aa1e4 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-rhel_8 @@ -0,0 +1,5 @@ +FROM ecpe4s/rhel8-spack +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-rosa_6 b/packaging/Dockerfiles/Dockerfile-rosa_6 new file mode 100644 index 000000000..42fa913e1 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-rosa_6 @@ -0,0 +1,5 @@ +FROM pgpro/rosa-6 +RUN yum install -y tar wget rpm-build yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y git +RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-suse_15.1 b/packaging/Dockerfiles/Dockerfile-suse_15.1 new file mode 100644 index 000000000..afc9434a2 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-suse_15.1 @@ -0,0 +1,4 @@ +FROM opensuse/leap:15.1 +RUN ulimit -n 1024 && zypper install -y tar wget rpm-build +RUN ulimit -n 1024 && zypper install -y gcc make perl libicu-devel glibc-devel bison flex +RUN ulimit -n 1024 && zypper install -y git rsync diff --git a/packaging/Dockerfiles/Dockerfile-suse_15.2 b/packaging/Dockerfiles/Dockerfile-suse_15.2 new file mode 100644 index 000000000..7e56e299a --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-suse_15.2 @@ -0,0 +1,4 @@ +FROM opensuse/leap:15.2 +RUN ulimit -n 1024 && zypper install -y tar wget rpm-build +RUN ulimit -n 1024 && zypper install -y gcc make perl libicu-devel glibc-devel bison flex +RUN ulimit -n 1024 && zypper install -y git rsync diff --git a/packaging/Dockerfiles/Dockerfile-ubuntu_14.04 b/packaging/Dockerfiles/Dockerfile-ubuntu_14.04 new file mode 100644 index 000000000..10132f826 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-ubuntu_14.04 @@ -0,0 +1,7 @@ +FROM ubuntu:14.04 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install -y reprepro +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-ubuntu_16.04 b/packaging/Dockerfiles/Dockerfile-ubuntu_16.04 new file mode 100644 index 000000000..d511829c0 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-ubuntu_16.04 @@ -0,0 +1,7 @@ +FROM ubuntu:16.04 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install -y reprepro +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-ubuntu_18.04 b/packaging/Dockerfiles/Dockerfile-ubuntu_18.04 new file mode 100644 index 000000000..20a8567e0 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-ubuntu_18.04 @@ -0,0 +1,7 @@ +FROM ubuntu:18.04 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install -y reprepro +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-ubuntu_18.10 b/packaging/Dockerfiles/Dockerfile-ubuntu_18.10 new file mode 100644 index 000000000..66cefff16 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-ubuntu_18.10 @@ -0,0 +1,7 @@ +FROM ubuntu:18.10 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install -y reprepro +RUN apt-get upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-ubuntu_20.04 b/packaging/Dockerfiles/Dockerfile-ubuntu_20.04 new file mode 100644 index 000000000..79288d308 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-ubuntu_20.04 @@ -0,0 +1,8 @@ +FROM ubuntu:20.04 +ENV DEBIAN_FRONTEND noninteractive +RUN ulimit -n 1024 && apt-get update -y +RUN ulimit -n 1024 && apt-get install -y devscripts +RUN ulimit -n 1024 && apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN ulimit -n 1024 && apt-get install -y cmake bison flex libboost-all-dev +RUN ulimit -n 1024 && apt-get install -y reprepro +RUN ulimit -n 1024 && apt-get upgrade -y diff --git a/packaging/Makefile.test b/packaging/Makefile.test new file mode 100644 index 000000000..bade328bf --- /dev/null +++ b/packaging/Makefile.test @@ -0,0 +1,156 @@ +test: build/test_all + @echo Test for all platform: done + +build/test_all: build/test_debian build/test_ubuntu build/test_centos build/test_oraclelinux build/test_rhel build/test_alt build/test_suse + @echo Package testing is done + +### DEBIAN +build/test_debian: build/test_debian_8 build/test_debian_9 build/test_debian_10 + @echo Debian: done + +build/test_debian_8: build/test_debian_8_9.5 build/test_debian_8_9.6 build/test_debian_8_10 build/test_debian_8_11 build/test_debian_8_12 build/test_debian_8_13 + @echo Debian 8: done + +build/test_debian_9: build/test_debian_9_9.5 build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 + @echo Debian 9: done + +build/test_debian_10: build/test_debian_9_9.5 build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 + @echo Debian 10: done + +### UBUNTU +build/test_ubuntu: build/test_ubuntu_14.04 build/test_ubuntu_16.04 build/test_ubuntu_18.04 build/test_ubuntu_20.04 + @echo Ubuntu: done + +build/test_ubuntu_14.04: build/test_ubuntu_14.04_9.5 build/test_ubuntu_14.04_9.6 build/test_ubuntu_14.04_10 build/test_ubuntu_14.04_11 build/test_ubuntu_14.04_12 build/test_ubuntu_14.04_13 + @echo Ubuntu 14.04: + +build/test_ubuntu_16.04: build/test_ubuntu_16.04_9.5 build/test_ubuntu_16.04_9.6 build/test_ubuntu_16.04_10 build/test_ubuntu_16.04_11 build/test_ubuntu_16.04_12 build/test_ubuntu_16.04_13 + @echo Ubuntu 16.04: done + +build/test_ubuntu_18.04: build/test_ubuntu_18.04_9.5 build/test_ubuntu_18.04_9.6 build/test_ubuntu_18.04_10 build/test_ubuntu_18.04_11 build/test_ubuntu_18.04_12 build/test_ubuntu_18.04_13 + @echo Ubuntu 18.04: done + +build/test_ubuntu_20.04: build/test_ubuntu_20.04_9.5 build/test_ubuntu_20.04_9.6 build/test_ubuntu_20.04_10 build/test_ubuntu_20.04_11 build/test_ubuntu_20.04_12 build/test_ubuntu_20.04_13 + @echo Ubuntu 20.04: done + +define test_deb + docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/test:/app/in \ + -v $(BUILDDIR)/data/www/$(PBK_PKG_REPO):/app/www \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ + -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \ + -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ + --rm pgpro/$1:$2 /app/in/scripts/deb.sh +endef + +include packaging/test/Makefile.debian +include packaging/test/Makefile.ubuntu + +# CENTOS +build/test_centos: build/test_centos_6 build/test_centos_7 build/test_centos_8 + @echo Centos: done + +build/test_centos_6: build/test_centos_6_9.5 build/test_centos_6_9.6 build/test_centos_6_10 build/test_centos_6_11 build/test_centos_6_12 build/test_centos_6_13 + @echo Centos 6: done + +build/test_centos_7: build/test_centos_7_9.5 build/test_centos_7_9.6 build/test_centos_7_10 build/test_centos_7_11 build/test_centos_7_12 build/test_centos_7_13 + @echo Centos 7: done + +build/test_centos_8: build/test_centos_8_9.5 build/test_centos_8_9.6 build/test_centos_8_10 build/test_centos_8_11 build/test_centos_8_12 build/test_centos_8_13 + @echo Centos 8: done + +# Oracle Linux +build/test_oraclelinux: build/test_oraclelinux_6 build/test_oraclelinux_7 build/test_oraclelinux_8 + @echo Oraclelinux: done + +build/test_oraclelinux_6: build/test_oraclelinux_6_9.5 build/test_oraclelinux_6_9.6 build/test_oraclelinux_6_10 build/test_oraclelinux_6_11 build/test_oraclelinux_6_12 build/test_oraclelinux_6_13 + @echo Oraclelinux 6: done + +build/test_oraclelinux_7: build/test_oraclelinux_7_9.5 build/test_oraclelinux_7_9.6 build/test_oraclelinux_7_10 build/test_oraclelinux_7_11 build/test_oraclelinux_7_12 build/test_oraclelinux_7_13 + @echo Oraclelinux 7: done + +build/test_oraclelinux_8: build/test_oraclelinux_8_9.5 build/test_oraclelinux_8_9.6 build/test_oraclelinux_8_10 build/test_oraclelinux_8_11 build/test_oraclelinux_8_12 build/test_oraclelinux_8_13 + @echo Oraclelinux 8: done + +# RHEL +build/test_rhel: build/test_rhel_6 build/test_rhel_7 build/test_rhel_8 + @echo Rhel: done + +build/test_rhel_6: build/test_rhel_6_9.5 build/test_rhel_6_9.6 build/test_rhel_6_10 build/test_rhel_6_11 build/test_rhel_6_12 build/test_rhel_6_13 + @echo Rhel 6: done + +build/test_rhel_7: build/test_rhel_7_9.5 build/test_rhel_7_9.6 build/test_rhel_7_10 build/test_rhel_7_11 build/test_rhel_7_12 build/test_rhel_7_13 + @echo Rhel 7: done + +build/test_rhel_8: build/test_rhel_8_9.5 build/test_rhel_8_9.6 build/test_rhel_8_10 build/test_rhel_8_11 build/test_rhel_8_12 build/test_rhel_8_13 + @echo Rhel 8: done + +define test_rpm + docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/test:/app/in \ + -v $(BUILDDIR)/data/www/$(PBK_PKG_REPO):/app/www \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ + -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ + -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ + --rm pgpro/$1:$2 /app/in/scripts/rpm.sh +endef + +include packaging/test/Makefile.centos +include packaging/test/Makefile.rhel +include packaging/test/Makefile.oraclelinux + + +# Alt Linux +build/test_alt: build/test_alt_7 build/test_alt_8 build/test_alt_9 + @echo Alt Linux: done + +build/test_alt_7: build/test_alt_7_9.5 build/test_alt_7_9.6 build/test_alt_7_10 build/test_alt_7_11 build/test_alt_7_12 build/test_alt_7_13 + @echo Alt Linux 7: done + +build/test_alt_8: build/test_alt_8_9.5 build/test_alt_8_9.6 build/test_alt_8_10 build/test_alt_8_11 build/test_alt_8_12 build/test_alt_8_13 + @echo Alt Linux 8: done + +build/test_alt_9: build/test_alt_9_9.5 build/test_alt_9_9.6 build/test_alt_9_10 build/test_alt_9_11 build/test_alt_9_12 build/test_alt_9_13 + @echo Alt Linux 9: done + +define test_alt + docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/test:/app/in \ + -v $(BUILDDIR)/data/www/$(PBK_PKG_REPO):/app/www \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ + -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ + -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ + --rm pgpro/$1:$2 /app/in/scripts/alt.sh +endef + +include packaging/test/Makefile.alt + +# SUSE Linux +build/test_suse: build/test_suse_15.1 build/test_suse_15.2 + @echo Suse: done + +build/test_suse_15.1: build/test_suse_15.1_9.5 build/test_suse_15.1_9.6 build/test_suse_15.1_10 build/test_suse_15.1_11 build/test_suse_15.1_12 build/test_suse_15.1_13 + @echo Rhel 15.1: done + +build/test_suse_15.2: build/test_suse_15.2_9.5 build/test_suse_15.2_9.6 build/test_suse_15.2_10 build/test_suse_15.2_11 build/test_suse_15.2_12 build/test_suse_15.2_13 + @echo Rhel 15.1: done + +define test_suse + docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ + docker run \ + -v $(WORKDIR)/packaging/test:/app/in \ + -v $(BUILDDIR)/data/www/$(PBK_PKG_REPO):/app/www \ + -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ + -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ + -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ + --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ + --rm pgpro/$1:$2 /app/in/scripts/suse.sh +endef + +include packaging/test/Makefile.suse diff --git a/packaging/test/Makefile.alt b/packaging/test/Makefile.alt new file mode 100644 index 000000000..084ed1648 --- /dev/null +++ b/packaging/test/Makefile.alt @@ -0,0 +1,74 @@ +# ALT 7 +build/test_alt_7_9.5: + $(call test_alt,alt,7,,9.5,9.5.25) + touch build/test_alt_7_9.5 + +build/test_alt_7_9.6: + $(call test_alt,alt,7,,9.6,9.6.21) + touch build/test_alt_7_9.6 + +build/test_alt_7_10: + $(call test_alt,alt,7,,10,10.17) + touch build/test_alt_7_10 + +build/test_alt_7_11: + $(call test_alt,alt,7,,11,11.11) + touch build/test_alt_7_11 + +build/test_alt_7_12: + $(call test_alt,alt,7,,12,12.6) + touch build/test_alt_7_12 + +build/test_alt_7_13: + $(call test_alt,alt,7,,13,13.2) + touch build/test_alt_7_13 + +# ALT 8 +build/test_alt_8_9.5: + $(call test_alt,alt,8,,9.5,9.5.25) + touch build/test_alt_8_9.5 + +build/test_alt_8_9.6: + $(call test_alt,alt,8,,9.6,9.6.21) + touch build/test_alt_8_9.6 + +build/test_alt_8_10: + $(call test_alt,alt,8,,10,10.17) + touch build/test_alt_8_10 + +build/test_alt_8_11: + $(call test_alt,alt,8,,11,11.11) + touch build/test_alt_8_11 + +build/test_alt_8_12: + $(call test_alt,alt,8,,12,12.6) + touch build/test_alt_8_12 + +build/test_alt_8_13: + $(call test_alt,alt,8,,13,13.2) + touch build/test_alt_8_13 + +# ALT 9 +build/test_alt_9_9.5: + $(call test_alt,alt,9,,9.5,9.5.25) + touch build/test_alt_9_9.5 + +build/test_alt_9_9.6: + $(call test_alt,alt,9,,9.6,9.6.21) + touch build/test_alt_9_9.6 + +build/test_alt_9_10: + $(call test_alt,alt,9,,10,10.17) + touch build/test_alt_9_10 + +build/test_alt_9_11: + $(call test_alt,alt,9,,11,11.11) + touch build/test_alt_9_11 + +build/test_alt_9_12: + $(call test_alt,alt,9,,12,12.6) + touch build/test_alt_9_12 + +build/test_alt_9_13: + $(call test_alt,alt,9,,13,13.2) + touch build/test_alt_9_13 diff --git a/packaging/test/Makefile.centos b/packaging/test/Makefile.centos new file mode 100644 index 000000000..0ae638820 --- /dev/null +++ b/packaging/test/Makefile.centos @@ -0,0 +1,74 @@ +# CENTOS 6 +build/test_centos_6_9.5: + $(call test_rpm,centos,6,,9.5,9.5.25) + touch build/test_centos_6_9.5 + +build/test_centos_6_9.6: + $(call test_rpm,centos,6,,9.6,9.6.21) + touch build/test_centos_6_9.6 + +build/test_centos_6_10: + $(call test_rpm,centos,6,,10,10.16) + touch build/test_centos_6_10 + +build/test_centos_6_11: + $(call test_rpm,centos,6,,11,11.11) + touch build/test_centos_6_11 + +build/test_centos_6_12: + $(call test_rpm,centos,6,,12,12.6) + touch build/test_centos_6_12 + +build/test_centos_6_13: + $(call test_rpm,centos,6,,13,13.2) + touch build/test_centos_6_13 + +# CENTOS 7 +build/test_centos_7_9.5: + $(call test_rpm,centos,7,,9.5,9.5.25) + touch build/test_centos_7_9.5 + +build/test_centos_7_9.6: + $(call test_rpm,centos,7,,9.6,9.6.21) + touch build/test_centos_7_9.6 + +build/test_centos_7_10: + $(call test_rpm,centos,7,,10,10.16) + touch build/test_centos_7_10 + +build/test_centos_7_11: + $(call test_rpm,centos,7,,11,11.11) + touch build/test_centos_7_11 + +build/test_centos_7_12: + $(call test_rpm,centos,7,,12,12.6) + touch build/test_centos_7_12 + +build/test_centos_7_13: + $(call test_rpm,centos,7,,13,13.2) + touch build/test_centos_7_13 + +# CENTOS 8 +build/test_centos_8_9.5: + $(call test_rpm,centos,8,,9.5,9.5.25) + touch build/test_centos_8_9.5 + +build/test_centos_8_9.6: + $(call test_rpm,centos,8,,9.6,9.6.21) + touch build/test_centos_8_9.6 + +build/test_centos_8_10: + $(call test_rpm,centos,8,,10,10.16) + touch build/test_centos_8_10 + +build/test_centos_8_11: + $(call test_rpm,centos,8,,11,11.11) + touch build/test_centos_8_11 + +build/test_centos_8_12: + $(call test_rpm,centos,8,,12,12.6) + touch build/test_centos_8_12 + +build/test_centos_8_13: + $(call test_rpm,centos,8,,13,13.2) + touch build/test_centos_8_13 diff --git a/packaging/test/Makefile.debian b/packaging/test/Makefile.debian new file mode 100644 index 000000000..259c97a9b --- /dev/null +++ b/packaging/test/Makefile.debian @@ -0,0 +1,74 @@ +# DEBIAN 8 +build/test_debian_8_9.5: + $(call test_deb,debian,8,jessie,9.5,9.5.25) + touch build/test_debian_8_9.5 + +build/test_debian_8_9.6: + $(call test_deb,debian,8,jessie,9.6,9.6.21) + touch build/test_debian_8_9.6 + +build/test_debian_8_10: + $(call test_deb,debian,8,jessie,10,10.16) + touch build/test_debian_8_10 + +build/test_debian_8_11: + $(call test_deb,debian,8,jessie,11,11.11) + touch build/test_debian_8_11 + +build/test_debian_8_12: + $(call test_deb,debian,8,jessie,12,12.6) + touch build/test_debian_8_12 + +build/test_debian_8_13: + $(call test_deb,debian,8,jessie,13,13.2) + touch build/test_debian_8_13 + +# DEBIAN 9 +build/test_debian_9_9.5: + $(call test_deb,debian,9,stretch,9.5,9.5.25) + touch build/test_debian_9_9.5 + +build/test_debian_9_9.6: + $(call test_deb,debian,9,stretch,9.6,9.6.21) + touch build/test_debian_9_9.6 + +build/test_debian_9_10: + $(call test_deb,debian,9,stretch,10,10.16) + touch build/test_debian_9_10 + +build/test_debian_9_11: + $(call test_deb,debian,9,stretch,11,11.11) + touch build/test_debian_9_11 + +build/test_debian_9_12: + $(call test_deb,debian,9,stretch,12,12.6) + touch build/test_debian_9_12 + +build/test_debian_9_13: + $(call test_deb,debian,9,stretch,13,13.2) + touch build/test_debian_9_13 + +# DEBIAN 10 +build/test_debian_10_9.5: + $(call test_deb,debian,10,buster,9.5,9.5.25) + touch build/test_debian_10_9.5 + +build/test_debian_10_9.6: + $(call test_deb,debian,10,buster,9.6,9.6.21) + touch build/test_debian_10_9.6 + +build/test_debian_10_10: + $(call test_deb,debian,10,buster,10,10.16) + touch build/test_debian_10_10 + +build/test_debian_10_11: + $(call test_deb,debian,10,buster,11,11.11) + touch build/test_debian_10_11 + +build/test_debian_10_12: + $(call test_deb,debian,10,buster,12,12.6) + touch build/test_debian_10_12 + +build/test_debian_10_13: + $(call test_deb,debian,10,buster,13,13.2) + touch build/test_debian_10_13 diff --git a/packaging/test/Makefile.oraclelinux b/packaging/test/Makefile.oraclelinux new file mode 100644 index 000000000..383d3688c --- /dev/null +++ b/packaging/test/Makefile.oraclelinux @@ -0,0 +1,74 @@ +# ORACLE LINUX 6 +build/test_oraclelinux_6_9.5: + $(call test_rpm,oraclelinux,6,,9.5,9.5.25) + touch build/test_oraclelinux_6_9.5 + +build/test_oraclelinux_6_9.6: + $(call test_rpm,oraclelinux,6,,9.6,9.6.21) + touch build/test_oraclelinux_6_9.6 + +build/test_oraclelinux_6_10: + $(call test_rpm,oraclelinux,6,,10,10.16) + touch build/test_oraclelinux_6_10 + +build/test_oraclelinux_6_11: + $(call test_rpm,oraclelinux,6,,11,11.11) + touch build/test_oraclelinux_6_11 + +build/test_oraclelinux_6_12: + $(call test_rpm,oraclelinux,6,,12,12.6) + touch build/test_oraclelinux_6_12 + +build/test_oraclelinux_6_13: + $(call test_rpm,oraclelinux,6,,13,13.2) + touch build/test_oraclelinux_6_13 + +# ORACLE LINUX 7 +build/test_oraclelinux_7_9.5: + $(call test_rpm,oraclelinux,7,,9.5,9.5.25) + touch build/test_oraclelinux_7_9.5 + +build/test_oraclelinux_7_9.6: + $(call test_rpm,oraclelinux,7,,9.6,9.6.21) + touch build/test_oraclelinux_7_9.6 + +build/test_oraclelinux_7_10: + $(call test_rpm,oraclelinux,7,,10,10.16) + touch build/test_oraclelinux_7_10 + +build/test_oraclelinux_7_11: + $(call test_rpm,oraclelinux,7,,11,11.11) + touch build/test_oraclelinux_7_11 + +build/test_oraclelinux_7_12: + $(call test_rpm,oraclelinux,7,,12,12.6) + touch build/test_oraclelinux_7_12 + +build/test_oraclelinux_7_13: + $(call test_rpm,oraclelinux,7,,13,13.2) + touch build/test_oraclelinux_7_13 + +# ORACLE LINUX 8 +build/test_oraclelinux_8_9.5: + $(call test_rpm,oraclelinux,8,,9.5,9.5.25) + touch build/test_oraclelinux_8_9.5 + +build/test_oraclelinux_8_9.6: + $(call test_rpm,oraclelinux,8,,9.6,9.6.21) + touch build/test_oraclelinux_8_9.6 + +build/test_oraclelinux_8_10: + $(call test_rpm,oraclelinux,8,,10,10.16) + touch build/test_oraclelinux_8_10 + +build/test_oraclelinux_8_11: + $(call test_rpm,oraclelinux,8,,11,11.11) + touch build/test_oraclelinux_8_11 + +build/test_oraclelinux_8_12: + $(call test_rpm,oraclelinux,8,,12,12.6) + touch build/test_oraclelinux_8_12 + +build/test_oraclelinux_8_13: + $(call test_rpm,oraclelinux,8,,13,13.2) + touch build/test_oraclelinux_8_13 diff --git a/packaging/test/Makefile.rhel b/packaging/test/Makefile.rhel new file mode 100644 index 000000000..69dc24dcd --- /dev/null +++ b/packaging/test/Makefile.rhel @@ -0,0 +1,74 @@ +# RHEL 6 +build/test_rhel_6_9.5: + $(call test_rpm,rhel,6,6Server,9.5,9.5.25) + touch build/test_rhel_6_9.5 + +build/test_rhel_6_9.6: + $(call test_rpm,rhel,6,6Server,9.6,9.6.21) + touch build/test_rhel_6_9.6 + +build/test_rhel_6_10: + $(call test_rpm,rhel,6,6Server,10,10.16) + touch build/test_rhel_6_10 + +build/test_rhel_6_11: + $(call test_rpm,rhel,6,6Server,11,11.11) + touch build/test_rhel_6_11 + +build/test_rhel_6_12: + $(call test_rpm,rhel,6,6Server,12,12.6) + touch build/test_rhel_6_12 + +build/test_rhel_6_13: + $(call test_rpm,rhel,6,6Server,13,13.2) + touch build/test_rhel_6_13 + +# RHEL 7 +build/test_rhel_7_9.5: + $(call test_rpm,rhel,7,7Server,9.5,9.5.25) + touch build/test_rhel_7_9.5 + +build/test_rhel_7_9.6: + $(call test_rpm,rhel,7,7Server,9.6,9.6.21) + touch build/test_rhel_7_9.6 + +build/test_rhel_7_10: + $(call test_rpm,rhel,7,7Server,10,10.16) + touch build/test_rhel_7_10 + +build/test_rhel_7_11: + $(call test_rpm,rhel,7,7Server,11,11.11) + touch build/test_rhel_7_11 + +build/test_rhel_7_12: + $(call test_rpm,rhel,7,7Server,12,12.6) + touch build/test_rhel_7_12 + +build/test_rhel_7_13: + $(call test_rpm,rhel,7,7Server,13,13.2) + touch build/test_rhel_7_13 + +# RHEL 8 +build/test_rhel_8_9.5: + $(call test_rpm,rhel,8,8Server,9.5,9.5.25) + touch build/test_rhel_8_9.5 + +build/test_rhel_8_9.6: + $(call test_rpm,rhel,8,8Server,9.6,9.6.21) + touch build/test_rhel_8_9.6 + +build/test_rhel_8_10: + $(call test_rpm,rhel,8,8Server,10,10.16) + touch build/test_rhel_8_10 + +build/test_rhel_8_11: + $(call test_rpm,rhel,8,8Server,11,11.11) + touch build/test_rhel_8_11 + +build/test_rhel_8_12: + $(call test_rpm,rhel,8,8Server,12,12.6) + touch build/test_rhel_8_12 + +build/test_rhel_8_13: + $(call test_rpm,rhel,8,8Server,13,13.2) + touch build/test_rhel_8_13 diff --git a/packaging/test/Makefile.suse b/packaging/test/Makefile.suse new file mode 100644 index 000000000..76e0518a2 --- /dev/null +++ b/packaging/test/Makefile.suse @@ -0,0 +1,49 @@ +# Suse 15.1 +build/test_suse_15.1_9.5: + $(call test_suse,suse,15.1,,9.5,9.5.25) + touch build/test_suse_15.1_9.5 + +build/test_suse_15.1_9.6: + $(call test_suse,suse,15.1,,9.6,9.6.21) + touch build/test_suse_15.1_9.6 + +build/test_suse_15.1_10: + $(call test_suse,suse,15.1,,10,10.16) + touch build/test_suse_15.1_10 + +build/test_suse_15.1_11: + $(call test_suse,suse,15.1,,11,11.11) + touch build/test_suse_15.1_11 + +build/test_suse_15.1_12: + $(call test_suse,suse,15.1,,12,12.6) + touch build/test_suse_15.1_12 + +build/test_suse_15.1_13: + $(call test_suse,suse,15.1,,13,13.2) + touch build/test_suse_15.1_13 + +# Suse 15.2 +build/test_suse_15.2_9.5: + $(call test_suse,suse,15.2,,9.5,9.5.25) + touch build/test_suse_15.2_9.5 + +build/test_suse_15.2_9.6: + $(call test_suse,suse,15.2,,9.6,9.6.21) + touch build/test_suse_15.2_9.6 + +build/test_suse_15.2_10: + $(call test_suse,suse,15.2,,10,10.16) + touch build/test_suse_15.2_10 + +build/test_suse_15.2_11: + $(call test_suse,suse,15.2,,11,11.11) + touch build/test_suse_15.2_11 + +build/test_suse_15.2_12: + $(call test_suse,suse,15.2,,12,12.6) + touch build/test_suse_15.2_12 + +build/test_suse_15.2_13: + $(call test_suse,suse,15.2,,13,13.2) + touch build/test_suse_15.2_13 diff --git a/packaging/test/Makefile.ubuntu b/packaging/test/Makefile.ubuntu new file mode 100644 index 000000000..7d66a7544 --- /dev/null +++ b/packaging/test/Makefile.ubuntu @@ -0,0 +1,99 @@ +# UBUNTU 20.04 +build/test_ubuntu_20.04_9.5: + $(call test_deb,ubuntu,20.04,focal,9.5,9.5.25) + touch build/test_ubuntu_20.04_9.5 + +build/test_ubuntu_20.04_9.6: + $(call test_deb,ubuntu,20.04,focal,9.6,9.6.21) + touch build/test_ubuntu_20.04_9.6 + +build/test_ubuntu_20.04_10: + $(call test_deb,ubuntu,20.04,focal,10,10.16) + touch build/test_ubuntu_20.04_10 + +build/test_ubuntu_20.04_11: + $(call test_deb,ubuntu,20.04,focal,11,11.11) + touch build/test_ubuntu_20.04_11 + +build/test_ubuntu_20.04_12: + $(call test_deb,ubuntu,20.04,focal,12,12.6) + touch build/test_ubuntu_20.04_12 + +build/test_ubuntu_20.04_13: + $(call test_deb,ubuntu,20.04,focal,13,13.2) + touch build/test_ubuntu_20.04_13 + +# UBUNTU 18.04 +build/test_ubuntu_18.04_9.5: + $(call test_deb,ubuntu,18.04,bionic,9.5,9.5.25) + touch build/test_ubuntu_18.04_9.5 + +build/test_ubuntu_18.04_9.6: + $(call test_deb,ubuntu,18.04,bionic,9.6,9.6.21) + touch build/test_ubuntu_18.04_9.6 + +build/test_ubuntu_18.04_10: + $(call test_deb,ubuntu,18.04,bionic,10,10.16) + touch build/test_ubuntu_18.04_10 + +build/test_ubuntu_18.04_11: + $(call test_deb,ubuntu,18.04,bionic,11,11.11) + touch build/test_ubuntu_18.04_11 + +build/test_ubuntu_18.04_12: + $(call test_deb,ubuntu,18.04,bionic,12,12.6) + touch build/test_ubuntu_18.04_12 + +build/test_ubuntu_18.04_13: + $(call test_deb,ubuntu,18.04,bionic,13,13.2) + touch build/test_ubuntu_18.04_13 + +# UBUNTU 16.04 +build/test_ubuntu_16.04_9.5: + $(call test_deb,ubuntu,16.04,xenial,9.5,9.5.25) + touch build/test_ubuntu_16.04_9.5 + +build/test_ubuntu_16.04_9.6: + $(call test_deb,ubuntu,16.04,xenial,9.6,9.6.21) + touch build/test_ubuntu_16.04_9.6 + +build/test_ubuntu_16.04_10: + $(call test_deb,ubuntu,16.04,xenial,10,10.16) + touch build/test_ubuntu_16.04_10 + +build/test_ubuntu_16.04_11: + $(call test_deb,ubuntu,16.04,xenial,11,11.11) + touch build/test_ubuntu_16.04_11 + +build/test_ubuntu_16.04_12: + $(call test_deb,ubuntu,16.04,xenial,12,12.6) + touch build/test_ubuntu_16.04_12 + +build/test_ubuntu_16.04_13: + $(call test_deb,ubuntu,16.04,xenial,13,13.2) + touch build/test_ubuntu_16.04_13 + +# UBUNTU 14.04 +build/test_ubuntu_14.04_9.5: + $(call test_deb,ubuntu,14.04,trusty,9.5,9.5.25) + touch build/test_ubuntu_14.04_9.5 + +build/test_ubuntu_14.04_9.6: + $(call test_deb,ubuntu,14.04,trusty,9.6,9.6.21) + touch build/test_ubuntu_14.04_9.6 + +build/test_ubuntu_14.04_10: + $(call test_deb,ubuntu,14.04,trusty,10,10.16) + touch build/test_ubuntu_14.04_10 + +build/test_ubuntu_14.04_11: + $(call test_deb,ubuntu,14.04,trusty,11,11.11) + touch build/test_ubuntu_14.04_11 + +build/test_ubuntu_14.04_12: + $(call test_deb,ubuntu,14.04,trusty,12,12.6) + touch build/test_ubuntu_14.04_12 + +build/test_ubuntu_14.04_13: + $(call test_deb,ubuntu,14.04,trusty,13,13.2) + touch build/test_ubuntu_14.04_13 diff --git a/packaging/test/scripts/alt.sh b/packaging/test/scripts/alt.sh new file mode 100755 index 000000000..5851f5565 --- /dev/null +++ b/packaging/test/scripts/alt.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +ulimit -n 1024 + +apt-get clean -y +apt-get update -y +apt-get install nginx su -y + +adduser nginx + +cat < /etc/nginx/nginx.conf +user nginx; +worker_processes 1; +error_log /var/log/nginx/error.log; +events { + worker_connections 1024; +} +http { + server { + listen 80 default; + root /var/www; + } +} +EOF + +/etc/init.d/nginx start + +# install POSTGRESQL + +export PGDATA=/var/lib/pgsql/${PG_VERSION}/data + +# install old packages + +# install new packages +echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts +echo "rpm http://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p${DISTRIB_VERSION} x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list +echo "rpm [p${DISTRIB_VERSION}] http://mirror.yandex.ru/altlinux p${DISTRIB_VERSION}/branch/x86_64 debuginfo" > /etc/apt/sources.list.d/debug.list + +apt-get update -y +apt-get install ${PKG_NAME} ${PKG_NAME}-debuginfo -y +${PKG_NAME} --help +${PKG_NAME} --version + +exit 0 + +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -t 1000 -c 1" +su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" + +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl stop -D ${PGDATA}" +rm -rf ${PGDATA} + +su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl start -w -D ${PGDATA}" + +sleep 5 + +echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/pgsql-${PG_VERSION}/bin/psql" || exit 1 + +exit 0 # while PG12 is not working + +# SRC PACKAGE +cd /mnt diff --git a/packaging/test/scripts/deb.sh b/packaging/test/scripts/deb.sh new file mode 100755 index 000000000..3d6fbcdc5 --- /dev/null +++ b/packaging/test/scripts/deb.sh @@ -0,0 +1,153 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2021 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +ulimit -n 1024 + +PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') + +# upgrade and utils +# export parameters +export DEBIAN_FRONTEND=noninteractive +echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +if [ ${DISTRIB} == 'ubuntu' ] && [ ${DISTRIB_VERSION} == '14.04' ] && [ ${PG_TOG} == '12' ]; then + exit 0 +fi + +if [ ${DISTRIB} == 'ubuntu' ] && [ ${DISTRIB_VERSION} == '14.04' ] && [ ${PG_TOG} == '13' ]; then + exit 0 +fi + +if [ ${DISTRIB} == 'debian' ] && [ ${DISTRIB_VERSION} == '8' ] && [ ${PG_TOG} == '13' ]; then + exit 0 +fi + +#if [ ${CODENAME} == 'jessie' ]; then +#printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list +#fi + +apt-get -qq update +apt-get -qq install -y wget nginx gnupg lsb-release +#apt-get -qq install -y libterm-readline-gnu-perl dialog gnupg procps + +# echo -e 'Package: *\nPin: origin test.postgrespro.ru\nPin-Priority: 800' >\ +# /etc/apt/preferences.d/pgpro-800 + +# install nginx +echo "127.0.0.1 test.postgrespro.ru" >> /etc/hosts +cat < /etc/nginx/nginx.conf +user www-data; +worker_processes 1; +error_log /var/log/nginx/error.log; +events { + worker_connections 1024; +} +http { + server { + listen 80 default; + root /var/www; + } +} +EOF +nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) + +# install POSTGRESQL +#if [ ${CODENAME} == 'precise' ] && [ ${PG_VERSION} != '10' ] && [ ${PG_VERSION} != '11' ]; then + sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - + apt-get update -y + apt-get install -y postgresql-${PG_VERSION} +#fi + +## install pg_probackup from current public repo +##if [ $CODENAME != 'cosmic' ]; then # Bionic do not have package in repo +#echo "deb [arch=amd64] http://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >\ +# /etc/apt/sources.list.d/pg_probackup-old.list +#wget -O - http://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | apt-key add - && apt-get update +# +#apt-get install -y pg-probackup-${PG_VERSION} +#pg_probackup-${PG_VERSION} --help +#pg_probackup-${PG_VERSION} --version + +# Artful do no have PostgreSQL packages at all, Precise do not have PostgreSQL 10 +#if [ ${CODENAME} == 'precise' ] && [ ${PG_VERSION} != '10' ] && [ ${PG_VERSION} != '11' ]; then + export PGDATA=/var/lib/postgresql/${PG_VERSION}/data + su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/initdb -k -D ${PGDATA}" +# su postgres -c "pg_probackup-${PG_VERSION} init -B /tmp/backup" +# su postgres -c "pg_probackup-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" + + echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf + echo "fsync=off" >> ${PGDATA}/postgresql.auto.conf + echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf + echo "archive_command='pg_probackup-${PG_VERSION} archive-push --no-sync -B /tmp/backup compress --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf + + su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pg_ctl start -D ${PGDATA}" + sleep 5 +# su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node -b full -B /tmp/backup -D ${PGDATA} --no-sync" +# su postgres -c "pg_probackup-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" +# su postgres -c "pg_probackup-${PG_VERSION} show --instance=node -B /tmp/backup --archive -D ${PGDATA}" + + su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pgbench --no-vacuum -i -s 5" +# su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" +#fi + +# install new packages +echo "deb [arch=amd64] http://test.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >\ + /etc/apt/sources.list.d/pg_probackup-new.list +wget -O - http://test.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | apt-key add - +apt-get update +apt-get install -y pg-probackup-${PG_VERSION} +pg_probackup-${PG_VERSION} --help +pg_probackup-${PG_VERSION} --version + +#if [ ${CODENAME} == 'precise' ] && [ ${PG_VERSION} != '10' ] && [ ${PG_VERSION} != '11' ]; then +# echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf +# echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf +# echo "archive_command='${PKG_NAME} archive-push -B /tmp/backup --compress --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf +# su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pg_ctl restart -D ${PGDATA}" +# sleep 5 +# su postgres -c "${PKG_NAME} init -B /tmp/backup" +# su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" + + su postgres -c "pg_probackup-${PG_VERSION} init -B /tmp/backup" + su postgres -c "pg_probackup-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA} --no-sync" + su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pgbench --no-vacuum -t 1000 -c 1" + su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" + su postgres -c "pg_probackup-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" + + su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pg_ctl stop -D ${PGDATA}" + rm -rf ${PGDATA} + + su postgres -c "pg_probackup-${PG_VERSION} restore --instance=node -B /tmp/backup -D ${PGDATA} --no-sync" + su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pg_ctl start -w -t 60 -D ${PGDATA}" + +sleep 5 +echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/psql" || exit 1 +#fi + +# CHECK SRC package +apt-get install -y dpkg-dev +echo "deb-src [arch=amd64] http://test.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >>\ + /etc/apt/sources.list.d/pg_probackup.list + +wget -O - http://test.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | apt-key add - && apt-get update + +apt-get update -y + +cd /mnt +apt-get source pg-probackup-${PG_VERSION} +exit 0 + +cd pg-probackup-${PG_VERSION}-${PKG_VERSION} +#mk-build-deps --install --remove --tool 'apt-get --no-install-recommends --yes' debian/control +#rm -rf ./*.deb +apt-get install -y debhelper bison flex gettext zlib1g-dev +dpkg-buildpackage -us -uc diff --git a/packaging/test/scripts/pg_probackup_alt_forks.sh b/packaging/test/scripts/pg_probackup_alt_forks.sh new file mode 100755 index 000000000..49717f2df --- /dev/null +++ b/packaging/test/scripts/pg_probackup_alt_forks.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +ulimit -n 1024 + +if [ ${EDITION} == 'ent' ]; then + exit 0 +fi + +apt-get clean -y +apt-get update -y +apt-get install nginx su -y + +adduser nginx + +cat < /etc/nginx/nginx.conf +user nginx; +worker_processes 1; +error_log /var/log/nginx/error.log; +events { + worker_connections 1024; +} +http { + server { + listen 80 default; + root /var/www; + } +} +EOF + +/etc/init.d/nginx start + +# install POSTGRESQL + +export PGDATA=/var/lib/pgsql/${PG_VERSION}/data + +# install old packages + +# install new packages +echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts +echo "rpm http://repo.postgrespro.ru/pg_probackup-forks/rpm/latest/altlinux-p${DISTRIB_VERSION} x86_64 forks" > /etc/apt/sources.list.d/pg_probackup.list +echo "rpm [p${DISTRIB_VERSION}] http://mirror.yandex.ru/altlinux p${DISTRIB_VERSION}/branch/x86_64 debuginfo" > /etc/apt/sources.list.d/debug.list + +apt-get update -y +apt-get install ${PKG_NAME} ${PKG_NAME}-debuginfo -y +${PKG_NAME} --help +${PKG_NAME} --version + +exit 0 + +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -t 1000 -c 1" +su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" +su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" + +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl stop -D ${PGDATA}" +rm -rf ${PGDATA} + +su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA}" +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl start -w -D ${PGDATA}" + +sleep 5 + +echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/pgsql-${PG_VERSION}/bin/psql" || exit 1 + +exit 0 # while PG12 is not working + +# SRC PACKAGE +cd /mnt diff --git a/packaging/test/scripts/pg_probackup_forks_deb.sh b/packaging/test/scripts/pg_probackup_forks_deb.sh new file mode 100755 index 000000000..17991965d --- /dev/null +++ b/packaging/test/scripts/pg_probackup_forks_deb.sh @@ -0,0 +1,155 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +if [ ${EDITION} == 'ent' ]; then + exit 0 +fi + +# upgrade and utils +# export parameters +export DEBIAN_FRONTEND=noninteractive +echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + +#if [ ${CODENAME} == 'jessie' ]; then +#printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list +#fi + +apt-get -qq update +apt-get -qq install -y wget nginx gnupg lsb-release apt-transport-https +#apt-get -qq install -y libterm-readline-gnu-perl dialog gnupg procps + +# echo -e 'Package: *\nPin: origin test.postgrespro.ru\nPin-Priority: 800' >\ +# /etc/apt/preferences.d/pgpro-800 + +# install nginx +echo "127.0.0.1 test.postgrespro.ru" >> /etc/hosts +cat < /etc/nginx/nginx.conf +user www-data; +worker_processes 1; +error_log /var/log/nginx/error.log; +events { + worker_connections 1024; +} +http { + server { + listen 80 default; + root /var/www; + } +} +EOF +nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) + +# add postgresql repo +if [ ${PG_VERSION} == '9.6' ]; then + sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' + wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - + apt-get update -y +fi + +# install POSTGRESPRO +if [ ${EDITION} == 'std' ]; then + sh -c 'echo "deb https://repo.postgrespro.ru/pgpro-${PG_VERSION}/${DISTRIB}/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/pgpro.list' + wget --quiet -O - https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/GPG-KEY-POSTGRESPRO | apt-key add - + apt-get update -y +# apt-get install -y postgrespro-std-${PG_VERSION} + + if [[ ${PG_VERSION} == '9.6' ]]; then + apt-get install -y postgrespro-${PG_VERSION} + BINDIR="/usr/lib/postgresql/${PG_VERSION}/bin" + else + apt-get install -y postgrespro-std-${PG_VERSION} + BINDIR="/opt/pgpro/std-${PG_VERSION}/bin" + export LD_LIBRARY_PATH=/opt/pgpro/std-${PG_VERSION}/lib/ + fi +fi + +# install pg_probackup from current public repo +echo "deb [arch=amd64] http://repo.postgrespro.ru/pg_probackup-forks/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >\ + /etc/apt/sources.list.d/pg_probackup-old.list +wget -O - http://repo.postgrespro.ru/pg_probackup-forks/keys/GPG-KEY-PG_PROBACKUP | apt-key add - && apt-get update + +apt-get install -y pg-probackup-${EDITION}-${PG_VERSION} +pg_probackup-${EDITION}-${PG_VERSION} --help +pg_probackup-${EDITION}-${PG_VERSION} --version + + +if [ ${EDITION} == 'std' ]; then + export PGDATA=/tmp/data + su postgres -c "${BINDIR}/initdb -k -D ${PGDATA}" + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} init -B /tmp/backup" + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" + + echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf + echo "fsync=off" >> ${PGDATA}/postgresql.auto.conf + echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf + echo "archive_command='pg_probackup-${EDITION}-${PG_VERSION} archive-push --no-sync -B /tmp/backup compress --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf + + su postgres -c "${BINDIR}/pg_ctl stop -w -t 60 -D /var/lib/pgpro/std-${PG_VERSION}/data" || echo "it is all good" + su postgres -c "${BINDIR}/pg_ctl start -D ${PGDATA}" + sleep 5 + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} backup --instance=node -b full -B /tmp/backup -D ${PGDATA} --no-sync" + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA} --archive" + + su postgres -c "${BINDIR}/pgbench --no-vacuum -i -s 5" + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" +fi + +# install new packages +echo "deb [arch=amd64] http://test.postgrespro.ru/pg_probackup-forks/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >\ + /etc/apt/sources.list.d/pg_probackup-new.list +wget -O - http://test.postgrespro.ru/pg_probackup-forks/keys/GPG-KEY-PG_PROBACKUP | apt-key add - +apt-get update -y + +#if [ ${EDITION} == 'std' ] && [ ${PG_VERSION} == '9.6' ]; then +# apt-get install -y libpq5 pg-probackup-${EDITION}-${PG_VERSION} +#else +# apt-get install -y pg-probackup-${EDITION}-${PG_VERSION} +#fi + +apt-get install -y pg-probackup-${EDITION}-${PG_VERSION} + +# in Ent 11 and 10 because of PQselect vanilla libpq5 is incompatible with Ent pg_probackup +if [ ${EDITION} == 'ent' ]; then + if [ ${PG_VERSION} == '11' ] || [ ${PG_VERSION} == '10' ] || [ ${PG_VERSION} == '9.6' ]; then + exit 0 + fi +fi + +pg_probackup-${EDITION}-${PG_VERSION} --help +pg_probackup-${EDITION}-${PG_VERSION} --version + +if [ ${EDITION} == 'ent' ]; then + exit 0 +fi + +if [ ${EDITION} == 'std' ] && [ ${PG_VERSION} == '9.6' ]; then + exit 0 +fi + + +#if [ ${CODENAME} == 'precise' ] && [ ${PG_VERSION} != '10' ] && [ ${PG_VERSION} != '11' ]; then + su postgres -c "${BINDIR}/pgbench --no-vacuum -t 1000 -c 1" + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" + + su postgres -c "${BINDIR}/pg_ctl stop -w -t 60 -D ${PGDATA}" + rm -rf ${PGDATA} + + su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} restore --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "${BINDIR}/pg_ctl start -w -t 60 -D ${PGDATA}" + +sleep 5 +echo "select count(*) from pgbench_accounts;" | su postgres -c "${BINDIR}/psql" || exit 1 + +exit 0 diff --git a/packaging/test/scripts/pg_probackup_forks_rpm.sh b/packaging/test/scripts/pg_probackup_forks_rpm.sh new file mode 100755 index 000000000..f58655d7d --- /dev/null +++ b/packaging/test/scripts/pg_probackup_forks_rpm.sh @@ -0,0 +1,173 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') + +if [ ${EDITION} == 'ent' ]; then + exit 0 +fi + +# yum upgrade -y || echo 'some packages in docker failed to upgrade' +# yum install -y sudo + +if [ ${DISTRIB} == 'rhel' ] && [ ${DISTRIB_VERSION} == '6' ]; then + exit 0; +elif [ ${DISTRIB} == 'oraclelinux' ] && [ ${DISTRIB_VERSION} == '6' ]; then + exit 0; +elif [ ${DISTRIB} == 'oraclelinux' ] && [ ${DISTRIB_VERSION} == '8' ]; then + yum install -y nginx +elif [ ${DISTRIB_VERSION} == '7' ]; then + yum install -y https://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.8.1-1.el7.ngx.x86_64.rpm +elif [ ${DISTRIB} == 'oraclelinux' ] && [ ${DISTRIB_VERSION} == '6' ]; then + yum install -y https://nginx.org/packages/rhel/6/x86_64/RPMS/nginx-1.8.1-1.el6.ngx.x86_64.rpm +else + yum install epel-release -y + yum install -y nginx +fi + +if ! getent group nginx > /dev/null 2>&1 ; then + addgroup --system --quiet nginx +fi +if ! getent passwd nginx > /dev/null 2>&1 ; then + adduser --quiet \ + --system --disabled-login --ingroup nginx \ + --home /var/run/nginx/ --no-create-home \ + nginx +fi + +cat < /etc/nginx/nginx.conf +user nginx; +worker_processes 1; +error_log /var/log/nginx/error.log; +events { + worker_connections 1024; +} +http { + server { + listen 80 default; + root /var/www; + } +} +EOF +nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) + +# if [ ${DISTRIB} == 'centos' ]; then + +# install old packages +yum install -y http://repo.postgrespro.ru/pg_probackup-forks/keys/pg_probackup-repo-forks-${DISTRIB}.noarch.rpm +sed -i "s/https/http/g" /etc/yum.repos.d/pg_probackup-forks.repo + +yum install -y ${PKG_NAME} +${PKG_NAME} --help +${PKG_NAME} --version + +if [ $EDITION == 'std' ] ; then + + # install POSTGRESQL + # rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-${DISTRIB_VERSION}-x86_64/pgdg-redhat-repo-latest.noarch.rpm + if [[ ${PG_VERSION} == '11' ]] || [[ ${PG_VERSION} == '12' ]]; then + rpm -ivh https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/postgrespro-std-${PG_VERSION}.${DISTRIB}.yum-${PG_VERSION}-0.3.noarch.rpm + else + rpm -ivh https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/postgrespro-std-${PG_VERSION}.${DISTRIB}.yum-${PG_VERSION}-0.3.noarch.rpm + fi + + if [[ ${PG_VERSION} == '9.6' ]]; then + yum install -y postgrespro${PG_TOG}-server.x86_64 + BINDIR="/usr/pgpro-${PG_VERSION}/bin" + else + yum install -y postgrespro-std-${PG_TOG}-server.x86_64 + BINDIR="/opt/pgpro/std-${PG_VERSION}/bin" + export LD_LIBRARY_PATH=/opt/pgpro/std-${PG_VERSION}/lib/ + fi + + export PGDATA=/tmp/data + + su postgres -c "${BINDIR}/initdb -k -D ${PGDATA}" + echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf + echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf + echo "fsync=off" >> ${PGDATA}/postgresql.auto.conf + echo "archive_command='${PKG_NAME} archive-push -B /tmp/backup --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf + su postgres -c "${BINDIR}/pg_ctl start -D ${PGDATA}" + sleep 5 + + su postgres -c "${PKG_NAME} init -B /tmp/backup" + su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "${PKG_NAME} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA}" + su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA} --archive" + + su postgres -c "${BINDIR}/pgbench --no-vacuum -i -s 5" + su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" +fi + +# install new packages +echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts + +# yum remove -y pg_probackup-repo +#yum install -y http://repo.postgrespro.ru/pg_probackup-forks/keys/pg_probackup-repo-forks-${DISTRIB}.noarch.rpm +#yum clean all -y + +sed -i "s/https/http/g" /etc/yum.repos.d/pg_probackup-forks.repo + +# yum update -y ${PKG_NAME} +yum install -y ${PKG_NAME} +sleep 1 +${PKG_NAME} --help +${PKG_NAME} --version + +if [ $EDITION == 'ent' ]; then + exit 0 +fi + +# su postgres -c "${BINDIR}/pgbench --no-vacuum -t 1000 -c 1" +su postgres -c "${BINDIR}/pgbench --no-vacuum -i -s 5" +su postgres -c "${PKG_NAME} backup --instance=node -b full -B /tmp/backup -D ${PGDATA}" +su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" + +su postgres -c "${BINDIR}/pg_ctl stop -D ${PGDATA}" +rm -rf ${PGDATA} + +su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA}" +su postgres -c "${BINDIR}/pg_ctl start -w -D ${PGDATA}" + +sleep 5 + +echo "select count(*) from pgbench_accounts;" | su postgres -c "${BINDIR}/psql" || exit 1 + +#else +# echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts +# rpm -ivh http://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-${DISTRIB}.noarch.rpm +# yum install -y ${PKG_NAME} +# ${PKG_NAME} --help +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/initdb -k -D ${PGDATA}" +# su postgres -c "${PKG_NAME} init -B /tmp/backup" +# su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" +# echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf +# echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf +# echo "archive_command='${PKG_NAME} archive-push -B /tmp/backup --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl start -D ${PGDATA}" +# sleep 5 +# su postgres -c "${PKG_NAME} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -i -s 10" +# su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -t 1000 -c 1" +# su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" +# su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl stop -D ${PGDATA}" +# rm -rf ${PGDATA} +# su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl start -D ${PGDATA}" +# sleep 10 +# echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/pgsql-${PG_VERSION}/bin/psql" || exit 1 +#fi + +exit 0 diff --git a/packaging/test/scripts/rpm.sh b/packaging/test/scripts/rpm.sh new file mode 100755 index 000000000..fed6cdb4a --- /dev/null +++ b/packaging/test/scripts/rpm.sh @@ -0,0 +1,166 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') + +# yum upgrade -y || echo 'some packages in docker failed to upgrade' +# yum install -y sudo +if [ ${DISTRIB} == 'rhel' ] && [ ${PG_TOG} == '13' ]; then # no packages for PG13 on PGDG + exit 0 +fi + +if [ ${DISTRIB} == 'oraclelinux' ] && [ ${DISTRIB_VERSION} == '6' ] && [ ${PG_TOG} == '13' ]; then # no packages for PG13 on PGDG + exit 0 +fi + +if [ ${DISTRIB_VERSION} == '6' ]; then + yum install -y https://nginx.org/packages/rhel/6/x86_64/RPMS/nginx-1.8.1-1.el6.ngx.x86_64.rpm +elif [ ${DISTRIB} == 'oraclelinux' ] && [ ${DISTRIB_VERSION} == '8' ]; then + yum install -y nginx +elif [ ${DISTRIB_VERSION} == '7' ]; then + yum install -y https://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.8.1-1.el7.ngx.x86_64.rpm +else + yum install epel-release -y + yum install -y nginx +fi + +if ! getent group nginx > /dev/null 2>&1 ; then + addgroup --system --quiet nginx +fi +if ! getent passwd nginx > /dev/null 2>&1 ; then + adduser --quiet \ + --system --disabled-login --ingroup nginx \ + --home /var/run/nginx/ --no-create-home \ + nginx +fi + +cat < /etc/nginx/nginx.conf +user nginx; +worker_processes 1; +error_log /var/log/nginx/error.log; +events { + worker_connections 1024; +} +http { + server { + listen 80 default; + root /var/www; + } +} +EOF +nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) + +# install POSTGRESQL +rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-${DISTRIB_VERSION}-x86_64/pgdg-redhat-repo-latest.noarch.rpm + +if [ ${DISTRIB} == 'oraclelinux' ] && [ ${DISTRIB_VERSION} == '8' ]; then + dnf -qy module disable postgresql +fi + +if [ ${DISTRIB} == 'centos' ] && [ ${DISTRIB_VERSION} == '8' ]; then + dnf -qy module disable postgresql +fi + +yum install -y postgresql${PG_TOG}-server.x86_64 +export PGDATA=/var/lib/pgsql/${PG_VERSION}/data + +# install old packages +yum install -y http://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-${DISTRIB}.noarch.rpm +yum install -y ${PKG_NAME} +${PKG_NAME} --help +${PKG_NAME} --version + +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/initdb -k -D ${PGDATA}" +echo "fsync=off" >> ${PGDATA}/postgresql.auto.conf +echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf +echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf +echo "archive_command='${PKG_NAME} archive-push --no-sync -B /tmp/backup --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl start -D ${PGDATA}" +sleep 5 + +su postgres -c "${PKG_NAME} init -B /tmp/backup" +su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" +su postgres -c "${PKG_NAME} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA} --archive" + +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -i -s 5" +su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" + +# install new packages +echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts + +# yum remove -y pg_probackup-repo +#yum install -y http://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-${DISTRIB}.noarch.rpm +yum clean all -y + +sed -i "s/https/http/g" /etc/yum.repos.d/pg_probackup.repo + +yum update -y ${PKG_NAME} +${PKG_NAME} --help +${PKG_NAME} --version + +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -t 1000 -c 1" +su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" + +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl stop -D ${PGDATA}" +rm -rf ${PGDATA} + +su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl start -w -D ${PGDATA}" + +sleep 5 + +echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/pgsql-${PG_VERSION}/bin/psql" || exit 1 + +#else +# echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts +# rpm -ivh http://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-${DISTRIB}.noarch.rpm +# yum install -y ${PKG_NAME} +# ${PKG_NAME} --help +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/initdb -k -D ${PGDATA}" +# su postgres -c "${PKG_NAME} init -B /tmp/backup" +# su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" +# echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf +# echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf +# echo "archive_command='${PKG_NAME} archive-push -B /tmp/backup --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl start -D ${PGDATA}" +# sleep 5 +# su postgres -c "${PKG_NAME} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -i -s 10" +# su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -t 1000 -c 1" +# su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" +# su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl stop -D ${PGDATA}" +# rm -rf ${PGDATA} +# su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl start -D ${PGDATA}" +# sleep 10 +# echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/pgsql-${PG_VERSION}/bin/psql" || exit 1 +#fi + +exit 0 # while PG12 is not working + +# SRC PACKAGE +cd /mnt +yum install yum-utils rpm-build -y +yumdownloader --source ${PKG_NAME} +rpm -ivh ./*.rpm +cd /root/rpmbuild/SPECS +exit 0 + +# build pg_probackup +yum-builddep -y pg_probackup.spec +rpmbuild -bs pg_probackup.spec +rpmbuild -ba pg_probackup.spec #2>&1 | tee -ai /app/out/build.log diff --git a/packaging/test/scripts/suse.sh b/packaging/test/scripts/suse.sh new file mode 100755 index 000000000..8e262d994 --- /dev/null +++ b/packaging/test/scripts/suse.sh @@ -0,0 +1,174 @@ +#!/usr/bin/env bash + +# Copyright Notice: +# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ +# Distributed under Apache License 2.0 +# Распространяется по лицензии Apache 2.0 + +set -xe +set -o pipefail + +# fix https://github.com/moby/moby/issues/23137 +ulimit -n 1024 + +PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') + +# if [ ${PG_TOG} == '11' ] +# then +# exit 0 +# fi +# +# if [ ${PG_TOG} == '13' ] +# then +# exit 0 +# fi +# +# if [ ${PG_TOG} == '95' ] +# then +# exit 0 +# fi + +# yum upgrade -y || echo 'some packages in docker failed to upgrade' +# yum install -y sudo + +#if [ ${DISTRIB} == 'centos' ] && [ ${DISTRIB_VERSION} == '8' ]; then +# yum install epel-release -y +#else +# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-${DISTRIB_VERSION}.noarch.rpm +#fi + +if [ ${PG_TOG} == '13' ]; then # no packages for PG13 + exit 0 +fi + +if [ ${PG_TOG} == '11' ]; then # no packages for PG11 + exit 0 +fi + +if [ ${PG_TOG} == '95' ]; then # no packages for PG95 + exit 0 +fi + +zypper install -y nginx +if ! getent group nginx > /dev/null 2>&1 ; then + addgroup --system --quiet nginx +fi +if ! getent passwd nginx > /dev/null 2>&1 ; then + adduser --quiet \ + --system --disabled-login --ingroup nginx \ + --home /var/run/nginx/ --no-create-home \ + nginx +fi + +useradd postgres + +cat < /etc/nginx/nginx.conf +user nginx; +worker_processes 1; +error_log /var/log/nginx/error.log; +events { + worker_connections 1024; +} +http { + server { + listen 80 default; + root /var/www; + } +} +EOF +nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) + +# install POSTGRESQL +zypper install -y postgresql${PG_TOG} postgresql${PG_TOG}-server postgresql${PG_TOG}-contrib +export PGDATA=/tmp/data + +# install old packages +zypper install --allow-unsigned-rpm -y http://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-${DISTRIB}.noarch.rpm +zypper --gpg-auto-import-keys install -y ${PKG_NAME} +${PKG_NAME} --help +${PKG_NAME} --version + +su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/initdb -k -D ${PGDATA}" +echo "fsync=off" >> ${PGDATA}/postgresql.auto.conf +echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf +echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf +echo "archive_command='${PKG_NAME} archive-push --no-sync -B /tmp/backup --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf +su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl start -D ${PGDATA}" +sleep 5 + +su postgres -c "${PKG_NAME} init -B /tmp/backup" +su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" +su postgres -c "${PKG_NAME} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA} --archive" + +su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pgbench --no-vacuum -i -s 5" +su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" + +# install new packages +echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts +zypper clean all -y + +sed -i "s/https/http/g" /etc/zypp/repos.d/pg_probackup.repo + +zypper update -y ${PKG_NAME} +${PKG_NAME} --help +${PKG_NAME} --version + +su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pgbench --no-vacuum -t 1000 -c 1" +su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" + +su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pgbench --no-vacuum -t 1000 -c 1" +su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" + +su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl stop -D ${PGDATA}" +rm -rf ${PGDATA} + +su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl start -w -D ${PGDATA}" + +sleep 5 + +echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/psql" || exit 1 + +#else +# echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts +# rpm -ivh http://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-${DISTRIB}.noarch.rpm +# yum install -y ${PKG_NAME} +# ${PKG_NAME} --help +# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/initdb -k -D ${PGDATA}" +# su postgres -c "${PKG_NAME} init -B /tmp/backup" +# su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" +# echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf +# echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf +# echo "archive_command='${PKG_NAME} archive-push -B /tmp/backup --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf +# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl start -D ${PGDATA}" +# sleep 5 +# su postgres -c "${PKG_NAME} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pgbench --no-vacuum -i -s 10" +# su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pgbench --no-vacuum -t 1000 -c 1" +# su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" +# su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl stop -D ${PGDATA}" +# rm -rf ${PGDATA} +# su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA}" +# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl start -D ${PGDATA}" +# sleep 10 +# echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/psql" || exit 1 +#fi + +exit 0 # while PG12 is not working + +# SRC PACKAGE +cd /mnt +yum install yum-utils rpm-build -y +yumdownloader --source ${PKG_NAME} +rpm -ivh ./*.rpm +cd /root/rpmbuild/SPECS +exit 0 + +# build pg_probackup +yum-builddep -y pg_probackup.spec +rpmbuild -bs pg_probackup.spec +rpmbuild -ba pg_probackup.spec #2>&1 | tee -ai /app/out/build.log From 680b64f9728d97a15575aa1c744ac2e1bd57d40a Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 13:39:23 +0300 Subject: [PATCH 16/54] [skip travis] disable pkg testing for PG 9.5 --- packaging/Makefile.test | 44 ++++++++++++++--------------- packaging/test/Makefile.alt | 12 -------- packaging/test/Makefile.centos | 12 -------- packaging/test/Makefile.debian | 12 -------- packaging/test/Makefile.oraclelinux | 12 -------- packaging/test/Makefile.rhel | 12 -------- packaging/test/Makefile.suse | 8 ------ packaging/test/Makefile.ubuntu | 16 ----------- 8 files changed, 22 insertions(+), 106 deletions(-) diff --git a/packaging/Makefile.test b/packaging/Makefile.test index bade328bf..51340373a 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -1,36 +1,36 @@ test: build/test_all @echo Test for all platform: done -build/test_all: build/test_debian build/test_ubuntu build/test_centos build/test_oraclelinux build/test_rhel build/test_alt build/test_suse +build/test_all: build/test_debian build/test_ubuntu build/test_centos build/test_oraclelinux build/test_alt build/test_suse build/test_rhel @echo Package testing is done ### DEBIAN build/test_debian: build/test_debian_8 build/test_debian_9 build/test_debian_10 @echo Debian: done -build/test_debian_8: build/test_debian_8_9.5 build/test_debian_8_9.6 build/test_debian_8_10 build/test_debian_8_11 build/test_debian_8_12 build/test_debian_8_13 +build/test_debian_8: build/test_debian_8_9.6 build/test_debian_8_10 build/test_debian_8_11 build/test_debian_8_12 build/test_debian_8_13 @echo Debian 8: done -build/test_debian_9: build/test_debian_9_9.5 build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 +build/test_debian_9: build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 @echo Debian 9: done -build/test_debian_10: build/test_debian_9_9.5 build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 +build/test_debian_10: build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 @echo Debian 10: done ### UBUNTU build/test_ubuntu: build/test_ubuntu_14.04 build/test_ubuntu_16.04 build/test_ubuntu_18.04 build/test_ubuntu_20.04 @echo Ubuntu: done -build/test_ubuntu_14.04: build/test_ubuntu_14.04_9.5 build/test_ubuntu_14.04_9.6 build/test_ubuntu_14.04_10 build/test_ubuntu_14.04_11 build/test_ubuntu_14.04_12 build/test_ubuntu_14.04_13 +build/test_ubuntu_14.04: build/test_ubuntu_14.04_9.6 build/test_ubuntu_14.04_10 build/test_ubuntu_14.04_11 build/test_ubuntu_14.04_12 build/test_ubuntu_14.04_13 @echo Ubuntu 14.04: -build/test_ubuntu_16.04: build/test_ubuntu_16.04_9.5 build/test_ubuntu_16.04_9.6 build/test_ubuntu_16.04_10 build/test_ubuntu_16.04_11 build/test_ubuntu_16.04_12 build/test_ubuntu_16.04_13 +build/test_ubuntu_16.04: build/test_ubuntu_16.04_9.6 build/test_ubuntu_16.04_10 build/test_ubuntu_16.04_11 build/test_ubuntu_16.04_12 build/test_ubuntu_16.04_13 @echo Ubuntu 16.04: done -build/test_ubuntu_18.04: build/test_ubuntu_18.04_9.5 build/test_ubuntu_18.04_9.6 build/test_ubuntu_18.04_10 build/test_ubuntu_18.04_11 build/test_ubuntu_18.04_12 build/test_ubuntu_18.04_13 +build/test_ubuntu_18.04: build/test_ubuntu_18.04_9.6 build/test_ubuntu_18.04_10 build/test_ubuntu_18.04_11 build/test_ubuntu_18.04_12 build/test_ubuntu_18.04_13 @echo Ubuntu 18.04: done -build/test_ubuntu_20.04: build/test_ubuntu_20.04_9.5 build/test_ubuntu_20.04_9.6 build/test_ubuntu_20.04_10 build/test_ubuntu_20.04_11 build/test_ubuntu_20.04_12 build/test_ubuntu_20.04_13 +build/test_ubuntu_20.04: build/test_ubuntu_20.04_9.6 build/test_ubuntu_20.04_10 build/test_ubuntu_20.04_11 build/test_ubuntu_20.04_12 build/test_ubuntu_20.04_13 @echo Ubuntu 20.04: done define test_deb @@ -52,39 +52,39 @@ include packaging/test/Makefile.ubuntu build/test_centos: build/test_centos_6 build/test_centos_7 build/test_centos_8 @echo Centos: done -build/test_centos_6: build/test_centos_6_9.5 build/test_centos_6_9.6 build/test_centos_6_10 build/test_centos_6_11 build/test_centos_6_12 build/test_centos_6_13 +build/test_centos_6: build/test_centos_6_9.6 build/test_centos_6_10 build/test_centos_6_11 build/test_centos_6_12 build/test_centos_6_13 @echo Centos 6: done -build/test_centos_7: build/test_centos_7_9.5 build/test_centos_7_9.6 build/test_centos_7_10 build/test_centos_7_11 build/test_centos_7_12 build/test_centos_7_13 +build/test_centos_7: build/test_centos_7_9.6 build/test_centos_7_10 build/test_centos_7_11 build/test_centos_7_12 build/test_centos_7_13 @echo Centos 7: done -build/test_centos_8: build/test_centos_8_9.5 build/test_centos_8_9.6 build/test_centos_8_10 build/test_centos_8_11 build/test_centos_8_12 build/test_centos_8_13 +build/test_centos_8: build/test_centos_8_9.6 build/test_centos_8_10 build/test_centos_8_11 build/test_centos_8_12 build/test_centos_8_13 @echo Centos 8: done # Oracle Linux build/test_oraclelinux: build/test_oraclelinux_6 build/test_oraclelinux_7 build/test_oraclelinux_8 @echo Oraclelinux: done -build/test_oraclelinux_6: build/test_oraclelinux_6_9.5 build/test_oraclelinux_6_9.6 build/test_oraclelinux_6_10 build/test_oraclelinux_6_11 build/test_oraclelinux_6_12 build/test_oraclelinux_6_13 +build/test_oraclelinux_6: build/test_oraclelinux_6_9.6 build/test_oraclelinux_6_10 build/test_oraclelinux_6_11 build/test_oraclelinux_6_12 build/test_oraclelinux_6_13 @echo Oraclelinux 6: done -build/test_oraclelinux_7: build/test_oraclelinux_7_9.5 build/test_oraclelinux_7_9.6 build/test_oraclelinux_7_10 build/test_oraclelinux_7_11 build/test_oraclelinux_7_12 build/test_oraclelinux_7_13 +build/test_oraclelinux_7: build/test_oraclelinux_7_9.6 build/test_oraclelinux_7_10 build/test_oraclelinux_7_11 build/test_oraclelinux_7_12 build/test_oraclelinux_7_13 @echo Oraclelinux 7: done -build/test_oraclelinux_8: build/test_oraclelinux_8_9.5 build/test_oraclelinux_8_9.6 build/test_oraclelinux_8_10 build/test_oraclelinux_8_11 build/test_oraclelinux_8_12 build/test_oraclelinux_8_13 +build/test_oraclelinux_8: build/test_oraclelinux_8_9.6 build/test_oraclelinux_8_10 build/test_oraclelinux_8_11 build/test_oraclelinux_8_12 build/test_oraclelinux_8_13 @echo Oraclelinux 8: done # RHEL build/test_rhel: build/test_rhel_6 build/test_rhel_7 build/test_rhel_8 @echo Rhel: done -build/test_rhel_6: build/test_rhel_6_9.5 build/test_rhel_6_9.6 build/test_rhel_6_10 build/test_rhel_6_11 build/test_rhel_6_12 build/test_rhel_6_13 +build/test_rhel_6: build/test_rhel_6_9.6 build/test_rhel_6_10 build/test_rhel_6_11 build/test_rhel_6_12 build/test_rhel_6_13 @echo Rhel 6: done -build/test_rhel_7: build/test_rhel_7_9.5 build/test_rhel_7_9.6 build/test_rhel_7_10 build/test_rhel_7_11 build/test_rhel_7_12 build/test_rhel_7_13 +build/test_rhel_7: build/test_rhel_7_9.6 build/test_rhel_7_10 build/test_rhel_7_11 build/test_rhel_7_12 build/test_rhel_7_13 @echo Rhel 7: done -build/test_rhel_8: build/test_rhel_8_9.5 build/test_rhel_8_9.6 build/test_rhel_8_10 build/test_rhel_8_11 build/test_rhel_8_12 build/test_rhel_8_13 +build/test_rhel_8: build/test_rhel_8_9.6 build/test_rhel_8_10 build/test_rhel_8_11 build/test_rhel_8_12 build/test_rhel_8_13 @echo Rhel 8: done define test_rpm @@ -108,13 +108,13 @@ include packaging/test/Makefile.oraclelinux build/test_alt: build/test_alt_7 build/test_alt_8 build/test_alt_9 @echo Alt Linux: done -build/test_alt_7: build/test_alt_7_9.5 build/test_alt_7_9.6 build/test_alt_7_10 build/test_alt_7_11 build/test_alt_7_12 build/test_alt_7_13 +build/test_alt_7: build/test_alt_7_9.6 build/test_alt_7_10 build/test_alt_7_11 build/test_alt_7_12 build/test_alt_7_13 @echo Alt Linux 7: done -build/test_alt_8: build/test_alt_8_9.5 build/test_alt_8_9.6 build/test_alt_8_10 build/test_alt_8_11 build/test_alt_8_12 build/test_alt_8_13 +build/test_alt_8: build/test_alt_8_9.6 build/test_alt_8_10 build/test_alt_8_11 build/test_alt_8_12 build/test_alt_8_13 @echo Alt Linux 8: done -build/test_alt_9: build/test_alt_9_9.5 build/test_alt_9_9.6 build/test_alt_9_10 build/test_alt_9_11 build/test_alt_9_12 build/test_alt_9_13 +build/test_alt_9: build/test_alt_9_9.6 build/test_alt_9_10 build/test_alt_9_11 build/test_alt_9_12 build/test_alt_9_13 @echo Alt Linux 9: done define test_alt @@ -135,10 +135,10 @@ include packaging/test/Makefile.alt build/test_suse: build/test_suse_15.1 build/test_suse_15.2 @echo Suse: done -build/test_suse_15.1: build/test_suse_15.1_9.5 build/test_suse_15.1_9.6 build/test_suse_15.1_10 build/test_suse_15.1_11 build/test_suse_15.1_12 build/test_suse_15.1_13 +build/test_suse_15.1: build/test_suse_15.1_9.6 build/test_suse_15.1_10 build/test_suse_15.1_11 build/test_suse_15.1_12 build/test_suse_15.1_13 @echo Rhel 15.1: done -build/test_suse_15.2: build/test_suse_15.2_9.5 build/test_suse_15.2_9.6 build/test_suse_15.2_10 build/test_suse_15.2_11 build/test_suse_15.2_12 build/test_suse_15.2_13 +build/test_suse_15.2: build/test_suse_15.2_9.6 build/test_suse_15.2_10 build/test_suse_15.2_11 build/test_suse_15.2_12 build/test_suse_15.2_13 @echo Rhel 15.1: done define test_suse diff --git a/packaging/test/Makefile.alt b/packaging/test/Makefile.alt index 084ed1648..685030430 100644 --- a/packaging/test/Makefile.alt +++ b/packaging/test/Makefile.alt @@ -1,8 +1,4 @@ # ALT 7 -build/test_alt_7_9.5: - $(call test_alt,alt,7,,9.5,9.5.25) - touch build/test_alt_7_9.5 - build/test_alt_7_9.6: $(call test_alt,alt,7,,9.6,9.6.21) touch build/test_alt_7_9.6 @@ -24,10 +20,6 @@ build/test_alt_7_13: touch build/test_alt_7_13 # ALT 8 -build/test_alt_8_9.5: - $(call test_alt,alt,8,,9.5,9.5.25) - touch build/test_alt_8_9.5 - build/test_alt_8_9.6: $(call test_alt,alt,8,,9.6,9.6.21) touch build/test_alt_8_9.6 @@ -49,10 +41,6 @@ build/test_alt_8_13: touch build/test_alt_8_13 # ALT 9 -build/test_alt_9_9.5: - $(call test_alt,alt,9,,9.5,9.5.25) - touch build/test_alt_9_9.5 - build/test_alt_9_9.6: $(call test_alt,alt,9,,9.6,9.6.21) touch build/test_alt_9_9.6 diff --git a/packaging/test/Makefile.centos b/packaging/test/Makefile.centos index 0ae638820..13785b95d 100644 --- a/packaging/test/Makefile.centos +++ b/packaging/test/Makefile.centos @@ -1,8 +1,4 @@ # CENTOS 6 -build/test_centos_6_9.5: - $(call test_rpm,centos,6,,9.5,9.5.25) - touch build/test_centos_6_9.5 - build/test_centos_6_9.6: $(call test_rpm,centos,6,,9.6,9.6.21) touch build/test_centos_6_9.6 @@ -24,10 +20,6 @@ build/test_centos_6_13: touch build/test_centos_6_13 # CENTOS 7 -build/test_centos_7_9.5: - $(call test_rpm,centos,7,,9.5,9.5.25) - touch build/test_centos_7_9.5 - build/test_centos_7_9.6: $(call test_rpm,centos,7,,9.6,9.6.21) touch build/test_centos_7_9.6 @@ -49,10 +41,6 @@ build/test_centos_7_13: touch build/test_centos_7_13 # CENTOS 8 -build/test_centos_8_9.5: - $(call test_rpm,centos,8,,9.5,9.5.25) - touch build/test_centos_8_9.5 - build/test_centos_8_9.6: $(call test_rpm,centos,8,,9.6,9.6.21) touch build/test_centos_8_9.6 diff --git a/packaging/test/Makefile.debian b/packaging/test/Makefile.debian index 259c97a9b..71fbee51a 100644 --- a/packaging/test/Makefile.debian +++ b/packaging/test/Makefile.debian @@ -1,8 +1,4 @@ # DEBIAN 8 -build/test_debian_8_9.5: - $(call test_deb,debian,8,jessie,9.5,9.5.25) - touch build/test_debian_8_9.5 - build/test_debian_8_9.6: $(call test_deb,debian,8,jessie,9.6,9.6.21) touch build/test_debian_8_9.6 @@ -24,10 +20,6 @@ build/test_debian_8_13: touch build/test_debian_8_13 # DEBIAN 9 -build/test_debian_9_9.5: - $(call test_deb,debian,9,stretch,9.5,9.5.25) - touch build/test_debian_9_9.5 - build/test_debian_9_9.6: $(call test_deb,debian,9,stretch,9.6,9.6.21) touch build/test_debian_9_9.6 @@ -49,10 +41,6 @@ build/test_debian_9_13: touch build/test_debian_9_13 # DEBIAN 10 -build/test_debian_10_9.5: - $(call test_deb,debian,10,buster,9.5,9.5.25) - touch build/test_debian_10_9.5 - build/test_debian_10_9.6: $(call test_deb,debian,10,buster,9.6,9.6.21) touch build/test_debian_10_9.6 diff --git a/packaging/test/Makefile.oraclelinux b/packaging/test/Makefile.oraclelinux index 383d3688c..61a9ea4e3 100644 --- a/packaging/test/Makefile.oraclelinux +++ b/packaging/test/Makefile.oraclelinux @@ -1,8 +1,4 @@ # ORACLE LINUX 6 -build/test_oraclelinux_6_9.5: - $(call test_rpm,oraclelinux,6,,9.5,9.5.25) - touch build/test_oraclelinux_6_9.5 - build/test_oraclelinux_6_9.6: $(call test_rpm,oraclelinux,6,,9.6,9.6.21) touch build/test_oraclelinux_6_9.6 @@ -24,10 +20,6 @@ build/test_oraclelinux_6_13: touch build/test_oraclelinux_6_13 # ORACLE LINUX 7 -build/test_oraclelinux_7_9.5: - $(call test_rpm,oraclelinux,7,,9.5,9.5.25) - touch build/test_oraclelinux_7_9.5 - build/test_oraclelinux_7_9.6: $(call test_rpm,oraclelinux,7,,9.6,9.6.21) touch build/test_oraclelinux_7_9.6 @@ -49,10 +41,6 @@ build/test_oraclelinux_7_13: touch build/test_oraclelinux_7_13 # ORACLE LINUX 8 -build/test_oraclelinux_8_9.5: - $(call test_rpm,oraclelinux,8,,9.5,9.5.25) - touch build/test_oraclelinux_8_9.5 - build/test_oraclelinux_8_9.6: $(call test_rpm,oraclelinux,8,,9.6,9.6.21) touch build/test_oraclelinux_8_9.6 diff --git a/packaging/test/Makefile.rhel b/packaging/test/Makefile.rhel index 69dc24dcd..b1170b67b 100644 --- a/packaging/test/Makefile.rhel +++ b/packaging/test/Makefile.rhel @@ -1,8 +1,4 @@ # RHEL 6 -build/test_rhel_6_9.5: - $(call test_rpm,rhel,6,6Server,9.5,9.5.25) - touch build/test_rhel_6_9.5 - build/test_rhel_6_9.6: $(call test_rpm,rhel,6,6Server,9.6,9.6.21) touch build/test_rhel_6_9.6 @@ -24,10 +20,6 @@ build/test_rhel_6_13: touch build/test_rhel_6_13 # RHEL 7 -build/test_rhel_7_9.5: - $(call test_rpm,rhel,7,7Server,9.5,9.5.25) - touch build/test_rhel_7_9.5 - build/test_rhel_7_9.6: $(call test_rpm,rhel,7,7Server,9.6,9.6.21) touch build/test_rhel_7_9.6 @@ -49,10 +41,6 @@ build/test_rhel_7_13: touch build/test_rhel_7_13 # RHEL 8 -build/test_rhel_8_9.5: - $(call test_rpm,rhel,8,8Server,9.5,9.5.25) - touch build/test_rhel_8_9.5 - build/test_rhel_8_9.6: $(call test_rpm,rhel,8,8Server,9.6,9.6.21) touch build/test_rhel_8_9.6 diff --git a/packaging/test/Makefile.suse b/packaging/test/Makefile.suse index 76e0518a2..9257bdbfd 100644 --- a/packaging/test/Makefile.suse +++ b/packaging/test/Makefile.suse @@ -1,8 +1,4 @@ # Suse 15.1 -build/test_suse_15.1_9.5: - $(call test_suse,suse,15.1,,9.5,9.5.25) - touch build/test_suse_15.1_9.5 - build/test_suse_15.1_9.6: $(call test_suse,suse,15.1,,9.6,9.6.21) touch build/test_suse_15.1_9.6 @@ -24,10 +20,6 @@ build/test_suse_15.1_13: touch build/test_suse_15.1_13 # Suse 15.2 -build/test_suse_15.2_9.5: - $(call test_suse,suse,15.2,,9.5,9.5.25) - touch build/test_suse_15.2_9.5 - build/test_suse_15.2_9.6: $(call test_suse,suse,15.2,,9.6,9.6.21) touch build/test_suse_15.2_9.6 diff --git a/packaging/test/Makefile.ubuntu b/packaging/test/Makefile.ubuntu index 7d66a7544..b39df69a9 100644 --- a/packaging/test/Makefile.ubuntu +++ b/packaging/test/Makefile.ubuntu @@ -1,8 +1,4 @@ # UBUNTU 20.04 -build/test_ubuntu_20.04_9.5: - $(call test_deb,ubuntu,20.04,focal,9.5,9.5.25) - touch build/test_ubuntu_20.04_9.5 - build/test_ubuntu_20.04_9.6: $(call test_deb,ubuntu,20.04,focal,9.6,9.6.21) touch build/test_ubuntu_20.04_9.6 @@ -24,10 +20,6 @@ build/test_ubuntu_20.04_13: touch build/test_ubuntu_20.04_13 # UBUNTU 18.04 -build/test_ubuntu_18.04_9.5: - $(call test_deb,ubuntu,18.04,bionic,9.5,9.5.25) - touch build/test_ubuntu_18.04_9.5 - build/test_ubuntu_18.04_9.6: $(call test_deb,ubuntu,18.04,bionic,9.6,9.6.21) touch build/test_ubuntu_18.04_9.6 @@ -49,10 +41,6 @@ build/test_ubuntu_18.04_13: touch build/test_ubuntu_18.04_13 # UBUNTU 16.04 -build/test_ubuntu_16.04_9.5: - $(call test_deb,ubuntu,16.04,xenial,9.5,9.5.25) - touch build/test_ubuntu_16.04_9.5 - build/test_ubuntu_16.04_9.6: $(call test_deb,ubuntu,16.04,xenial,9.6,9.6.21) touch build/test_ubuntu_16.04_9.6 @@ -74,10 +62,6 @@ build/test_ubuntu_16.04_13: touch build/test_ubuntu_16.04_13 # UBUNTU 14.04 -build/test_ubuntu_14.04_9.5: - $(call test_deb,ubuntu,14.04,trusty,9.5,9.5.25) - touch build/test_ubuntu_14.04_9.5 - build/test_ubuntu_14.04_9.6: $(call test_deb,ubuntu,14.04,trusty,9.6,9.6.21) touch build/test_ubuntu_14.04_9.6 From 75df3c390a21d13f0ac46d5f7604ec6ebab6d3e6 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 13:42:31 +0300 Subject: [PATCH 17/54] [skip travis] disable pkg testing for Debian 8 --- packaging/Makefile.test | 5 +---- packaging/test/Makefile.debian | 21 --------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/packaging/Makefile.test b/packaging/Makefile.test index 51340373a..ddd1e801b 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -5,12 +5,9 @@ build/test_all: build/test_debian build/test_ubuntu build/test_centos build/test @echo Package testing is done ### DEBIAN -build/test_debian: build/test_debian_8 build/test_debian_9 build/test_debian_10 +build/test_debian: build/test_debian_9 build/test_debian_10 @echo Debian: done -build/test_debian_8: build/test_debian_8_9.6 build/test_debian_8_10 build/test_debian_8_11 build/test_debian_8_12 build/test_debian_8_13 - @echo Debian 8: done - build/test_debian_9: build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 @echo Debian 9: done diff --git a/packaging/test/Makefile.debian b/packaging/test/Makefile.debian index 71fbee51a..f540f9205 100644 --- a/packaging/test/Makefile.debian +++ b/packaging/test/Makefile.debian @@ -1,24 +1,3 @@ -# DEBIAN 8 -build/test_debian_8_9.6: - $(call test_deb,debian,8,jessie,9.6,9.6.21) - touch build/test_debian_8_9.6 - -build/test_debian_8_10: - $(call test_deb,debian,8,jessie,10,10.16) - touch build/test_debian_8_10 - -build/test_debian_8_11: - $(call test_deb,debian,8,jessie,11,11.11) - touch build/test_debian_8_11 - -build/test_debian_8_12: - $(call test_deb,debian,8,jessie,12,12.6) - touch build/test_debian_8_12 - -build/test_debian_8_13: - $(call test_deb,debian,8,jessie,13,13.2) - touch build/test_debian_8_13 - # DEBIAN 9 build/test_debian_9_9.6: $(call test_deb,debian,9,stretch,9.6,9.6.21) From 645e3552b9e87ab5b7bfdfe418d7d7e4b6895773 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 13:48:32 +0300 Subject: [PATCH 18/54] [skip travis] fix deb.sh --- packaging/test/scripts/deb.sh | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/packaging/test/scripts/deb.sh b/packaging/test/scripts/deb.sh index 3d6fbcdc5..49208bf45 100755 --- a/packaging/test/scripts/deb.sh +++ b/packaging/test/scripts/deb.sh @@ -17,17 +17,13 @@ PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') export DEBIAN_FRONTEND=noninteractive echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections -if [ ${DISTRIB} == 'ubuntu' ] && [ ${DISTRIB_VERSION} == '14.04' ] && [ ${PG_TOG} == '12' ]; then - exit 0 -fi - -if [ ${DISTRIB} == 'ubuntu' ] && [ ${DISTRIB_VERSION} == '14.04' ] && [ ${PG_TOG} == '13' ]; then - exit 0 -fi - -if [ ${DISTRIB} == 'debian' ] && [ ${DISTRIB_VERSION} == '8' ] && [ ${PG_TOG} == '13' ]; then - exit 0 -fi +#if [ ${DISTRIB} == 'ubuntu' ] && [ ${DISTRIB_VERSION} == '14.04' ] && [ ${PG_TOG} == '12' ]; then +# exit 0 +#fi +# +#if [ ${DISTRIB} == 'ubuntu' ] && [ ${DISTRIB_VERSION} == '14.04' ] && [ ${PG_TOG} == '13' ]; then +# exit 0 +#fi #if [ ${CODENAME} == 'jessie' ]; then #printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list @@ -66,15 +62,14 @@ nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) apt-get install -y postgresql-${PG_VERSION} #fi -## install pg_probackup from current public repo -##if [ $CODENAME != 'cosmic' ]; then # Bionic do not have package in repo -#echo "deb [arch=amd64] http://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >\ -# /etc/apt/sources.list.d/pg_probackup-old.list -#wget -O - http://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | apt-key add - && apt-get update -# -#apt-get install -y pg-probackup-${PG_VERSION} -#pg_probackup-${PG_VERSION} --help -#pg_probackup-${PG_VERSION} --version +# install pg_probackup from current public repo +echo "deb [arch=amd64] http://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >\ + /etc/apt/sources.list.d/pg_probackup-old.list +wget -O - http://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | apt-key add - && apt-get update + +apt-get install -y pg-probackup-${PG_VERSION} +pg_probackup-${PG_VERSION} --help +pg_probackup-${PG_VERSION} --version # Artful do no have PostgreSQL packages at all, Precise do not have PostgreSQL 10 #if [ ${CODENAME} == 'precise' ] && [ ${PG_VERSION} != '10' ] && [ ${PG_VERSION} != '11' ]; then From 45e42fe12d1b910b4b5f6ce31efeb36300645d72 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 13:51:09 +0300 Subject: [PATCH 19/54] [skip travis] fix deb.sh --- packaging/test/scripts/deb.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packaging/test/scripts/deb.sh b/packaging/test/scripts/deb.sh index 49208bf45..7d3303058 100755 --- a/packaging/test/scripts/deb.sh +++ b/packaging/test/scripts/deb.sh @@ -75,8 +75,8 @@ pg_probackup-${PG_VERSION} --version #if [ ${CODENAME} == 'precise' ] && [ ${PG_VERSION} != '10' ] && [ ${PG_VERSION} != '11' ]; then export PGDATA=/var/lib/postgresql/${PG_VERSION}/data su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/initdb -k -D ${PGDATA}" -# su postgres -c "pg_probackup-${PG_VERSION} init -B /tmp/backup" -# su postgres -c "pg_probackup-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PG_VERSION} init -B /tmp/backup" + su postgres -c "pg_probackup-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf echo "fsync=off" >> ${PGDATA}/postgresql.auto.conf @@ -85,12 +85,12 @@ pg_probackup-${PG_VERSION} --version su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pg_ctl start -D ${PGDATA}" sleep 5 -# su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node -b full -B /tmp/backup -D ${PGDATA} --no-sync" -# su postgres -c "pg_probackup-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" -# su postgres -c "pg_probackup-${PG_VERSION} show --instance=node -B /tmp/backup --archive -D ${PGDATA}" + su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node -b full -B /tmp/backup -D ${PGDATA} --no-sync" + su postgres -c "pg_probackup-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PG_VERSION} show --instance=node -B /tmp/backup --archive -D ${PGDATA}" su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pgbench --no-vacuum -i -s 5" -# su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" + su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" #fi # install new packages From 97e8f13658e2d22e85ad31dfde2d11b3517c18e6 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 13:53:25 +0300 Subject: [PATCH 20/54] [skip travis] fix deb.sh --- packaging/test/scripts/deb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/test/scripts/deb.sh b/packaging/test/scripts/deb.sh index 7d3303058..63d531735 100755 --- a/packaging/test/scripts/deb.sh +++ b/packaging/test/scripts/deb.sh @@ -48,7 +48,7 @@ events { http { server { listen 80 default; - root /var/www; + root /app/www; } } EOF From cd15ba234f71618ef15afe930f2fc500d4bb835c Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 13:55:38 +0300 Subject: [PATCH 21/54] [skip travis] fix deb.sh --- packaging/test/scripts/deb.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/test/scripts/deb.sh b/packaging/test/scripts/deb.sh index 63d531735..986117922 100755 --- a/packaging/test/scripts/deb.sh +++ b/packaging/test/scripts/deb.sh @@ -111,9 +111,9 @@ pg_probackup-${PG_VERSION} --version # su postgres -c "${PKG_NAME} init -B /tmp/backup" # su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" - su postgres -c "pg_probackup-${PG_VERSION} init -B /tmp/backup" - su postgres -c "pg_probackup-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" - su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA} --no-sync" +# su postgres -c "pg_probackup-${PG_VERSION} init -B /tmp/backup" +# su postgres -c "pg_probackup-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node --compress -b delta -B /tmp/backup -D ${PGDATA} --no-sync" su postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/pgbench --no-vacuum -t 1000 -c 1" su postgres -c "pg_probackup-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" su postgres -c "pg_probackup-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" From 8151b9cde201195738c2ae25ce0c3b9f1cf07cc7 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 14:06:29 +0300 Subject: [PATCH 22/54] [skip travis] fix deb.sh --- packaging/Makefile.test | 5 +- packaging/test/Makefile.ubuntu | 85 +++++++++++++--------------------- packaging/test/scripts/deb.sh | 12 ----- 3 files changed, 33 insertions(+), 69 deletions(-) diff --git a/packaging/Makefile.test b/packaging/Makefile.test index ddd1e801b..dc8a6ce47 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -15,12 +15,9 @@ build/test_debian_10: build/test_debian_9_9.6 build/test_debian_9_10 build/test_ @echo Debian 10: done ### UBUNTU -build/test_ubuntu: build/test_ubuntu_14.04 build/test_ubuntu_16.04 build/test_ubuntu_18.04 build/test_ubuntu_20.04 +build/test_ubuntu: build/test_ubuntu_16.04 build/test_ubuntu_18.04 build/test_ubuntu_20.04 @echo Ubuntu: done -build/test_ubuntu_14.04: build/test_ubuntu_14.04_9.6 build/test_ubuntu_14.04_10 build/test_ubuntu_14.04_11 build/test_ubuntu_14.04_12 build/test_ubuntu_14.04_13 - @echo Ubuntu 14.04: - build/test_ubuntu_16.04: build/test_ubuntu_16.04_9.6 build/test_ubuntu_16.04_10 build/test_ubuntu_16.04_11 build/test_ubuntu_16.04_12 build/test_ubuntu_16.04_13 @echo Ubuntu 16.04: done diff --git a/packaging/test/Makefile.ubuntu b/packaging/test/Makefile.ubuntu index b39df69a9..9e201a30b 100644 --- a/packaging/test/Makefile.ubuntu +++ b/packaging/test/Makefile.ubuntu @@ -1,23 +1,23 @@ -# UBUNTU 20.04 -build/test_ubuntu_20.04_9.6: - $(call test_deb,ubuntu,20.04,focal,9.6,9.6.21) - touch build/test_ubuntu_20.04_9.6 +# UBUNTU 16.04 +build/test_ubuntu_16.04_9.6: + $(call test_deb,ubuntu,16.04,xenial,9.6,9.6.21) + touch build/test_ubuntu_16.04_9.6 -build/test_ubuntu_20.04_10: - $(call test_deb,ubuntu,20.04,focal,10,10.16) - touch build/test_ubuntu_20.04_10 +build/test_ubuntu_16.04_10: + $(call test_deb,ubuntu,16.04,xenial,10,10.16) + touch build/test_ubuntu_16.04_10 -build/test_ubuntu_20.04_11: - $(call test_deb,ubuntu,20.04,focal,11,11.11) - touch build/test_ubuntu_20.04_11 +build/test_ubuntu_16.04_11: + $(call test_deb,ubuntu,16.04,xenial,11,11.11) + touch build/test_ubuntu_16.04_11 -build/test_ubuntu_20.04_12: - $(call test_deb,ubuntu,20.04,focal,12,12.6) - touch build/test_ubuntu_20.04_12 +build/test_ubuntu_16.04_12: + $(call test_deb,ubuntu,16.04,xenial,12,12.6) + touch build/test_ubuntu_16.04_12 -build/test_ubuntu_20.04_13: - $(call test_deb,ubuntu,20.04,focal,13,13.2) - touch build/test_ubuntu_20.04_13 +build/test_ubuntu_16.04_13: + $(call test_deb,ubuntu,16.04,xenial,13,13.2) + touch build/test_ubuntu_16.04_13 # UBUNTU 18.04 build/test_ubuntu_18.04_9.6: @@ -40,44 +40,23 @@ build/test_ubuntu_18.04_13: $(call test_deb,ubuntu,18.04,bionic,13,13.2) touch build/test_ubuntu_18.04_13 -# UBUNTU 16.04 -build/test_ubuntu_16.04_9.6: - $(call test_deb,ubuntu,16.04,xenial,9.6,9.6.21) - touch build/test_ubuntu_16.04_9.6 - -build/test_ubuntu_16.04_10: - $(call test_deb,ubuntu,16.04,xenial,10,10.16) - touch build/test_ubuntu_16.04_10 - -build/test_ubuntu_16.04_11: - $(call test_deb,ubuntu,16.04,xenial,11,11.11) - touch build/test_ubuntu_16.04_11 - -build/test_ubuntu_16.04_12: - $(call test_deb,ubuntu,16.04,xenial,12,12.6) - touch build/test_ubuntu_16.04_12 - -build/test_ubuntu_16.04_13: - $(call test_deb,ubuntu,16.04,xenial,13,13.2) - touch build/test_ubuntu_16.04_13 - -# UBUNTU 14.04 -build/test_ubuntu_14.04_9.6: - $(call test_deb,ubuntu,14.04,trusty,9.6,9.6.21) - touch build/test_ubuntu_14.04_9.6 +# UBUNTU 20.04 +build/test_ubuntu_20.04_9.6: + $(call test_deb,ubuntu,20.04,focal,9.6,9.6.21) + touch build/test_ubuntu_20.04_9.6 -build/test_ubuntu_14.04_10: - $(call test_deb,ubuntu,14.04,trusty,10,10.16) - touch build/test_ubuntu_14.04_10 +build/test_ubuntu_20.04_10: + $(call test_deb,ubuntu,20.04,focal,10,10.16) + touch build/test_ubuntu_20.04_10 -build/test_ubuntu_14.04_11: - $(call test_deb,ubuntu,14.04,trusty,11,11.11) - touch build/test_ubuntu_14.04_11 +build/test_ubuntu_20.04_11: + $(call test_deb,ubuntu,20.04,focal,11,11.11) + touch build/test_ubuntu_20.04_11 -build/test_ubuntu_14.04_12: - $(call test_deb,ubuntu,14.04,trusty,12,12.6) - touch build/test_ubuntu_14.04_12 +build/test_ubuntu_20.04_12: + $(call test_deb,ubuntu,20.04,focal,12,12.6) + touch build/test_ubuntu_20.04_12 -build/test_ubuntu_14.04_13: - $(call test_deb,ubuntu,14.04,trusty,13,13.2) - touch build/test_ubuntu_14.04_13 +build/test_ubuntu_20.04_13: + $(call test_deb,ubuntu,20.04,focal,13,13.2) + touch build/test_ubuntu_20.04_13 diff --git a/packaging/test/scripts/deb.sh b/packaging/test/scripts/deb.sh index 986117922..76e3bb043 100755 --- a/packaging/test/scripts/deb.sh +++ b/packaging/test/scripts/deb.sh @@ -17,18 +17,6 @@ PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') export DEBIAN_FRONTEND=noninteractive echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections -#if [ ${DISTRIB} == 'ubuntu' ] && [ ${DISTRIB_VERSION} == '14.04' ] && [ ${PG_TOG} == '12' ]; then -# exit 0 -#fi -# -#if [ ${DISTRIB} == 'ubuntu' ] && [ ${DISTRIB_VERSION} == '14.04' ] && [ ${PG_TOG} == '13' ]; then -# exit 0 -#fi - -#if [ ${CODENAME} == 'jessie' ]; then -#printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list -#fi - apt-get -qq update apt-get -qq install -y wget nginx gnupg lsb-release #apt-get -qq install -y libterm-readline-gnu-perl dialog gnupg procps From 90b293536863a4c699b0a0e20bcb5db007112248 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:09:33 +0300 Subject: [PATCH 23/54] [skip travis] fix rpm.sh --- packaging/Makefile.test | 5 +---- packaging/test/Makefile.centos | 21 --------------------- packaging/test/scripts/rpm.sh | 8 ++++---- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/packaging/Makefile.test b/packaging/Makefile.test index dc8a6ce47..9b9517134 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -43,12 +43,9 @@ include packaging/test/Makefile.debian include packaging/test/Makefile.ubuntu # CENTOS -build/test_centos: build/test_centos_6 build/test_centos_7 build/test_centos_8 +build/test_centos: build/test_centos_7 build/test_centos_8 @echo Centos: done -build/test_centos_6: build/test_centos_6_9.6 build/test_centos_6_10 build/test_centos_6_11 build/test_centos_6_12 build/test_centos_6_13 - @echo Centos 6: done - build/test_centos_7: build/test_centos_7_9.6 build/test_centos_7_10 build/test_centos_7_11 build/test_centos_7_12 build/test_centos_7_13 @echo Centos 7: done diff --git a/packaging/test/Makefile.centos b/packaging/test/Makefile.centos index 13785b95d..e3787c612 100644 --- a/packaging/test/Makefile.centos +++ b/packaging/test/Makefile.centos @@ -1,24 +1,3 @@ -# CENTOS 6 -build/test_centos_6_9.6: - $(call test_rpm,centos,6,,9.6,9.6.21) - touch build/test_centos_6_9.6 - -build/test_centos_6_10: - $(call test_rpm,centos,6,,10,10.16) - touch build/test_centos_6_10 - -build/test_centos_6_11: - $(call test_rpm,centos,6,,11,11.11) - touch build/test_centos_6_11 - -build/test_centos_6_12: - $(call test_rpm,centos,6,,12,12.6) - touch build/test_centos_6_12 - -build/test_centos_6_13: - $(call test_rpm,centos,6,,13,13.2) - touch build/test_centos_6_13 - # CENTOS 7 build/test_centos_7_9.6: $(call test_rpm,centos,7,,9.6,9.6.21) diff --git a/packaging/test/scripts/rpm.sh b/packaging/test/scripts/rpm.sh index fed6cdb4a..3f24cc7e5 100755 --- a/packaging/test/scripts/rpm.sh +++ b/packaging/test/scripts/rpm.sh @@ -19,9 +19,9 @@ if [ ${DISTRIB} == 'rhel' ] && [ ${PG_TOG} == '13' ]; then # no packages for PG1 exit 0 fi -if [ ${DISTRIB} == 'oraclelinux' ] && [ ${DISTRIB_VERSION} == '6' ] && [ ${PG_TOG} == '13' ]; then # no packages for PG13 on PGDG - exit 0 -fi +#if [ ${DISTRIB} == 'oraclelinux' ] && [ ${DISTRIB_VERSION} == '6' ] && [ ${PG_TOG} == '13' ]; then # no packages for PG13 on PGDG +# exit 0 +#fi if [ ${DISTRIB_VERSION} == '6' ]; then yum install -y https://nginx.org/packages/rhel/6/x86_64/RPMS/nginx-1.8.1-1.el6.ngx.x86_64.rpm @@ -54,7 +54,7 @@ events { http { server { listen 80 default; - root /var/www; + root /app/www; } } EOF From 1344d42ca7ba8db1173d26379c7291b6aac5d8a5 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:28:03 +0300 Subject: [PATCH 24/54] [skip travis] fix alt and suse tests --- packaging/test/scripts/alt.sh | 10 ++++++++-- packaging/test/scripts/suse.sh | 31 ++----------------------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/packaging/test/scripts/alt.sh b/packaging/test/scripts/alt.sh index 5851f5565..8d37f1851 100755 --- a/packaging/test/scripts/alt.sh +++ b/packaging/test/scripts/alt.sh @@ -26,7 +26,7 @@ events { http { server { listen 80 default; - root /var/www; + root /app/www; } } EOF @@ -38,6 +38,11 @@ EOF export PGDATA=/var/lib/pgsql/${PG_VERSION}/data # install old packages +echo "rpm https://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p7 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list +apt-get update +apt-get install ${PKG_NAME} ${PKG_NAME}-debuginfo -y +${PKG_NAME} --help +${PKG_NAME} --version # install new packages echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts @@ -51,8 +56,9 @@ ${PKG_NAME} --version exit 0 +# TODO: run init, add-instance, backup and restore su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pgbench --no-vacuum -t 1000 -c 1" -su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" +su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync --compress" su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" su postgres -c "/usr/pgsql-${PG_VERSION}/bin/pg_ctl stop -D ${PGDATA}" diff --git a/packaging/test/scripts/suse.sh b/packaging/test/scripts/suse.sh index 8e262d994..a0a0aa399 100755 --- a/packaging/test/scripts/suse.sh +++ b/packaging/test/scripts/suse.sh @@ -72,7 +72,7 @@ events { http { server { listen 80 default; - root /var/www; + root /app/www; } } EOF @@ -131,34 +131,7 @@ sleep 5 echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/psql" || exit 1 -#else -# echo "127.0.0.1 repo.postgrespro.ru" >> /etc/hosts -# rpm -ivh http://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-${DISTRIB}.noarch.rpm -# yum install -y ${PKG_NAME} -# ${PKG_NAME} --help -# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/initdb -k -D ${PGDATA}" -# su postgres -c "${PKG_NAME} init -B /tmp/backup" -# su postgres -c "${PKG_NAME} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" -# echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf -# echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf -# echo "archive_command='${PKG_NAME} archive-push -B /tmp/backup --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf -# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl start -D ${PGDATA}" -# sleep 5 -# su postgres -c "${PKG_NAME} backup --instance=node --compress -b full -B /tmp/backup -D ${PGDATA}" -# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pgbench --no-vacuum -i -s 10" -# su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" -# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pgbench --no-vacuum -t 1000 -c 1" -# su postgres -c "${PKG_NAME} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" -# su postgres -c "${PKG_NAME} show --instance=node -B /tmp/backup -D ${PGDATA}" -# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl stop -D ${PGDATA}" -# rm -rf ${PGDATA} -# su postgres -c "${PKG_NAME} restore --instance=node -B /tmp/backup -D ${PGDATA}" -# su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/pg_ctl start -D ${PGDATA}" -# sleep 10 -# echo "select count(*) from pgbench_accounts;" | su postgres -c "/usr/lib/postgresql${PG_TOG}/bin/psql" || exit 1 -#fi - -exit 0 # while PG12 is not working +exit 0 # SRC PACKAGE cd /mnt From 73564793fba2764e500d3638f6a0ed4d66f90068 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:34:19 +0300 Subject: [PATCH 25/54] [skip travis] remove oracle linux 6 --- packaging/Makefile.test | 5 +---- packaging/test/Makefile.oraclelinux | 21 --------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/packaging/Makefile.test b/packaging/Makefile.test index 9b9517134..c47667857 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -53,12 +53,9 @@ build/test_centos_8: build/test_centos_8_9.6 build/test_centos_8_10 build/test_c @echo Centos 8: done # Oracle Linux -build/test_oraclelinux: build/test_oraclelinux_6 build/test_oraclelinux_7 build/test_oraclelinux_8 +build/test_oraclelinux: build/test_oraclelinux_7 build/test_oraclelinux_8 @echo Oraclelinux: done -build/test_oraclelinux_6: build/test_oraclelinux_6_9.6 build/test_oraclelinux_6_10 build/test_oraclelinux_6_11 build/test_oraclelinux_6_12 build/test_oraclelinux_6_13 - @echo Oraclelinux 6: done - build/test_oraclelinux_7: build/test_oraclelinux_7_9.6 build/test_oraclelinux_7_10 build/test_oraclelinux_7_11 build/test_oraclelinux_7_12 build/test_oraclelinux_7_13 @echo Oraclelinux 7: done diff --git a/packaging/test/Makefile.oraclelinux b/packaging/test/Makefile.oraclelinux index 61a9ea4e3..fdf44de8b 100644 --- a/packaging/test/Makefile.oraclelinux +++ b/packaging/test/Makefile.oraclelinux @@ -1,24 +1,3 @@ -# ORACLE LINUX 6 -build/test_oraclelinux_6_9.6: - $(call test_rpm,oraclelinux,6,,9.6,9.6.21) - touch build/test_oraclelinux_6_9.6 - -build/test_oraclelinux_6_10: - $(call test_rpm,oraclelinux,6,,10,10.16) - touch build/test_oraclelinux_6_10 - -build/test_oraclelinux_6_11: - $(call test_rpm,oraclelinux,6,,11,11.11) - touch build/test_oraclelinux_6_11 - -build/test_oraclelinux_6_12: - $(call test_rpm,oraclelinux,6,,12,12.6) - touch build/test_oraclelinux_6_12 - -build/test_oraclelinux_6_13: - $(call test_rpm,oraclelinux,6,,13,13.2) - touch build/test_oraclelinux_6_13 - # ORACLE LINUX 7 build/test_oraclelinux_7_9.6: $(call test_rpm,oraclelinux,7,,9.6,9.6.21) From 07f73ee64cd375d04dcbc87a171deb1f95542cac Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:40:17 +0300 Subject: [PATCH 26/54] [skip travis] correct repo path for rhel and oracle linux --- packaging/Makefile.repo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index ee2535ce8..5fa63fafd 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -59,11 +59,11 @@ repo/oraclelinux: build/repo_oraclelinux_6 build/repo_oraclelinux_7 build/repo_o @echo Build repo for oraclelinux platforms: done build/repo_oraclelinux_6: - $(call build_repo_rpm,oraclelinux,6,,) + $(call build_repo_rpm,oraclelinux,6,6Server) touch build/repo_oraclelinux_6 build/repo_oraclelinux_7: - $(call build_repo_rpm,oraclelinux,7,,) + $(call build_repo_rpm,oraclelinux,7,7Server) touch build/repo_oraclelinux_7 build/repo_oraclelinux_8: @@ -75,11 +75,11 @@ repo/rhel: build/repo_rhel_6 build/repo_rhel_7 build/repo_rhel_8 @echo Build repo for rhel platforms: done build/repo_rhel_6: - $(call build_repo_rpm,rhel,6,,) + $(call build_repo_rpm,rhel,6,6Server) touch build/repo_rhel_6 build/repo_rhel_7: - $(call build_repo_rpm,rhel,7,,) + $(call build_repo_rpm,rhel,7,7Server) touch build/repo_rhel_7 build/repo_rhel_8: From 90ae537f230c080dcbe5fc72c91d3ae66711658d Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:43:16 +0300 Subject: [PATCH 27/54] [skip travis] minor fix --- packaging/Makefile.pkg | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 2a4bbf2e2..eb9040810 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -1,3 +1,18 @@ +ifeq ($(PBK_EDITION),std) + PBK_PKG_REPO = pg_probackup-forks + PBK_EDITION_FULL = Standart + PKG_NAME_SUFFIX = std- +else ifeq ($(PBK_EDITION),ent) + PBK_PKG_REPO = pg_probackup-forks + PBK_EDITION_FULL = Enterprise + PKG_NAME_SUFFIX = ent- +else + PBK_PKG_REPO = pg_probackup + PBK_EDITION_FULL = + PBK_EDITION = + PKG_NAME_SUFFIX = +endif + check_env: @if [ -z ${PBK_VERSION} ] ; then \ echo "Env variable PBK_VERSION is not set" ; \ @@ -14,21 +29,6 @@ check_env: false ; \ fi -ifeq ($(PBK_EDITION),std) - PBK_PKG_REPO = pg_probackup-forks - PBK_EDITION_FULL = Standart - PKG_NAME_SUFFIX = std- -else ifeq ($(PBK_EDITION),ent) - PBK_PKG_REPO = pg_probackup-forks - PBK_EDITION_FULL = Enterprise - PKG_NAME_SUFFIX = ent- -else - PBK_PKG_REPO = pg_probackup - PBK_EDITION_FULL = - PBK_EDITION = - PKG_NAME_SUFFIX = -endif - pkg: check_env build/prepare build/all @echo Build for all platform: done From c8bde0d95a2cc9565373ff9d61f863a66ce0ea92 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:51:27 +0300 Subject: [PATCH 28/54] [skip travis] minor fix --- packaging/Makefile.repo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index 5fa63fafd..1433bffe3 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -115,9 +115,12 @@ build/repo_suse_15.2: touch build/repo_suse_15.2 repo_finish: - cd build/data/www/$(PBK_PKG_REPO)/rpm - sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/rpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/rpm/latest - sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/srpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/srpm/latest +# cd build/data/www/$(PBK_PKG_REPO)/ + cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/rpm/ && ln -sf $(PBK_VERSION) latest + cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/srpm/ && ln -sf $(PBK_VERSION) latest + +# sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/rpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/rpm/latest +# sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/srpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/srpm/latest define build_repo_deb docker rm -f $1_$2_pbk_repo >> /dev/null 2>&1 ; \ From e58bc18e86be716f9ac80ac9d8da8cfbb3f09f48 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:52:34 +0300 Subject: [PATCH 29/54] [skip travis] minor fix --- packaging/Makefile.repo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index 1433bffe3..4f7f97f2c 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -116,8 +116,8 @@ build/repo_suse_15.2: repo_finish: # cd build/data/www/$(PBK_PKG_REPO)/ - cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/rpm/ && ln -sf $(PBK_VERSION) latest - cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/srpm/ && ln -sf $(PBK_VERSION) latest + cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/rpm && sudo ln -sf $(PBK_VERSION) latest + cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/srpm && sudo ln -sf $(PBK_VERSION) latest # sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/rpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/rpm/latest # sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/srpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/srpm/latest From be12d6c82ec7272ee9986dde3317b2cbd7775db6 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:54:48 +0300 Subject: [PATCH 30/54] [skip travis] minor fix --- packaging/Makefile.repo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index 4f7f97f2c..553f20da9 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -116,8 +116,8 @@ build/repo_suse_15.2: repo_finish: # cd build/data/www/$(PBK_PKG_REPO)/ - cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/rpm && sudo ln -sf $(PBK_VERSION) latest - cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/srpm && sudo ln -sf $(PBK_VERSION) latest + cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/rpm && sudo ln -s $(PBK_VERSION) latest + cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/srpm && sudo ln -s $(PBK_VERSION) latest # sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/rpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/rpm/latest # sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/srpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/srpm/latest From f223bf2317002f5bca8e129a8232b3a0de9cbf10 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 15:57:00 +0300 Subject: [PATCH 31/54] [skip travis] minor fix --- packaging/Makefile.repo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index 553f20da9..e53360bc2 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -116,8 +116,8 @@ build/repo_suse_15.2: repo_finish: # cd build/data/www/$(PBK_PKG_REPO)/ - cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/rpm && sudo ln -s $(PBK_VERSION) latest - cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/srpm && sudo ln -s $(PBK_VERSION) latest + cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/rpm && sudo ln -nsf $(PBK_VERSION) latest + cd $(BUILDDIR)/data/www/$(PBK_PKG_REPO)/srpm && sudo ln -nsf $(PBK_VERSION) latest # sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/rpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/rpm/latest # sudo ln -rfs build/data/www/$(PBK_PKG_REPO)/srpm/${PBK_VERSION} build/data/www/$(PBK_PKG_REPO)/srpm/latest From 104d7c32ae69b0e227c683be8cf06a8691eb8c1b Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 16:08:17 +0300 Subject: [PATCH 32/54] [skip travis] minor fix --- packaging/Makefile.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/Makefile.test b/packaging/Makefile.test index c47667857..7b52c39f6 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -31,7 +31,7 @@ define test_deb docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ -v $(WORKDIR)/packaging/test:/app/in \ - -v $(BUILDDIR)/data/www/$(PBK_PKG_REPO):/app/www \ + -v $(BUILDDIR)/data/www:/app/www \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ @@ -79,7 +79,7 @@ define test_rpm docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ -v $(WORKDIR)/packaging/test:/app/in \ - -v $(BUILDDIR)/data/www/$(PBK_PKG_REPO):/app/www \ + -v $(BUILDDIR)/data/www:/app/www \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ @@ -109,7 +109,7 @@ define test_alt docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ -v $(WORKDIR)/packaging/test:/app/in \ - -v $(BUILDDIR)/data/www/$(PBK_PKG_REPO):/app/www \ + -v $(BUILDDIR)/data/www:/app/www \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ @@ -133,7 +133,7 @@ define test_suse docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \ docker run \ -v $(WORKDIR)/packaging/test:/app/in \ - -v $(BUILDDIR)/data/www/$(PBK_PKG_REPO):/app/www \ + -v $(BUILDDIR)/data/www:/app/www \ -e "DISTRIB=$1" -e "DISTRIB_VERSION=$2" -e "CODENAME=$3" -e "PG_VERSION=$4" -e "PG_FULL_VERSION=$5" \ -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ From 24d4c1dc8d6caa21cd5798e291f89cee18707e2c Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 16:24:19 +0300 Subject: [PATCH 33/54] [skip travis] minor fix --- packaging/test/scripts/alt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/test/scripts/alt.sh b/packaging/test/scripts/alt.sh index 8d37f1851..37ca58ed6 100755 --- a/packaging/test/scripts/alt.sh +++ b/packaging/test/scripts/alt.sh @@ -31,7 +31,7 @@ http { } EOF -/etc/init.d/nginx start +nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) # install POSTGRESQL From 14a6d754e6b768b69a92a9de2067b2d3c719b779 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sat, 7 Aug 2021 16:27:38 +0300 Subject: [PATCH 34/54] [skip travis] minor fix --- packaging/test/scripts/alt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/test/scripts/alt.sh b/packaging/test/scripts/alt.sh index 37ca58ed6..79683d8fc 100755 --- a/packaging/test/scripts/alt.sh +++ b/packaging/test/scripts/alt.sh @@ -31,14 +31,14 @@ http { } EOF -nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) +/etc/init.d/nginx start # install POSTGRESQL export PGDATA=/var/lib/pgsql/${PG_VERSION}/data # install old packages -echo "rpm https://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p7 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list +echo "rpm http://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p7 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list apt-get update apt-get install ${PKG_NAME} ${PKG_NAME}-debuginfo -y ${PKG_NAME} --help From 4f970586c28a472316d8a23b6779eb6a7ab22556 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 01:05:58 +0300 Subject: [PATCH 35/54] [skip travis] fix alt --- packaging/test/scripts/alt.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packaging/test/scripts/alt.sh b/packaging/test/scripts/alt.sh index 79683d8fc..2d44dd865 100755 --- a/packaging/test/scripts/alt.sh +++ b/packaging/test/scripts/alt.sh @@ -1,10 +1,5 @@ #!/usr/bin/env bash -# Copyright Notice: -# © (C) Postgres Professional 2015-2016 http://www.postgrespro.ru/ -# Distributed under Apache License 2.0 -# Распространяется по лицензии Apache 2.0 - set -xe set -o pipefail @@ -13,6 +8,7 @@ ulimit -n 1024 apt-get clean -y apt-get update -y apt-get install nginx su -y +apt-get install apt-transport-https ca-certificates -y adduser nginx @@ -40,7 +36,7 @@ export PGDATA=/var/lib/pgsql/${PG_VERSION}/data # install old packages echo "rpm http://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p7 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list apt-get update -apt-get install ${PKG_NAME} ${PKG_NAME}-debuginfo -y +apt-get install ${PKG_NAME} -y ${PKG_NAME} --help ${PKG_NAME} --version @@ -50,7 +46,7 @@ echo "rpm http://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p${DISTRIB echo "rpm [p${DISTRIB_VERSION}] http://mirror.yandex.ru/altlinux p${DISTRIB_VERSION}/branch/x86_64 debuginfo" > /etc/apt/sources.list.d/debug.list apt-get update -y -apt-get install ${PKG_NAME} ${PKG_NAME}-debuginfo -y +apt-get install ${PKG_NAME} -y ${PKG_NAME} --help ${PKG_NAME} --version From 64fd5a8051b3af1767376a88a2ec1a269be26b80 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 01:07:16 +0300 Subject: [PATCH 36/54] [skip travis] fix alt --- packaging/test/scripts/alt.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/packaging/test/scripts/alt.sh b/packaging/test/scripts/alt.sh index 2d44dd865..262864474 100755 --- a/packaging/test/scripts/alt.sh +++ b/packaging/test/scripts/alt.sh @@ -8,7 +8,6 @@ ulimit -n 1024 apt-get clean -y apt-get update -y apt-get install nginx su -y -apt-get install apt-transport-https ca-certificates -y adduser nginx From 03ebf3baacbe354430ecce93a335e86998f1056b Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 01:13:07 +0300 Subject: [PATCH 37/54] [skip travis] fix alt --- packaging/test/Makefile.alt | 42 ------------------------------------- 1 file changed, 42 deletions(-) diff --git a/packaging/test/Makefile.alt b/packaging/test/Makefile.alt index 685030430..3c1899cb9 100644 --- a/packaging/test/Makefile.alt +++ b/packaging/test/Makefile.alt @@ -1,45 +1,3 @@ -# ALT 7 -build/test_alt_7_9.6: - $(call test_alt,alt,7,,9.6,9.6.21) - touch build/test_alt_7_9.6 - -build/test_alt_7_10: - $(call test_alt,alt,7,,10,10.17) - touch build/test_alt_7_10 - -build/test_alt_7_11: - $(call test_alt,alt,7,,11,11.11) - touch build/test_alt_7_11 - -build/test_alt_7_12: - $(call test_alt,alt,7,,12,12.6) - touch build/test_alt_7_12 - -build/test_alt_7_13: - $(call test_alt,alt,7,,13,13.2) - touch build/test_alt_7_13 - -# ALT 8 -build/test_alt_8_9.6: - $(call test_alt,alt,8,,9.6,9.6.21) - touch build/test_alt_8_9.6 - -build/test_alt_8_10: - $(call test_alt,alt,8,,10,10.17) - touch build/test_alt_8_10 - -build/test_alt_8_11: - $(call test_alt,alt,8,,11,11.11) - touch build/test_alt_8_11 - -build/test_alt_8_12: - $(call test_alt,alt,8,,12,12.6) - touch build/test_alt_8_12 - -build/test_alt_8_13: - $(call test_alt,alt,8,,13,13.2) - touch build/test_alt_8_13 - # ALT 9 build/test_alt_9_9.6: $(call test_alt,alt,9,,9.6,9.6.21) From 55f1f8a68edd1cc1bdd79f084f7bb46212423519 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 01:14:08 +0300 Subject: [PATCH 38/54] [skip travis] fix alt --- packaging/Makefile.test | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packaging/Makefile.test b/packaging/Makefile.test index 7b52c39f6..b9569962c 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -91,17 +91,10 @@ include packaging/test/Makefile.centos include packaging/test/Makefile.rhel include packaging/test/Makefile.oraclelinux - # Alt Linux -build/test_alt: build/test_alt_7 build/test_alt_8 build/test_alt_9 +build/test_alt: build/test_alt_9 @echo Alt Linux: done -build/test_alt_7: build/test_alt_7_9.6 build/test_alt_7_10 build/test_alt_7_11 build/test_alt_7_12 build/test_alt_7_13 - @echo Alt Linux 7: done - -build/test_alt_8: build/test_alt_8_9.6 build/test_alt_8_10 build/test_alt_8_11 build/test_alt_8_12 build/test_alt_8_13 - @echo Alt Linux 8: done - build/test_alt_9: build/test_alt_9_9.6 build/test_alt_9_10 build/test_alt_9_11 build/test_alt_9_12 build/test_alt_9_13 @echo Alt Linux 9: done From 97e2c3b807d2304e3b354881920ee579856d2164 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 12:11:21 +0300 Subject: [PATCH 39/54] [skip travis] disable rhel packaging --- packaging/Makefile.pkg | 6 +++--- packaging/Makefile.repo | 2 +- packaging/Makefile.test | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index eb9040810..dde95a6f3 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -36,9 +36,9 @@ build/prepare: mkdir -p build build/clean: build/prepare - find build/ -maxdepth 1 -type f -exec rm -f {} \; + find $(BUILDDIR) -maxdepth 1 -type f -exec rm -f {} \; -build/all: build/debian build/ubuntu build/centos build/oraclelinux build/rhel build/alt build/suse +build/all: build/debian build/ubuntu build/centos build/oraclelinux build/alt build/suse # build/rhel @echo Packaging is done ### DEBIAN @@ -59,7 +59,7 @@ build/ubuntu: build/ubuntu_14.04 build/ubuntu_16.04 build/ubuntu_18.04 build/ubu @echo Ubuntu: done build/ubuntu_14.04: build/ubuntu_14.04_9.5 build/ubuntu_14.04_9.6 build/ubuntu_14.04_10 build/ubuntu_14.04_11 build/ubuntu_14.04_12 build/ubuntu_14.04_13 - @echo Ubuntu 14.04: + @echo Ubuntu 14.04: done build/ubuntu_16.04: build/ubuntu_16.04_9.5 build/ubuntu_16.04_9.6 build/ubuntu_16.04_10 build/ubuntu_16.04_11 build/ubuntu_16.04_12 build/ubuntu_16.04_13 @echo Ubuntu 16.04: done diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index e53360bc2..e5403a9f2 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -1,5 +1,5 @@ #### REPO BUILD #### -repo: check_env repo/debian repo/ubuntu repo/centos repo/rhel repo/oraclelinux repo/alt repo/suse repo_finish +repo: check_env repo/debian repo/ubuntu repo/centos repo/oraclelinux repo/alt repo/suse repo_finish #repo/rhel @echo Build repo for all platform: done # Debian diff --git a/packaging/Makefile.test b/packaging/Makefile.test index b9569962c..47a0b07b8 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -1,7 +1,7 @@ test: build/test_all @echo Test for all platform: done -build/test_all: build/test_debian build/test_ubuntu build/test_centos build/test_oraclelinux build/test_alt build/test_suse build/test_rhel +build/test_all: build/test_debian build/test_ubuntu build/test_centos build/test_oraclelinux build/test_alt build/test_suse # build/test_rhel @echo Package testing is done ### DEBIAN From eca6c71f86a1ceef7ff7cdb10ccf76080cd10f1c Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 12:33:45 +0300 Subject: [PATCH 40/54] [skip travis] build repo packages for std|ent --- packaging/pkg/scripts/rpm.sh | 7 +++++-- packaging/pkg/scripts/suse.sh | 5 +++++ packaging/repo/scripts/suse.sh | 5 +++++ packaging/test/scripts/suse.sh | 29 +++++------------------------ 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/packaging/pkg/scripts/rpm.sh b/packaging/pkg/scripts/rpm.sh index 9ed90a6a1..f3f003d2d 100755 --- a/packaging/pkg/scripts/rpm.sh +++ b/packaging/pkg/scripts/rpm.sh @@ -116,7 +116,7 @@ if [[ ${PBK_EDITION} == '' ]] ; then # build pg_probackup rpmbuild -bs pg_probackup.spec - rpmbuild -ba pg_probackup.spec #2>&1 | tee -ai /app/out/build.log + rpmbuild -ba pg_probackup.spec # build repo files rpmbuild -bs pg_probackup-repo.spec @@ -129,7 +129,10 @@ else # install dependencies yum-builddep -y pg_probackup-pgpro.spec # build pg_probackup - rpmbuild -ba pg_probackup-pgpro.spec #2>&1 | tee -ai /app/out/build.log + rpmbuild -ba pg_probackup-pgpro.spec + + # build repo files + rpmbuild -ba pg_probackup-repo-forks.spec # write artefacts to out directory rm -rf /app/out/* diff --git a/packaging/pkg/scripts/suse.sh b/packaging/pkg/scripts/suse.sh index 5b9717e72..76b444b5b 100755 --- a/packaging/pkg/scripts/suse.sh +++ b/packaging/pkg/scripts/suse.sh @@ -15,6 +15,11 @@ set -xe set -o pipefail +# currenctly we do not build std|ent packages for Suse +if [[ ${PBK_EDITION} != '' ]] ; then + exit 0 +fi + # fix https://github.com/moby/moby/issues/23137 ulimit -n 1024 zypper clean diff --git a/packaging/repo/scripts/suse.sh b/packaging/repo/scripts/suse.sh index dcd9e8811..7253df700 100755 --- a/packaging/repo/scripts/suse.sh +++ b/packaging/repo/scripts/suse.sh @@ -12,6 +12,11 @@ set -o pipefail # fix https://github.com/moby/moby/issues/23137 ulimit -n 1024 +# currenctly we do not build std|ent packages for Suse +if [[ ${PBK_EDITION} != '' ]] ; then + exit 0 +fi + export INPUT_DIR=/app/in #dir with builded rpm export OUT_DIR=/app/www/${PBK_PKG_REPO} export KEYS_DIR=$OUT_DIR/keys diff --git a/packaging/test/scripts/suse.sh b/packaging/test/scripts/suse.sh index a0a0aa399..ff630b479 100755 --- a/packaging/test/scripts/suse.sh +++ b/packaging/test/scripts/suse.sh @@ -11,31 +11,12 @@ set -o pipefail # fix https://github.com/moby/moby/issues/23137 ulimit -n 1024 -PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') +# currenctly we do not build std|ent packages for Suse +if [[ ${PBK_EDITION} != '' ]] ; then + exit 0 +fi -# if [ ${PG_TOG} == '11' ] -# then -# exit 0 -# fi -# -# if [ ${PG_TOG} == '13' ] -# then -# exit 0 -# fi -# -# if [ ${PG_TOG} == '95' ] -# then -# exit 0 -# fi - -# yum upgrade -y || echo 'some packages in docker failed to upgrade' -# yum install -y sudo - -#if [ ${DISTRIB} == 'centos' ] && [ ${DISTRIB_VERSION} == '8' ]; then -# yum install epel-release -y -#else -# rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-${DISTRIB_VERSION}.noarch.rpm -#fi +PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') if [ ${PG_TOG} == '13' ]; then # no packages for PG13 exit 0 From 6f4bc2bd2c88eb4eda84940aa5662b8174714ba0 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 13:18:06 +0300 Subject: [PATCH 41/54] [skip travis] build repo packages for std|ent --- packaging/pkg/scripts/alt.sh | 4 ++-- packaging/pkg/scripts/rpm.sh | 18 +++++++++++++----- .../rpm/rpmbuild/SPECS/pg_probackup-repo.spec | 1 - 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packaging/pkg/scripts/alt.sh b/packaging/pkg/scripts/alt.sh index 5190e5083..ae3c713fa 100755 --- a/packaging/pkg/scripts/alt.sh +++ b/packaging/pkg/scripts/alt.sh @@ -62,8 +62,8 @@ else fi -cd /root/rpmbuild/SOURCES -sed -i "s/@PG_VERSION@/${PKG_VERSION}/" pg_probackup.repo +#cd /root/rpmbuild/SOURCES +#sed -i "s/@PG_VERSION@/${PKG_VERSION}/" pg_probackup.repo # build postgresql echo '%_allow_root_build yes' > /root/.rpmmacros diff --git a/packaging/pkg/scripts/rpm.sh b/packaging/pkg/scripts/rpm.sh index f3f003d2d..fc95bf7dd 100755 --- a/packaging/pkg/scripts/rpm.sh +++ b/packaging/pkg/scripts/rpm.sh @@ -49,14 +49,11 @@ else fi if [[ ${PBK_EDITION} == '' ]] ; then - cd /root/rpmbuild/SOURCES/ - sed -i "s/@PG_VERSION@/${PKG_VERSION}/" pg_probackup.repo # Download PostgreSQL source wget -q http://ftp.postgresql.org/pub/source/v${PG_FULL_VERSION}/postgresql-${PG_FULL_VERSION}.tar.bz2 -O /root/rpmbuild/SOURCES/postgresql-${PG_VERSION}.tar.bz2 - # change to build dir - cd /root/rpmbuild/SOURCES + cd /root/rpmbuild/SOURCES/ sed -i "s/@DISTRIB@/${DISTRIB}/" pg_probackup.repo if [ $DISTRIB == 'centos' ] then sed -i "s/@SHORT_CODENAME@/Centos/" pg_probackup.repo @@ -78,6 +75,15 @@ else rm -rf .git cd /root/rpmbuild/SOURCES/ + sed -i "s/@DISTRIB@/${DISTRIB}/" pg_probackup-forks.repo + if [ $DISTRIB == 'centos' ] + then sed -i "s/@SHORT_CODENAME@/Centos/" pg_probackup-forks.repo + elif [ $DISTRIB == 'rhel' ] + then sed -i "s/@SHORT_CODENAME@/RedHat/" pg_probackup-forks.repo + elif [ $DISTRIB == 'oraclelinux' ] + then sed -i "s/@SHORT_CODENAME@/Oracle/" pg_probackup-forks.repo + fi + mv pgpro postgrespro-${PBK_EDITION}-${PG_FULL_VERSION} chown -R root:root postgrespro-${PBK_EDITION}-${PG_FULL_VERSION} @@ -92,7 +98,6 @@ if [[ ${PBK_EDITION} == '' ]] ; then sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup.spec sed -i "s/@PG_FULL_VERSION@/${PG_FULL_VERSION}/" pg_probackup.spec - sed -i "s/@PG_VERSION@/${PG_VERSION}/" pg_probackup-repo.spec sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup-repo.spec sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup-repo.spec else @@ -107,6 +112,9 @@ else if [ ${PG_VERSION} != '9.6' ]; then sed -i "s|@PREFIX@|/opt/pgpro/${EDITION}-${PG_VERSION}|g" pg_probackup-pgpro.spec fi + + sed -i "s/@PKG_VERSION@/${PKG_VERSION}/" pg_probackup-repo-forks.spec + sed -i "s/@PKG_RELEASE@/${PKG_RELEASE}/" pg_probackup-repo-forks.spec fi if [[ ${PBK_EDITION} == '' ]] ; then diff --git a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec index 6721003d0..da54bc7b1 100644 --- a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec +++ b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-repo.spec @@ -1,4 +1,3 @@ -%global pgsql_major @PG_VERSION@ %global version @PKG_VERSION@ %global release @PKG_RELEASE@ From 08b18e3201f95e96832eaa3dc2ccd9d558d88956 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 13:32:40 +0300 Subject: [PATCH 42/54] [skip travis] build repo packages for std|ent --- packaging/repo/scripts/alt.sh | 22 ++++++++----- packaging/repo/scripts/rpm.sh | 58 +++++------------------------------ 2 files changed, 22 insertions(+), 58 deletions(-) diff --git a/packaging/repo/scripts/alt.sh b/packaging/repo/scripts/alt.sh index 283c347f2..9c3f34784 100755 --- a/packaging/repo/scripts/alt.sh +++ b/packaging/repo/scripts/alt.sh @@ -18,17 +18,23 @@ export OUT_DIR=/app/www/${PBK_PKG_REPO} apt-get update -y apt-get install -qq -y apt-repo-tools gnupg rsync perl less wget +if [[ ${PBK_EDITION} == '' ]] ; then + REPO_SUFFIX='vanilla' + FORK='PostgreSQL' +else + REPO_SUFFIX='forks' + FORK='PostgresPro' +fi + cd $INPUT_DIR cp -arv /app/repo/$PBK_PKG_REPO/gnupg /root/.gnupg chmod -R 0600 /root/.gnupg for pkg in $(ls); do for pkg_full_version in $(ls ./$pkg); do - RPM_DIR=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/RPMS.vanilla - SRPM_DIR=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/SRPMS.vanilla + RPM_DIR=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/RPMS.${REPO_SUFFIX} + SRPM_DIR=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/SRPMS.${REPO_SUFFIX} - # rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" - # rm -rf "$SRPM_DIR" && mkdir -p "$SRPM_DIR" mkdir -p "$RPM_DIR" mkdir -p "$SRPM_DIR" @@ -36,14 +42,14 @@ for pkg in $(ls); do cp -arv $INPUT_DIR/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ - --label='PostgreSQL backup utility pg_probackup' --description 'PostgreSQL pg_probackup repo' \ + --label="${FORK} backup utility pg_probackup" --description "${FORK} pg_probackup repo" \ --version=$pkg_full_version --bloat --progress --create \ - --topdir=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla + --topdir=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 ${REPO_SUFFIX} genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ - --label='PostgreSQL backup utility pg_probackup sources' --description 'PostgreSQL pg_probackup repo' \ + --label="${FORK} backup utility pg_probackup sources" --description "${FORK} pg_probackup repo" \ --version=$pkg_full_version --bloat --progress --create \ - --topdir=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla + --topdir=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 ${REPO_SUFFIX} # genbasedir --bloat --progress --create \ # --topdir=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla diff --git a/packaging/repo/scripts/rpm.sh b/packaging/repo/scripts/rpm.sh index cf6ae9a59..b1ee9b15d 100755 --- a/packaging/repo/scripts/rpm.sh +++ b/packaging/repo/scripts/rpm.sh @@ -33,8 +33,14 @@ chown -R root:root /root/.gnupg for pkg in $(ls ${INPUT_DIR}); do for pkg_full_version in $(ls ${INPUT_DIR}/$pkg); do - cp $INPUT_DIR/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ - $KEYS_DIR/pg_probackup-repo-$DISTRIB.noarch.rpm + if [[ ${PBK_EDITION} == '' ]] ; then + cp $INPUT_DIR/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ + $KEYS_DIR/pg_probackup-repo-$DISTRIB.noarch.rpm + else + cp $INPUT_DIR/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ + $KEYS_DIR/pg_probackup-repo-forks-$DISTRIB.noarch.rpm + fi + [ ! -z "$CODENAME" ] && export DISTRIB_VERSION=$CODENAME RPM_DIR=$OUT_DIR/rpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 SRPM_DIR=$OUT_DIR/srpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 @@ -53,51 +59,3 @@ for pkg in $(ls ${INPUT_DIR}); do createrepo $SRPM_DIR/ done done - -# if [ $repo_name == 'pg_probackup-forks' ] -# then -# #/app/www/pg_probackup_repo/ -# export KEYS_DIR=$OUT_DIR/$repo_name/keys -# mkdir -p "$KEYS_DIR" -# rsync /app/src/$repo_name/gnupg/key.public $KEYS_DIR/GPG-KEY-PG_PROBACKUP -# chmod 755 $KEYS_DIR -# chmod +x /app/src/$repo_name/autosign.sh -# echo -e 'User-agent: *\nDisallow: /' > $OUT_DIR/$repo_name/robots.txt -# -# cp -arv /app/src/$repo_name/rpmmacros /root/.rpmmacros -# cp -arv /app/src/$repo_name/gnupg /root/.gnupg -# chmod -R 0600 /root/.gnupg -# -# cd $INPUT_DIR/$repo_name -# for pkg in $(ls); do -# for pkg_full_version in $(ls ./$pkg); do -# -# if [ $pkg == 'pg_probackup-repo-forks' ]; then -# cp $INPUT_DIR/$repo_name/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ -# $KEYS_DIR/pg_probackup-repo-forks-$DISTRIB.noarch.rpm -# continue -# fi -# -# [ ! -z "$CODENAME" ] && export DISTRIB_VERSION=$CODENAME -# RPM_DIR=$OUT_DIR/$repo_name/rpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 -## SRPM_DIR=$OUT_DIR/$repo_name/srpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 -# -## rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" -## rm -rf "$SRPM_DIR" && mkdir -p "$SRPM_DIR" -# mkdir -p "$RPM_DIR" -## mkdir -p "$SRPM_DIR" -# -# cp -arv $INPUT_DIR/$repo_name/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ -## cp -arv $INPUT_DIR/$repo_name/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ -# -# for f in $(ls $RPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done -## for f in $(ls $SRPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done -# createrepo $RPM_DIR/ -## createrepo $SRPM_DIR/ -# done -# done -# -# # repo cleanup -# rm -rf /root/.rpmmacros -# rm -rf /root/.gnupg -# fi From 4ff6290c9b0dc6ffdea24c93a3223ea2bb2cef18 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 13:36:14 +0300 Subject: [PATCH 43/54] [skip travis] build repo packages for std|ent --- packaging/repo/scripts/rpm.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/packaging/repo/scripts/rpm.sh b/packaging/repo/scripts/rpm.sh index b1ee9b15d..627a47ba9 100755 --- a/packaging/repo/scripts/rpm.sh +++ b/packaging/repo/scripts/rpm.sh @@ -43,19 +43,18 @@ for pkg in $(ls ${INPUT_DIR}); do [ ! -z "$CODENAME" ] && export DISTRIB_VERSION=$CODENAME RPM_DIR=$OUT_DIR/rpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 - SRPM_DIR=$OUT_DIR/srpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 - - # rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" - # rm -rf "$SRPM_DIR" && mkdir -p "$SRPM_DIR" mkdir -p "$RPM_DIR" - mkdir -p "$SRPM_DIR" - cp -arv $INPUT_DIR/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ - cp -arv $INPUT_DIR/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ - for f in $(ls $RPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done - for f in $(ls $SRPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done createrepo $RPM_DIR/ - createrepo $SRPM_DIR/ + + if [[ ${PBK_EDITION} == '' ]] ; then + SRPM_DIR=$OUT_DIR/srpm/$pkg_full_version/${DISTRIB}-${DISTRIB_VERSION}-x86_64 + mkdir -p "$SRPM_DIR" + cp -arv $INPUT_DIR/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ + for f in $(ls $SRPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done + createrepo $SRPM_DIR/ + fi + done done From 0533defe15e57a01f965a1e0d36aff65e74b6275 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 13:40:44 +0300 Subject: [PATCH 44/54] [skip travis] build repo packages for std|ent --- packaging/repo/scripts/rpm.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packaging/repo/scripts/rpm.sh b/packaging/repo/scripts/rpm.sh index 627a47ba9..d4e621c3e 100755 --- a/packaging/repo/scripts/rpm.sh +++ b/packaging/repo/scripts/rpm.sh @@ -33,6 +33,11 @@ chown -R root:root /root/.gnupg for pkg in $(ls ${INPUT_DIR}); do for pkg_full_version in $(ls ${INPUT_DIR}/$pkg); do + # THere is no std/ent packages for PG 9.5 + if [[ ${pkg} == 'pg_probackup-std-9.5' ]] || [[ ${pkg} == 'pg_probackup-ent-9.5' ]] ; then + continue; + fi + if [[ ${PBK_EDITION} == '' ]] ; then cp $INPUT_DIR/$pkg/$pkg_full_version/RPMS/noarch/pg_probackup-repo-*.noarch.rpm \ $KEYS_DIR/pg_probackup-repo-$DISTRIB.noarch.rpm From 62863f7bda6f92cbfa294b9a3fadf9c9be97fb55 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 13:46:54 +0300 Subject: [PATCH 45/54] [skip travis] build repo packages for std|ent --- packaging/repo/scripts/alt.sh | 58 ++++++++++------------------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/packaging/repo/scripts/alt.sh b/packaging/repo/scripts/alt.sh index 9c3f34784..4cda313ef 100755 --- a/packaging/repo/scripts/alt.sh +++ b/packaging/repo/scripts/alt.sh @@ -32,55 +32,31 @@ cp -arv /app/repo/$PBK_PKG_REPO/gnupg /root/.gnupg chmod -R 0600 /root/.gnupg for pkg in $(ls); do for pkg_full_version in $(ls ./$pkg); do - RPM_DIR=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/RPMS.${REPO_SUFFIX} - SRPM_DIR=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/SRPMS.${REPO_SUFFIX} - mkdir -p "$RPM_DIR" - mkdir -p "$SRPM_DIR" + # THere is no std/ent packages for PG 9.5 + if [[ ${pkg} == 'pg_probackup-std-9.5' ]] || [[ ${pkg} == 'pg_probackup-ent-9.5' ]] ; then + continue; + fi + RPM_DIR=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/RPMS.${REPO_SUFFIX} + mkdir -p "$RPM_DIR" cp -arv $INPUT_DIR/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ - cp -arv $INPUT_DIR/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ --label="${FORK} backup utility pg_probackup" --description "${FORK} pg_probackup repo" \ --version=$pkg_full_version --bloat --progress --create \ --topdir=${OUT_DIR}/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 ${REPO_SUFFIX} - genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ - --label="${FORK} backup utility pg_probackup sources" --description "${FORK} pg_probackup repo" \ - --version=$pkg_full_version --bloat --progress --create \ - --topdir=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 ${REPO_SUFFIX} - - # genbasedir --bloat --progress --create \ - # --topdir=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla - - # genbasedir --bloat --progress --create \ - # --topdir=${OUT_DIR}/$repo_name/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 vanilla + # SRPM is available only for vanilla + if [[ ${PBK_EDITION} == '' ]] ; then + SRPM_DIR=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/SRPMS.${REPO_SUFFIX} + mkdir -p "$SRPM_DIR" + cp -arv $INPUT_DIR/$pkg/$pkg_full_version/SRPMS/* $SRPM_DIR/ + + genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ + --label="${FORK} backup utility pg_probackup sources" --description "${FORK} pg_probackup repo" \ + --version=$pkg_full_version --bloat --progress --create \ + --topdir=${OUT_DIR}/srpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 ${REPO_SUFFIX} + fi done done - -# if [[ $repo_name == 'pg_probackup-forks' ]] -# then -# cd $INPUT_DIR/$repo_name -# cp -arv /app/src/$repo_name/gnupg /root/.gnupg -# chmod -R 0600 /root/.gnupg -# for pkg in $(ls); do -# for pkg_full_version in $(ls ./$pkg); do -# RPM_DIR=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION}/x86_64/RPMS.forks -# -# # rm -rf "$RPM_DIR" && mkdir -p "$RPM_DIR" -# mkdir -p "$RPM_DIR" -# -# cp -arv $INPUT_DIR/$repo_name/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/ -# -# genbasedir --architecture=x86_64 --architectures=x86_64 --origin=repo.postgrespro.ru \ -# --label='PostgrePro backup utility pg_probackup' --description 'PostgresPro pg_probackup repo' \ -# --version=$pkg_full_version --bloat --progress --create \ -# --topdir=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 forks -# -## genbasedir --bloat --progress --create \ -## --topdir=${OUT_DIR}/$repo_name/rpm/${pkg_full_version}/altlinux-p${DISTRIB_VERSION} x86_64 forks -# done -# done -# rm -rf /root/.gnupg -# fi From a4276943782d20a3249a535a4884a18b622857db Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 13:56:47 +0300 Subject: [PATCH 46/54] [skip travis] test packages for std|ent --- packaging/Makefile.test | 16 ++++++++++++---- .../{pg_probackup_alt_forks.sh => alt_forks.sh} | 0 .../{pg_probackup_forks_deb.sh => deb_forks.sh} | 0 packaging/test/scripts/suse_forks.sh | 5 +++++ 4 files changed, 17 insertions(+), 4 deletions(-) rename packaging/test/scripts/{pg_probackup_alt_forks.sh => alt_forks.sh} (100%) rename packaging/test/scripts/{pg_probackup_forks_deb.sh => deb_forks.sh} (100%) create mode 100644 packaging/test/scripts/suse_forks.sh diff --git a/packaging/Makefile.test b/packaging/Makefile.test index 47a0b07b8..d5b504ccf 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -1,3 +1,11 @@ +ifeq ($(PBK_EDITION),std) + SCRIPT_SUFFIX = _forks +else ifeq ($(PBK_EDITION),ent) + SCRIPT_SUFFIX = _forks +else + SCRIPT_SUFFIX = +endif + test: build/test_all @echo Test for all platform: done @@ -36,7 +44,7 @@ define test_deb -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg-probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ - --rm pgpro/$1:$2 /app/in/scripts/deb.sh + --rm pgpro/$1:$2 /app/in/scripts/deb$(SCRIPT_SUFFIX).sh endef include packaging/test/Makefile.debian @@ -84,7 +92,7 @@ define test_rpm -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ - --rm pgpro/$1:$2 /app/in/scripts/rpm.sh + --rm pgpro/$1:$2 /app/in/scripts/rpm$(SCRIPT_SUFFIX).sh endef include packaging/test/Makefile.centos @@ -107,7 +115,7 @@ define test_alt -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ - --rm pgpro/$1:$2 /app/in/scripts/alt.sh + --rm pgpro/$1:$2 /app/in/scripts/alt$(SCRIPT_SUFFIX).sh endef include packaging/test/Makefile.alt @@ -131,7 +139,7 @@ define test_suse -e "PKG_HASH=$(PBK_HASH)" -e "PKG_URL=$(PBK_GIT_REPO)" -e "PKG_RELEASE=$(PBK_RELEASE)" -e "PKG_NAME=pg_probackup-$(PKG_NAME_SUFFIX)$4" \ -e "PKG_VERSION=$(PBK_VERSION)" -e "PBK_EDITION=$(PBK_EDITION)" -e "PBK_EDITION_FULL=$(PBK_EDITION_FULL)" \ --name $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION)_pg_$5 \ - --rm pgpro/$1:$2 /app/in/scripts/suse.sh + --rm pgpro/$1:$2 /app/in/scripts/suse$(SCRIPT_SUFFIX).sh endef include packaging/test/Makefile.suse diff --git a/packaging/test/scripts/pg_probackup_alt_forks.sh b/packaging/test/scripts/alt_forks.sh similarity index 100% rename from packaging/test/scripts/pg_probackup_alt_forks.sh rename to packaging/test/scripts/alt_forks.sh diff --git a/packaging/test/scripts/pg_probackup_forks_deb.sh b/packaging/test/scripts/deb_forks.sh similarity index 100% rename from packaging/test/scripts/pg_probackup_forks_deb.sh rename to packaging/test/scripts/deb_forks.sh diff --git a/packaging/test/scripts/suse_forks.sh b/packaging/test/scripts/suse_forks.sh new file mode 100644 index 000000000..b83f1ddd9 --- /dev/null +++ b/packaging/test/scripts/suse_forks.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -xe +set -o pipefail +exit 0 From 2fa47cf115bbcadb4f6916df11a82d631e7d5c1b Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 14:00:38 +0300 Subject: [PATCH 47/54] [skip travis] test packages for std|ent --- packaging/test/scripts/alt_forks.sh | 2 +- packaging/test/scripts/deb_forks.sh | 50 +++++++++---------- ...pg_probackup_forks_rpm.sh => rpm_forks.sh} | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) rename packaging/test/scripts/{pg_probackup_forks_rpm.sh => rpm_forks.sh} (99%) diff --git a/packaging/test/scripts/alt_forks.sh b/packaging/test/scripts/alt_forks.sh index 49717f2df..63068a5a6 100755 --- a/packaging/test/scripts/alt_forks.sh +++ b/packaging/test/scripts/alt_forks.sh @@ -10,7 +10,7 @@ set -o pipefail ulimit -n 1024 -if [ ${EDITION} == 'ent' ]; then +if [ ${PBK_EDITION} == 'ent' ]; then exit 0 fi diff --git a/packaging/test/scripts/deb_forks.sh b/packaging/test/scripts/deb_forks.sh index 17991965d..d59b1dda0 100755 --- a/packaging/test/scripts/deb_forks.sh +++ b/packaging/test/scripts/deb_forks.sh @@ -11,7 +11,7 @@ set -o pipefail # fix https://github.com/moby/moby/issues/23137 ulimit -n 1024 -if [ ${EDITION} == 'ent' ]; then +if [ ${PBK_EDITION} == 'ent' ]; then exit 0 fi @@ -57,7 +57,7 @@ if [ ${PG_VERSION} == '9.6' ]; then fi # install POSTGRESPRO -if [ ${EDITION} == 'std' ]; then +if [ ${PBK_EDITION} == 'std' ]; then sh -c 'echo "deb https://repo.postgrespro.ru/pgpro-${PG_VERSION}/${DISTRIB}/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/pgpro.list' wget --quiet -O - https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/GPG-KEY-POSTGRESPRO | apt-key add - apt-get update -y @@ -78,31 +78,31 @@ echo "deb [arch=amd64] http://repo.postgrespro.ru/pg_probackup-forks/deb/ $(lsb_ /etc/apt/sources.list.d/pg_probackup-old.list wget -O - http://repo.postgrespro.ru/pg_probackup-forks/keys/GPG-KEY-PG_PROBACKUP | apt-key add - && apt-get update -apt-get install -y pg-probackup-${EDITION}-${PG_VERSION} -pg_probackup-${EDITION}-${PG_VERSION} --help -pg_probackup-${EDITION}-${PG_VERSION} --version +apt-get install -y pg-probackup-${PBK_EDITION}-${PG_VERSION} +pg_probackup-${PBK_EDITION}-${PG_VERSION} --help +pg_probackup-${PBK_EDITION}-${PG_VERSION} --version -if [ ${EDITION} == 'std' ]; then +if [ ${PBK_EDITION} == 'std' ]; then export PGDATA=/tmp/data su postgres -c "${BINDIR}/initdb -k -D ${PGDATA}" - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} init -B /tmp/backup" - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} init -B /tmp/backup" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} add-instance --instance=node -B /tmp/backup -D ${PGDATA}" echo "wal_level=hot_standby" >> ${PGDATA}/postgresql.auto.conf echo "fsync=off" >> ${PGDATA}/postgresql.auto.conf echo "archive_mode=on" >> ${PGDATA}/postgresql.auto.conf - echo "archive_command='pg_probackup-${EDITION}-${PG_VERSION} archive-push --no-sync -B /tmp/backup compress --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf + echo "archive_command='pg_probackup-${PBK_EDITION}-${PG_VERSION} archive-push --no-sync -B /tmp/backup compress --instance=node --wal-file-path %p --wal-file-name %f'" >> ${PGDATA}/postgresql.auto.conf su postgres -c "${BINDIR}/pg_ctl stop -w -t 60 -D /var/lib/pgpro/std-${PG_VERSION}/data" || echo "it is all good" su postgres -c "${BINDIR}/pg_ctl start -D ${PGDATA}" sleep 5 - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} backup --instance=node -b full -B /tmp/backup -D ${PGDATA} --no-sync" - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA} --archive" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} backup --instance=node -b full -B /tmp/backup -D ${PGDATA} --no-sync" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA} --archive" su postgres -c "${BINDIR}/pgbench --no-vacuum -i -s 5" - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA} --no-sync" fi # install new packages @@ -111,42 +111,42 @@ echo "deb [arch=amd64] http://test.postgrespro.ru/pg_probackup-forks/deb/ $(lsb_ wget -O - http://test.postgrespro.ru/pg_probackup-forks/keys/GPG-KEY-PG_PROBACKUP | apt-key add - apt-get update -y -#if [ ${EDITION} == 'std' ] && [ ${PG_VERSION} == '9.6' ]; then -# apt-get install -y libpq5 pg-probackup-${EDITION}-${PG_VERSION} +#if [ ${PBK_EDITION} == 'std' ] && [ ${PG_VERSION} == '9.6' ]; then +# apt-get install -y libpq5 pg-probackup-${PBK_EDITION}-${PG_VERSION} #else -# apt-get install -y pg-probackup-${EDITION}-${PG_VERSION} +# apt-get install -y pg-probackup-${PBK_EDITION}-${PG_VERSION} #fi -apt-get install -y pg-probackup-${EDITION}-${PG_VERSION} +apt-get install -y pg-probackup-${PBK_EDITION}-${PG_VERSION} # in Ent 11 and 10 because of PQselect vanilla libpq5 is incompatible with Ent pg_probackup -if [ ${EDITION} == 'ent' ]; then +if [ ${PBK_EDITION} == 'ent' ]; then if [ ${PG_VERSION} == '11' ] || [ ${PG_VERSION} == '10' ] || [ ${PG_VERSION} == '9.6' ]; then exit 0 fi fi -pg_probackup-${EDITION}-${PG_VERSION} --help -pg_probackup-${EDITION}-${PG_VERSION} --version +pg_probackup-${PBK_EDITION}-${PG_VERSION} --help +pg_probackup-${PBK_EDITION}-${PG_VERSION} --version -if [ ${EDITION} == 'ent' ]; then +if [ ${PBK_EDITION} == 'ent' ]; then exit 0 fi -if [ ${EDITION} == 'std' ] && [ ${PG_VERSION} == '9.6' ]; then +if [ ${PBK_EDITION} == 'std' ] && [ ${PG_VERSION} == '9.6' ]; then exit 0 fi #if [ ${CODENAME} == 'precise' ] && [ ${PG_VERSION} != '10' ] && [ ${PG_VERSION} != '11' ]; then su postgres -c "${BINDIR}/pgbench --no-vacuum -t 1000 -c 1" - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} backup --instance=node -b page -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} show --instance=node -B /tmp/backup -D ${PGDATA}" su postgres -c "${BINDIR}/pg_ctl stop -w -t 60 -D ${PGDATA}" rm -rf ${PGDATA} - su postgres -c "pg_probackup-${EDITION}-${PG_VERSION} restore --instance=node -B /tmp/backup -D ${PGDATA}" + su postgres -c "pg_probackup-${PBK_EDITION}-${PG_VERSION} restore --instance=node -B /tmp/backup -D ${PGDATA}" su postgres -c "${BINDIR}/pg_ctl start -w -t 60 -D ${PGDATA}" sleep 5 diff --git a/packaging/test/scripts/pg_probackup_forks_rpm.sh b/packaging/test/scripts/rpm_forks.sh similarity index 99% rename from packaging/test/scripts/pg_probackup_forks_rpm.sh rename to packaging/test/scripts/rpm_forks.sh index f58655d7d..a74781382 100755 --- a/packaging/test/scripts/pg_probackup_forks_rpm.sh +++ b/packaging/test/scripts/rpm_forks.sh @@ -13,7 +13,7 @@ ulimit -n 1024 PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') -if [ ${EDITION} == 'ent' ]; then +if [ ${PBK_EDITION} == 'ent' ]; then exit 0 fi From efe6bf8cfa487407c3d98c3f393e493ad29e1679 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 14:22:15 +0300 Subject: [PATCH 48/54] [skip travis] test packages for std|ent --- packaging/test/scripts/deb_forks.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packaging/test/scripts/deb_forks.sh b/packaging/test/scripts/deb_forks.sh index d59b1dda0..18946b275 100755 --- a/packaging/test/scripts/deb_forks.sh +++ b/packaging/test/scripts/deb_forks.sh @@ -61,7 +61,6 @@ if [ ${PBK_EDITION} == 'std' ]; then sh -c 'echo "deb https://repo.postgrespro.ru/pgpro-${PG_VERSION}/${DISTRIB}/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/pgpro.list' wget --quiet -O - https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/GPG-KEY-POSTGRESPRO | apt-key add - apt-get update -y -# apt-get install -y postgrespro-std-${PG_VERSION} if [[ ${PG_VERSION} == '9.6' ]]; then apt-get install -y postgrespro-${PG_VERSION} @@ -71,6 +70,8 @@ if [ ${PBK_EDITION} == 'std' ]; then BINDIR="/opt/pgpro/std-${PG_VERSION}/bin" export LD_LIBRARY_PATH=/opt/pgpro/std-${PG_VERSION}/lib/ fi + + apt-get install libpq5 -y fi # install pg_probackup from current public repo From 76a6c91fc1680f22f12e3f95bcb5bd9331e70bc9 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 14:29:17 +0300 Subject: [PATCH 49/54] [skip travis] test packages for std|ent --- packaging/test/scripts/deb_forks.sh | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/packaging/test/scripts/deb_forks.sh b/packaging/test/scripts/deb_forks.sh index 18946b275..2da80087c 100755 --- a/packaging/test/scripts/deb_forks.sh +++ b/packaging/test/scripts/deb_forks.sh @@ -15,6 +15,10 @@ if [ ${PBK_EDITION} == 'ent' ]; then exit 0 fi +if [ ${PBK_EDITION} == 'std' ] && [ ${PG_VERSION} == '9.6' ]; then + exit 0 +fi + # upgrade and utils # export parameters export DEBIAN_FRONTEND=noninteractive @@ -49,29 +53,15 @@ http { EOF nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &) -# add postgresql repo -if [ ${PG_VERSION} == '9.6' ]; then - sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - - apt-get update -y -fi - # install POSTGRESPRO if [ ${PBK_EDITION} == 'std' ]; then sh -c 'echo "deb https://repo.postgrespro.ru/pgpro-${PG_VERSION}/${DISTRIB}/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/pgpro.list' wget --quiet -O - https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/GPG-KEY-POSTGRESPRO | apt-key add - apt-get update -y - if [[ ${PG_VERSION} == '9.6' ]]; then - apt-get install -y postgrespro-${PG_VERSION} - BINDIR="/usr/lib/postgresql/${PG_VERSION}/bin" - else - apt-get install -y postgrespro-std-${PG_VERSION} - BINDIR="/opt/pgpro/std-${PG_VERSION}/bin" - export LD_LIBRARY_PATH=/opt/pgpro/std-${PG_VERSION}/lib/ - fi - - apt-get install libpq5 -y + apt-get install -y postgrespro-std-${PG_VERSION} + BINDIR="/opt/pgpro/std-${PG_VERSION}/bin" + export LD_LIBRARY_PATH=/opt/pgpro/std-${PG_VERSION}/lib/ fi # install pg_probackup from current public repo From 29e97a1fee71138524b0c7046e1d909c3018736d Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 14:31:22 +0300 Subject: [PATCH 50/54] [skip travis] test packages for std|ent --- packaging/test/scripts/alt_forks.sh | 2 +- packaging/test/scripts/deb_forks.sh | 2 +- packaging/test/scripts/rpm_forks.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/test/scripts/alt_forks.sh b/packaging/test/scripts/alt_forks.sh index 63068a5a6..c406e5358 100755 --- a/packaging/test/scripts/alt_forks.sh +++ b/packaging/test/scripts/alt_forks.sh @@ -30,7 +30,7 @@ events { http { server { listen 80 default; - root /var/www; + root /app/www; } } EOF diff --git a/packaging/test/scripts/deb_forks.sh b/packaging/test/scripts/deb_forks.sh index 2da80087c..a1290067f 100755 --- a/packaging/test/scripts/deb_forks.sh +++ b/packaging/test/scripts/deb_forks.sh @@ -47,7 +47,7 @@ events { http { server { listen 80 default; - root /var/www; + root /app/www; } } EOF diff --git a/packaging/test/scripts/rpm_forks.sh b/packaging/test/scripts/rpm_forks.sh index a74781382..8590f4332 100755 --- a/packaging/test/scripts/rpm_forks.sh +++ b/packaging/test/scripts/rpm_forks.sh @@ -55,7 +55,7 @@ events { http { server { listen 80 default; - root /var/www; + root /app/www; } } EOF From 3c7fb9fc7c4bec32b8d785fd94f3200bc9ccc56a Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 15:24:05 +0300 Subject: [PATCH 51/54] [skip travis] test packages for std|ent --- packaging/test/scripts/deb_forks.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packaging/test/scripts/deb_forks.sh b/packaging/test/scripts/deb_forks.sh index a1290067f..5175f38db 100755 --- a/packaging/test/scripts/deb_forks.sh +++ b/packaging/test/scripts/deb_forks.sh @@ -11,6 +11,9 @@ set -o pipefail # fix https://github.com/moby/moby/issues/23137 ulimit -n 1024 +# TODO: remove after release +exit 0 + if [ ${PBK_EDITION} == 'ent' ]; then exit 0 fi From 77fd5f9b8e18f38ccf86637460982ce416a27434 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Sun, 8 Aug 2021 15:29:58 +0300 Subject: [PATCH 52/54] [skip travis] test packages for std|ent --- packaging/test/scripts/rpm_forks.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/test/scripts/rpm_forks.sh b/packaging/test/scripts/rpm_forks.sh index 8590f4332..8596f6656 100755 --- a/packaging/test/scripts/rpm_forks.sh +++ b/packaging/test/scripts/rpm_forks.sh @@ -13,7 +13,7 @@ ulimit -n 1024 PG_TOG=$(echo $PG_VERSION | sed 's|\.||g') -if [ ${PBK_EDITION} == 'ent' ]; then +if [ ${PBK_PBK_EDITION} == 'ent' ]; then exit 0 fi @@ -71,7 +71,7 @@ yum install -y ${PKG_NAME} ${PKG_NAME} --help ${PKG_NAME} --version -if [ $EDITION == 'std' ] ; then +if [ $PBK_EDITION == 'std' ] ; then # install POSTGRESQL # rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-${DISTRIB_VERSION}-x86_64/pgdg-redhat-repo-latest.noarch.rpm @@ -120,11 +120,11 @@ sed -i "s/https/http/g" /etc/yum.repos.d/pg_probackup-forks.repo # yum update -y ${PKG_NAME} yum install -y ${PKG_NAME} -sleep 1 + ${PKG_NAME} --help ${PKG_NAME} --version -if [ $EDITION == 'ent' ]; then +if [ $PBK_EDITION == 'ent' ]; then exit 0 fi From ddf5199d08f57a41ea29fc2f86c87bd8d818bb42 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Fri, 3 Sep 2021 22:33:50 +0300 Subject: [PATCH 53/54] [skip travis] fix rhel --- packaging/Dockerfiles/Dockerfile-centos_6 | 5 ---- packaging/Dockerfiles/Dockerfile-rhel_7 | 8 +++--- packaging/Dockerfiles/Dockerfile-rhel_8 | 4 +-- packaging/Makefile.pkg | 10 ++------ packaging/Makefile.repo | 12 ++------- packaging/Makefile.test | 9 +++---- packaging/pkg/Makefile.centos | 25 ------------------- packaging/pkg/Makefile.rhel | 25 ------------------- .../rpmbuild/SPECS/pg_probackup-pgpro.spec | 4 +-- .../rpm/rpmbuild/SPECS/pg_probackup.spec | 2 +- packaging/test/Makefile.rhel | 21 ---------------- 11 files changed, 17 insertions(+), 108 deletions(-) delete mode 100644 packaging/Dockerfiles/Dockerfile-centos_6 diff --git a/packaging/Dockerfiles/Dockerfile-centos_6 b/packaging/Dockerfiles/Dockerfile-centos_6 deleted file mode 100644 index 5a83c79bb..000000000 --- a/packaging/Dockerfiles/Dockerfile-centos_6 +++ /dev/null @@ -1,5 +0,0 @@ -FROM centos:6 -RUN yum install -y tar wget rpm-build yum-utils -RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex -RUN yum install -y git -RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-rhel_7 b/packaging/Dockerfiles/Dockerfile-rhel_7 index ad283adf2..322c44b59 100644 --- a/packaging/Dockerfiles/Dockerfile-rhel_7 +++ b/packaging/Dockerfiles/Dockerfile-rhel_7 @@ -1,5 +1,7 @@ -FROM registry.access.redhat.com/rhel7 -RUN yum install -y tar wget rpm-build yum-utils -RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +FROM registry.access.redhat.com/ubi7 +RUN yum install -y http://mirror.centos.org/centos/7/os/x86_64/Packages/elfutils-0.176-5.el7.x86_64.rpm +RUN yum install -y http://mirror.centos.org/centos/7/os/x86_64/Packages/rpm-build-4.11.3-45.el7.x86_64.rpm +RUN yum install -y tar wget yum-utils +RUN yum install -y gcc make perl libicu-devel glibc-devel RUN yum install -y git RUN yum upgrade -y diff --git a/packaging/Dockerfiles/Dockerfile-rhel_8 b/packaging/Dockerfiles/Dockerfile-rhel_8 index 16c4aa1e4..c8e1e225e 100644 --- a/packaging/Dockerfiles/Dockerfile-rhel_8 +++ b/packaging/Dockerfiles/Dockerfile-rhel_8 @@ -1,5 +1,5 @@ -FROM ecpe4s/rhel8-spack +FROM registry.access.redhat.com/ubi8 RUN yum install -y tar wget rpm-build yum-utils -RUN yum install -y gcc make perl libicu-devel glibc-devel bison flex +RUN yum install -y gcc make perl libicu-devel glibc-devel RUN yum install -y git RUN yum upgrade -y diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index dde95a6f3..214948c14 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -86,12 +86,9 @@ include packaging/pkg/Makefile.debian include packaging/pkg/Makefile.ubuntu # CENTOS -build/centos: build/centos_6 build/centos_7 build/centos_8 #build/rpm_repo_package_centos +build/centos: build/centos_7 build/centos_8 #build/rpm_repo_package_centos @echo Centos: done -build/centos_6: build/centos_6_9.5 build/centos_6_9.6 build/centos_6_10 build/centos_6_11 build/centos_6_12 build/centos_6_13 - @echo Centos 6: done - build/centos_7: build/centos_7_9.5 build/centos_7_9.6 build/centos_7_10 build/centos_7_11 build/centos_7_12 build/centos_7_13 @echo Centos 7: done @@ -112,12 +109,9 @@ build/oraclelinux_8: build/oraclelinux_8_9.5 build/oraclelinux_8_9.6 build/oracl @echo Oraclelinux 8: done # RHEL -build/rhel: build/rhel_6 build/rhel_7 build/rhel_8 #build/rpm_repo_package_rhel +build/rhel: build/rhel_7 build/rhel_8 #build/rpm_repo_package_rhel @echo Rhel: done -build/rhel_6: build/rhel_6_9.5 build/rhel_6_9.6 build/rhel_6_10 build/rhel_6_11 build/rhel_6_12 build/rhel_6_13 - @echo Rhel 6: done - build/rhel_7: build/rhel_7_9.5 build/rhel_7_9.6 build/rhel_7_10 build/rhel_7_11 build/rhel_7_12 build/rhel_7_13 @echo Rhel 7: done diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index e5403a9f2..71d9bce98 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -39,13 +39,9 @@ build/repo_ubuntu_20.04: touch build/repo_ubuntu_20.04 # Centos -repo/centos: build/repo_centos_6 build/repo_centos_7 build/repo_centos_8 +repo/centos: build/repo_centos_7 build/repo_centos_8 @echo Build repo for centos platforms: done -build/repo_centos_6: - $(call build_repo_rpm,centos,6,,) - touch build/repo_centos_6 - build/repo_centos_7: $(call build_repo_rpm,centos,7,,) touch build/repo_centos_7 @@ -71,13 +67,9 @@ build/repo_oraclelinux_8: touch build/repo_oraclelinux_8 # RHEL -repo/rhel: build/repo_rhel_6 build/repo_rhel_7 build/repo_rhel_8 +repo/rhel: build/repo_rhel_7 build/repo_rhel_8 @echo Build repo for rhel platforms: done -build/repo_rhel_6: - $(call build_repo_rpm,rhel,6,6Server) - touch build/repo_rhel_6 - build/repo_rhel_7: $(call build_repo_rpm,rhel,7,7Server) touch build/repo_rhel_7 diff --git a/packaging/Makefile.test b/packaging/Makefile.test index d5b504ccf..916bc7edc 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -71,16 +71,13 @@ build/test_oraclelinux_8: build/test_oraclelinux_8_9.6 build/test_oraclelinux_8_ @echo Oraclelinux 8: done # RHEL -build/test_rhel: build/test_rhel_6 build/test_rhel_7 build/test_rhel_8 +build/test_rhel: build/test_rhel_7 build/test_rhel_8 @echo Rhel: done -build/test_rhel_6: build/test_rhel_6_9.6 build/test_rhel_6_10 build/test_rhel_6_11 build/test_rhel_6_12 build/test_rhel_6_13 - @echo Rhel 6: done - -build/test_rhel_7: build/test_rhel_7_9.6 build/test_rhel_7_10 build/test_rhel_7_11 build/test_rhel_7_12 build/test_rhel_7_13 +build/test_rhel_7: build/test_rhel_7_9.5 build/test_rhel_7_9.6 build/test_rhel_7_10 build/test_rhel_7_11 build/test_rhel_7_12 build/test_rhel_7_13 @echo Rhel 7: done -build/test_rhel_8: build/test_rhel_8_9.6 build/test_rhel_8_10 build/test_rhel_8_11 build/test_rhel_8_12 build/test_rhel_8_13 +build/test_rhel_8: build/test_rhel_8_9.5 build/test_rhel_8_9.6 build/test_rhel_8_10 build/test_rhel_8_11 build/test_rhel_8_12 build/test_rhel_8_13 @echo Rhel 8: done define test_rpm diff --git a/packaging/pkg/Makefile.centos b/packaging/pkg/Makefile.centos index 7b248bb13..9353b2cde 100644 --- a/packaging/pkg/Makefile.centos +++ b/packaging/pkg/Makefile.centos @@ -1,28 +1,3 @@ -# CENTOS 6 -build/centos_6_9.5: - $(call build_rpm,centos,6,,9.5,9.5.25) - touch build/centos_6_9.5 - -build/centos_6_9.6: - $(call build_rpm,centos,6,,9.6,9.6.21) - touch build/centos_6_9.6 - -build/centos_6_10: - $(call build_rpm,centos,6,,10,10.16) - touch build/centos_6_10 - -build/centos_6_11: - $(call build_rpm,centos,6,,11,11.11) - touch build/centos_6_11 - -build/centos_6_12: - $(call build_rpm,centos,6,,12,12.6) - touch build/centos_6_12 - -build/centos_6_13: - $(call build_rpm,centos,6,,13,13.2) - touch build/centos_6_13 - # CENTOS 7 build/centos_7_9.5: $(call build_rpm,centos,7,,9.5,9.5.25) diff --git a/packaging/pkg/Makefile.rhel b/packaging/pkg/Makefile.rhel index 31348cbec..f266966cf 100644 --- a/packaging/pkg/Makefile.rhel +++ b/packaging/pkg/Makefile.rhel @@ -1,28 +1,3 @@ -# RHEL 6 -build/rhel_6_9.5: - $(call build_rpm,rhel,6,6Server,9.5,9.5.25) - touch build/rhel_6_9.5 - -build/rhel_6_9.6: - $(call build_rpm,rhel,6,6Server,9.6,9.6.21) - touch build/rhel_6_9.6 - -build/rhel_6_10: - $(call build_rpm,rhel,6,6Server,10,10.16) - touch build/rhel_6_10 - -build/rhel_6_11: - $(call build_rpm,rhel,6,6Server,11,11.11) - touch build/rhel_6_11 - -build/rhel_6_12: - $(call build_rpm,rhel,6,6Server,12,12.6) - touch build/rhel_6_12 - -build/rhel_6_13: - $(call build_rpm,rhel,6,6Server,13,13.2) - touch build/rhel_6_13 - # RHEL 7 build/rhel_7_9.5: $(call build_rpm,rhel,7,7Server,9.5,9.5.25) diff --git a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec index 80d7087d1..d5811171d 100644 --- a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec +++ b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup-pgpro.spec @@ -18,8 +18,8 @@ Url: http://postgrespro.ru/ #Source1: pg_probackup-%{version}.tar.bz2 Source0: postgrespro-%{edition}-%{pgsql_full} Source1: pg_probackup-%{version} -BuildRequires: gcc make perl glibc-devel bison flex -BuildRequires: readline-devel openssl-devel gettext zlib-devel +BuildRequires: gcc make perl glibc-devel +BuildRequires: openssl-devel gettext zlib-devel %description diff --git a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec index 927642074..e5fb5ad48 100644 --- a/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec +++ b/packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec @@ -13,7 +13,7 @@ License: BSD Url: http://postgrespro.ru/ Source0: http://ftp.postgresql.org/pub/source/v%{pgsql_full}/postgresql-%{pgsql_major}.tar.bz2 Source1: pg_probackup-%{version}.tar.bz2 -BuildRequires: gcc make perl glibc-devel bison flex readline-devel openssl-devel gettext zlib-devel +BuildRequires: gcc make perl glibc-devel openssl-devel gettext zlib-devel %description Backup tool for PostgreSQL. diff --git a/packaging/test/Makefile.rhel b/packaging/test/Makefile.rhel index b1170b67b..3169d11c9 100644 --- a/packaging/test/Makefile.rhel +++ b/packaging/test/Makefile.rhel @@ -1,24 +1,3 @@ -# RHEL 6 -build/test_rhel_6_9.6: - $(call test_rpm,rhel,6,6Server,9.6,9.6.21) - touch build/test_rhel_6_9.6 - -build/test_rhel_6_10: - $(call test_rpm,rhel,6,6Server,10,10.16) - touch build/test_rhel_6_10 - -build/test_rhel_6_11: - $(call test_rpm,rhel,6,6Server,11,11.11) - touch build/test_rhel_6_11 - -build/test_rhel_6_12: - $(call test_rpm,rhel,6,6Server,12,12.6) - touch build/test_rhel_6_12 - -build/test_rhel_6_13: - $(call test_rpm,rhel,6,6Server,13,13.2) - touch build/test_rhel_6_13 - # RHEL 7 build/test_rhel_7_9.6: $(call test_rpm,rhel,7,7Server,9.6,9.6.21) From 23397f4ee6ad62cbd666a296af0dde242e0fa413 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Fri, 3 Sep 2021 23:03:19 +0300 Subject: [PATCH 54/54] [Issue #427] build pkg repo for Debian 11 --- packaging/Dockerfiles/Dockerfile-debian_11 | 7 ++++++ packaging/Makefile.pkg | 7 ++++-- packaging/Makefile.repo | 6 +++++- packaging/Makefile.test | 7 ++++-- packaging/pkg/Makefile.debian | 25 ++++++++++++++++++++++ 5 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 packaging/Dockerfiles/Dockerfile-debian_11 diff --git a/packaging/Dockerfiles/Dockerfile-debian_11 b/packaging/Dockerfiles/Dockerfile-debian_11 new file mode 100644 index 000000000..db736c193 --- /dev/null +++ b/packaging/Dockerfiles/Dockerfile-debian_11 @@ -0,0 +1,7 @@ +FROM debian:11 +RUN apt-get update -y +RUN apt-get install -y devscripts +RUN apt-get install -y dpkg-dev lsb-release git equivs wget vim +RUN apt-get install -y cmake bison flex libboost-all-dev +RUN apt-get install -y reprepro +RUN apt-get upgrade -y diff --git a/packaging/Makefile.pkg b/packaging/Makefile.pkg index 214948c14..bfe2043c3 100644 --- a/packaging/Makefile.pkg +++ b/packaging/Makefile.pkg @@ -42,7 +42,7 @@ build/all: build/debian build/ubuntu build/centos build/oraclelinux build/alt bu @echo Packaging is done ### DEBIAN -build/debian: build/debian_8 build/debian_9 build/debian_10 +build/debian: build/debian_8 build/debian_9 build/debian_10 build/debian_11 @echo Debian: done build/debian_8: build/debian_8_9.5 build/debian_8_9.6 build/debian_8_10 build/debian_8_11 build/debian_8_12 build/debian_8_13 @@ -51,9 +51,12 @@ build/debian_8: build/debian_8_9.5 build/debian_8_9.6 build/debian_8_10 build/de build/debian_9: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13 @echo Debian 9: done -build/debian_10: build/debian_9_9.5 build/debian_9_9.6 build/debian_9_10 build/debian_9_11 build/debian_9_12 build/debian_9_13 +build/debian_10: build/debian_10_9.5 build/debian_10_9.6 build/debian_10_10 build/debian_10_11 build/debian_10_12 build/debian_10_13 @echo Debian 10: done +build/debian_11: build/debian_11_9.5 build/debian_11_9.6 build/debian_11_10 build/debian_11_11 build/debian_11_12 build/debian_11_13 + @echo Debian 11: done + ### UBUNTU build/ubuntu: build/ubuntu_14.04 build/ubuntu_16.04 build/ubuntu_18.04 build/ubuntu_20.04 @echo Ubuntu: done diff --git a/packaging/Makefile.repo b/packaging/Makefile.repo index 71d9bce98..986c827e9 100644 --- a/packaging/Makefile.repo +++ b/packaging/Makefile.repo @@ -3,7 +3,7 @@ repo: check_env repo/debian repo/ubuntu repo/centos repo/oraclelinux repo/alt re @echo Build repo for all platform: done # Debian -repo/debian: build/repo_debian_8 build/repo_debian_9 build/repo_debian_10 +repo/debian: build/repo_debian_8 build/repo_debian_9 build/repo_debian_10 build/repo_debian_11 @echo Build repo for debian platforms: done build/repo_debian_8: @@ -18,6 +18,10 @@ build/repo_debian_10: $(call build_repo_deb,debian,10,buster) touch build/repo_debian_10 +build/repo_debian_11: + $(call build_repo_deb,debian,11,bullseye) + touch build/repo_debian_11 + # Ubuntu repo/ubuntu: build/repo_ubuntu_14.04 build/repo_ubuntu_16.04 build/repo_ubuntu_18.04 build/repo_ubuntu_20.04 @echo Build repo for ubuntu platforms: done diff --git a/packaging/Makefile.test b/packaging/Makefile.test index 916bc7edc..fbb415c46 100644 --- a/packaging/Makefile.test +++ b/packaging/Makefile.test @@ -13,15 +13,18 @@ build/test_all: build/test_debian build/test_ubuntu build/test_centos build/test @echo Package testing is done ### DEBIAN -build/test_debian: build/test_debian_9 build/test_debian_10 +build/test_debian: build/test_debian_9 build/test_debian_10 build/test_debian_11 @echo Debian: done build/test_debian_9: build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 @echo Debian 9: done -build/test_debian_10: build/test_debian_9_9.6 build/test_debian_9_10 build/test_debian_9_11 build/test_debian_9_12 build/test_debian_9_13 +build/test_debian_10: build/test_debian_10_9.6 build/test_debian_10_10 build/test_debian_10_11 build/test_debian_10_12 build/test_debian_10_13 @echo Debian 10: done +build/test_debian_11: build/test_debian_11_9.6 build/test_debian_11_10 build/test_debian_11_11 build/test_debian_11_12 build/test_debian_11_13 + @echo Debian 11: done + ### UBUNTU build/test_ubuntu: build/test_ubuntu_16.04 build/test_ubuntu_18.04 build/test_ubuntu_20.04 @echo Ubuntu: done diff --git a/packaging/pkg/Makefile.debian b/packaging/pkg/Makefile.debian index e9e2536ba..9625a14e9 100644 --- a/packaging/pkg/Makefile.debian +++ b/packaging/pkg/Makefile.debian @@ -72,3 +72,28 @@ build/debian_10_12: build/debian_10_13: $(call build_deb,debian,10,buster,13,13.2) touch build/debian_10_13 + +# DEBIAN 11 +build/debian_11_9.5: + $(call build_deb,debian,11,bullseye,9.5,9.5.25) + touch build/debian_11_9.5 + +build/debian_11_9.6: + $(call build_deb,debian,11,bullseye,9.6,9.6.21) + touch build/debian_11_9.6 + +build/debian_11_10: + $(call build_deb,debian,11,bullseye,10,10.16) + touch build/debian_11_10 + +build/debian_11_11: + $(call build_deb,debian,11,bullseye,11,11.11) + touch build/debian_11_11 + +build/debian_11_12: + $(call build_deb,debian,11,bullseye,12,12.6) + touch build/debian_11_12 + +build/debian_11_13: + $(call build_deb,debian,11,bullseye,13,13.2) + touch build/debian_11_13