mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-11-28 09:33:54 +02:00
built-in package infrastructure (#418)
[PR #418] built-in package infrastructure
This commit is contained in:
parent
ce32d19f36
commit
4a7db4cf5e
6
.gitignore
vendored
6
.gitignore
vendored
@ -54,6 +54,12 @@
|
||||
/make_dockerfile.sh
|
||||
/backup_restore.sh
|
||||
|
||||
# Packaging
|
||||
/build
|
||||
/packaging/pkg/tarballs/pgpro.tar.bz2
|
||||
/packaging/repo/pg_probackup
|
||||
/packaging/repo/pg_probackup-forks
|
||||
|
||||
# Misc
|
||||
.python-version
|
||||
.vscode
|
||||
|
7
Makefile
7
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 \
|
||||
@ -80,3 +83,7 @@ src/walmethods.h: $(srchome)/src/bin/pg_basebackup/walmethods.h
|
||||
ifeq ($(PORTNAME), aix)
|
||||
CC=xlc_r
|
||||
endif
|
||||
|
||||
include packaging/Makefile.pkg
|
||||
include packaging/Makefile.repo
|
||||
include packaging/Makefile.test
|
||||
|
5
packaging/Dockerfiles/Dockerfile-altlinux_8
Normal file
5
packaging/Dockerfiles/Dockerfile-altlinux_8
Normal file
@ -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
|
5
packaging/Dockerfiles/Dockerfile-altlinux_9
Normal file
5
packaging/Dockerfiles/Dockerfile-altlinux_9
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-astra_1.11
Normal file
7
packaging/Dockerfiles/Dockerfile-astra_1.11
Normal file
@ -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
|
5
packaging/Dockerfiles/Dockerfile-centos_7
Normal file
5
packaging/Dockerfiles/Dockerfile-centos_7
Normal file
@ -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
|
5
packaging/Dockerfiles/Dockerfile-centos_8
Normal file
5
packaging/Dockerfiles/Dockerfile-centos_8
Normal file
@ -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
|
4
packaging/Dockerfiles/Dockerfile-createrepo1C
Normal file
4
packaging/Dockerfiles/Dockerfile-createrepo1C
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-debian_10
Normal file
7
packaging/Dockerfiles/Dockerfile-debian_10
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-debian_11
Normal file
7
packaging/Dockerfiles/Dockerfile-debian_11
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-debian_8
Normal file
7
packaging/Dockerfiles/Dockerfile-debian_8
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-debian_9
Normal file
7
packaging/Dockerfiles/Dockerfile-debian_9
Normal file
@ -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
|
5
packaging/Dockerfiles/Dockerfile-oraclelinux_6
Normal file
5
packaging/Dockerfiles/Dockerfile-oraclelinux_6
Normal file
@ -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
|
5
packaging/Dockerfiles/Dockerfile-oraclelinux_7
Normal file
5
packaging/Dockerfiles/Dockerfile-oraclelinux_7
Normal file
@ -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
|
5
packaging/Dockerfiles/Dockerfile-oraclelinux_8
Normal file
5
packaging/Dockerfiles/Dockerfile-oraclelinux_8
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-rhel_7
Normal file
7
packaging/Dockerfiles/Dockerfile-rhel_7
Normal file
@ -0,0 +1,7 @@
|
||||
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
|
5
packaging/Dockerfiles/Dockerfile-rhel_8
Normal file
5
packaging/Dockerfiles/Dockerfile-rhel_8
Normal file
@ -0,0 +1,5 @@
|
||||
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
|
||||
RUN yum install -y git
|
||||
RUN yum upgrade -y
|
5
packaging/Dockerfiles/Dockerfile-rosa_6
Normal file
5
packaging/Dockerfiles/Dockerfile-rosa_6
Normal file
@ -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
|
4
packaging/Dockerfiles/Dockerfile-suse_15.1
Normal file
4
packaging/Dockerfiles/Dockerfile-suse_15.1
Normal file
@ -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
|
4
packaging/Dockerfiles/Dockerfile-suse_15.2
Normal file
4
packaging/Dockerfiles/Dockerfile-suse_15.2
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-ubuntu_14.04
Normal file
7
packaging/Dockerfiles/Dockerfile-ubuntu_14.04
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-ubuntu_16.04
Normal file
7
packaging/Dockerfiles/Dockerfile-ubuntu_16.04
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-ubuntu_18.04
Normal file
7
packaging/Dockerfiles/Dockerfile-ubuntu_18.04
Normal file
@ -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
|
7
packaging/Dockerfiles/Dockerfile-ubuntu_18.10
Normal file
7
packaging/Dockerfiles/Dockerfile-ubuntu_18.10
Normal file
@ -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
|
8
packaging/Dockerfiles/Dockerfile-ubuntu_20.04
Normal file
8
packaging/Dockerfiles/Dockerfile-ubuntu_20.04
Normal file
@ -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
|
191
packaging/Makefile.pkg
Normal file
191
packaging/Makefile.pkg
Normal file
@ -0,0 +1,191 @@
|
||||
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" ; \
|
||||
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
|
||||
|
||||
pkg: check_env build/prepare build/all
|
||||
@echo Build for all platform: done
|
||||
|
||||
build/prepare:
|
||||
mkdir -p build
|
||||
|
||||
build/clean: build/prepare
|
||||
find $(BUILDDIR) -maxdepth 1 -type f -exec rm -f {} \;
|
||||
|
||||
build/all: build/debian build/ubuntu build/centos build/oraclelinux build/alt build/suse # build/rhel
|
||||
@echo Packaging is done
|
||||
|
||||
### DEBIAN
|
||||
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
|
||||
@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_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
|
||||
|
||||
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: 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
|
||||
|
||||
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
|
||||
|
||||
define build_deb
|
||||
docker rm -f $1_$2_probackup_$(PKG_NAME_SUFFIX)$(PBK_VERSION) >> /dev/null 2>&1 ; \
|
||||
docker run \
|
||||
-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" \
|
||||
-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/pkg/Makefile.debian
|
||||
include packaging/pkg/Makefile.ubuntu
|
||||
|
||||
# CENTOS
|
||||
build/centos: build/centos_7 build/centos_8 #build/rpm_repo_package_centos
|
||||
@echo Centos: 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_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
|
||||
@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_7 build/rhel_8 #build/rpm_repo_package_rhel
|
||||
@echo Rhel: 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)/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" \
|
||||
-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/pkg/Makefile.centos
|
||||
include packaging/pkg/Makefile.rhel
|
||||
include packaging/pkg/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
|
||||
|
||||
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 \
|
||||
-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" \
|
||||
-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/pkg/Makefile.alt
|
||||
|
||||
# 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/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" \
|
||||
-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/pkg/Makefile.suse
|
167
packaging/Makefile.repo
Normal file
167
packaging/Makefile.repo
Normal file
@ -0,0 +1,167 @@
|
||||
#### REPO BUILD ####
|
||||
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
|
||||
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:
|
||||
$(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
|
||||
|
||||
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
|
||||
|
||||
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_7 build/repo_centos_8
|
||||
@echo Build repo for centos platforms: done
|
||||
|
||||
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,6Server)
|
||||
touch build/repo_oraclelinux_6
|
||||
|
||||
build/repo_oraclelinux_7:
|
||||
$(call build_repo_rpm,oraclelinux,7,7Server)
|
||||
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_7 build/repo_rhel_8
|
||||
@echo Build repo for rhel platforms: done
|
||||
|
||||
build/repo_rhel_7:
|
||||
$(call build_repo_rpm,rhel,7,7Server)
|
||||
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)/
|
||||
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
|
||||
|
||||
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
|
145
packaging/Makefile.test
Normal file
145
packaging/Makefile.test
Normal file
@ -0,0 +1,145 @@
|
||||
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
|
||||
|
||||
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_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_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
|
||||
|
||||
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.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.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:/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$(SCRIPT_SUFFIX).sh
|
||||
endef
|
||||
|
||||
include packaging/test/Makefile.debian
|
||||
include packaging/test/Makefile.ubuntu
|
||||
|
||||
# CENTOS
|
||||
build/test_centos: build/test_centos_7 build/test_centos_8
|
||||
@echo Centos: 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
|
||||
|
||||
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_7 build/test_oraclelinux_8
|
||||
@echo Oraclelinux: 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
|
||||
|
||||
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_7 build/test_rhel_8
|
||||
@echo Rhel: 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:/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$(SCRIPT_SUFFIX).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_9
|
||||
@echo Alt Linux: 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
|
||||
|
||||
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:/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$(SCRIPT_SUFFIX).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.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.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:/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$(SCRIPT_SUFFIX).sh
|
||||
endef
|
||||
|
||||
include packaging/test/Makefile.suse
|
21
packaging/Readme.md
Normal file
21
packaging/Readme.md
Normal file
@ -0,0 +1,21 @@
|
||||
Example:
|
||||
```
|
||||
export PBK_VERSION=2.4.17
|
||||
export PBK_HASH=57f871accce2604
|
||||
export PBK_RELEASE=1
|
||||
export PBK_EDITION=std|ent
|
||||
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 ...
|
||||
Repo must be build using 1 thread (due to debian bullshit):
|
||||
```
|
||||
make repo -j1
|
||||
```
|
74
packaging/pkg/Makefile.alt
Normal file
74
packaging/pkg/Makefile.alt
Normal file
@ -0,0 +1,74 @@
|
||||
# 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
|
||||
|
||||
# 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
|
49
packaging/pkg/Makefile.centos
Normal file
49
packaging/pkg/Makefile.centos
Normal file
@ -0,0 +1,49 @@
|
||||
# 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.2)
|
||||
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.2)
|
||||
touch build/centos_8_13
|
99
packaging/pkg/Makefile.debian
Normal file
99
packaging/pkg/Makefile.debian
Normal file
@ -0,0 +1,99 @@
|
||||
# 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.2)
|
||||
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.2)
|
||||
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.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
|
74
packaging/pkg/Makefile.oraclelinux
Normal file
74
packaging/pkg/Makefile.oraclelinux
Normal file
@ -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.2)
|
||||
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.2)
|
||||
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.2)
|
||||
touch build/oraclelinux_8_13
|
49
packaging/pkg/Makefile.rhel
Normal file
49
packaging/pkg/Makefile.rhel
Normal file
@ -0,0 +1,49 @@
|
||||
# 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.2)
|
||||
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.2)
|
||||
touch build/rhel_8_13
|
49
packaging/pkg/Makefile.suse
Normal file
49
packaging/pkg/Makefile.suse
Normal file
@ -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
|
99
packaging/pkg/Makefile.ubuntu
Normal file
99
packaging/pkg/Makefile.ubuntu
Normal file
@ -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.2)
|
||||
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.2)
|
||||
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.2)
|
||||
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.2)
|
||||
touch build/ubuntu_14.04_13
|
123
packaging/pkg/scripts/alt.sh
Executable file
123
packaging/pkg/scripts/alt.sh
Executable file
@ -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
|
148
packaging/pkg/scripts/deb.sh
Executable file
148
packaging/pkg/scripts/deb.sh
Executable file
@ -0,0 +1,148 @@
|
||||
#!/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
|
||||
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 checkout ${PKG_HASH}
|
||||
cd ..
|
||||
|
||||
PG_TOC=$(echo ${PG_VERSION} | sed 's|\.||g')
|
||||
# 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
|
||||
|
||||
cd /root/build/${PKG_NAME}_${PKG_VERSION}
|
||||
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
|
||||
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/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
|
148
packaging/pkg/scripts/rpm.sh
Executable file
148
packaging/pkg/scripts/rpm.sh
Executable file
@ -0,0 +1,148 @@
|
||||
#!/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/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
|
||||
|
||||
# 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
|
||||
|
||||
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
|
||||
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/
|
||||
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}
|
||||
|
||||
# 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/@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
|
||||
|
||||
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
|
||||
|
||||
# install dependencies
|
||||
yum-builddep -y pg_probackup.spec
|
||||
|
||||
# build pg_probackup
|
||||
rpmbuild -bs pg_probackup.spec
|
||||
rpmbuild -ba pg_probackup.spec
|
||||
|
||||
# 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
|
||||
|
||||
# build repo files
|
||||
rpmbuild -ba pg_probackup-repo-forks.spec
|
||||
|
||||
# write artefacts to out directory
|
||||
rm -rf /app/out/*
|
||||
cp -arv /root/rpmbuild/RPMS /app/out
|
||||
fi
|
95
packaging/pkg/scripts/suse.sh
Executable file
95
packaging/pkg/scripts/suse.sh
Executable file
@ -0,0 +1,95 @@
|
||||
#!/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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
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/*
|
||||
|
||||
cp -arv /root/rpmbuild/{RPMS,SRPMS} /app/out
|
11
packaging/pkg/specs/deb/pg_probackup/debian/changelog
Normal file
11
packaging/pkg/specs/deb/pg_probackup/debian/changelog
Normal file
@ -0,0 +1,11 @@
|
||||
@PKG_NAME@ (@PKG_VERSION@-@PKG_RELEASE@.@PKG_HASH@.@CODENAME@) @CODENAME@; urgency=medium
|
||||
|
||||
* @PKG_VERSION@
|
||||
|
||||
-- Grigory Smolkin <g.smolkin@postgrespro.ru> Wed, 9 Feb 2018 10:22:08 +0300
|
||||
|
||||
@PKG_NAME@ (2.0.14-1.@CODENAME@) @CODENAME@; urgency=medium
|
||||
|
||||
* Initial package
|
||||
|
||||
-- Grigory Smolkin <g.smolkin@postgrespro.ru> Fri, 29 Jan 2018 10:22:08 +0300
|
1
packaging/pkg/specs/deb/pg_probackup/debian/compat
Normal file
1
packaging/pkg/specs/deb/pg_probackup/debian/compat
Normal file
@ -0,0 +1 @@
|
||||
9
|
29
packaging/pkg/specs/deb/pg_probackup/debian/control
Normal file
29
packaging/pkg/specs/deb/pg_probackup/debian/control
Normal file
@ -0,0 +1,29 @@
|
||||
Source: @PKG_NAME@
|
||||
Section: database
|
||||
Priority: optional
|
||||
Maintainer: PostgresPro DBA <dba@postgrespro.ru>
|
||||
Uploaders: Grigory Smolkin <g.smolkin@postgrespro.ru>
|
||||
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
|
@ -0,0 +1 @@
|
||||
pg_probackup-@PG_VERSION@ /usr/bin/
|
29
packaging/pkg/specs/deb/pg_probackup/debian/rules
Normal file
29
packaging/pkg/specs/deb/pg_probackup/debian/rules
Normal file
@ -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
|
@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
@ -0,0 +1,52 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v2.0.22 (GNU/Linux)
|
||||
|
||||
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
|
||||
jCKs4enncezhjcAh
|
||||
=TVZj
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@ -0,0 +1,52 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v2.0.22 (GNU/Linux)
|
||||
|
||||
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
|
||||
jCKs4enncezhjcAh
|
||||
=TVZj
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@ -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
|
13
packaging/pkg/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo
Normal file
13
packaging/pkg/specs/rpm/rpmbuild/SOURCES/pg_probackup.repo
Normal file
@ -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
|
@ -0,0 +1,71 @@
|
||||
%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
|
||||
BuildRequires: openssl-devel gettext zlib-devel
|
||||
|
||||
|
||||
%description
|
||||
Backup tool for PostgresPro %{edition_full}.
|
||||
|
||||
%prep
|
||||
#%setup -q -b1 -n pg_probackup-%{version}.tar.bz2
|
||||
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 --without-readline --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 <g.smolkin@postgrespro.ru> - %{version}-%{release}.%{hash}
|
||||
- @PKG_VERSION@
|
||||
|
||||
* Fri Jan 29 2018 Grigory Smolkin <g.smolkin@postgrespro.ru> - 2.0.14-1
|
||||
- Initial release.
|
@ -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 <g.smolkin@postgrespro.ru>
|
||||
- Initial package
|
@ -0,0 +1,58 @@
|
||||
%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 <g.smolkin@postgrespro.ru>
|
||||
- release update
|
@ -0,0 +1,67 @@
|
||||
%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
|
||||
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 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
|
||||
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
|
||||
* Mon Nov 17 2019 Grigory Smolkin <g.smolkin@postgrespro.ru> - 2.2.6-1
|
||||
- Initial release.
|
48
packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec
Normal file
48
packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.alt.spec
Normal file
@ -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 --without-readline
|
||||
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 <g.smolkin@postgrespro.ru> - 2.2.6-1
|
||||
- Initial release.
|
48
packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec
Normal file
48
packaging/pkg/specs/rpm/rpmbuild/SPECS/pg_probackup.spec
Normal file
@ -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 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 --without-readline
|
||||
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 <g.smolkin@postgrespro.ru> - %{version}-%{release}.%{hash}
|
||||
- @PKG_VERSION@
|
||||
|
||||
* Fri Jan 29 2018 Grigory Smolkin <g.smolkin@postgrespro.ru> - 2.0.14-1
|
||||
- Initial release.
|
0
packaging/pkg/tarballs/.gitkeep
Normal file
0
packaging/pkg/tarballs/.gitkeep
Normal file
62
packaging/repo/scripts/alt.sh
Executable file
62
packaging/repo/scripts/alt.sh
Executable file
@ -0,0 +1,62 @@
|
||||
#!/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
|
||||
|
||||
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
|
||||
|
||||
# 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/
|
||||
|
||||
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}
|
||||
|
||||
# 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
|
51
packaging/repo/scripts/deb.sh
Executable file
51
packaging/repo/scripts/deb.sh
Executable file
@ -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
|
65
packaging/repo/scripts/rpm.sh
Executable file
65
packaging/repo/scripts/rpm.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/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 ${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
|
||||
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
|
||||
mkdir -p "$RPM_DIR"
|
||||
cp -arv $INPUT_DIR/$pkg/$pkg_full_version/RPMS/x86_64/* $RPM_DIR/
|
||||
for f in $(ls $RPM_DIR/*.rpm); do rpm --addsign $f || exit 1; done
|
||||
createrepo $RPM_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
|
72
packaging/repo/scripts/suse.sh
Executable file
72
packaging/repo/scripts/suse.sh
Executable file
@ -0,0 +1,72 @@
|
||||
#!/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
|
||||
|
||||
# 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
|
||||
# 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
|
||||
|
||||
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
|
||||
done
|
||||
done
|
20
packaging/test/Makefile.alt
Normal file
20
packaging/test/Makefile.alt
Normal file
@ -0,0 +1,20 @@
|
||||
# ALT 9
|
||||
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
|
41
packaging/test/Makefile.centos
Normal file
41
packaging/test/Makefile.centos
Normal file
@ -0,0 +1,41 @@
|
||||
# CENTOS 7
|
||||
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.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
|
41
packaging/test/Makefile.debian
Normal file
41
packaging/test/Makefile.debian
Normal file
@ -0,0 +1,41 @@
|
||||
# DEBIAN 9
|
||||
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.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
|
41
packaging/test/Makefile.oraclelinux
Normal file
41
packaging/test/Makefile.oraclelinux
Normal file
@ -0,0 +1,41 @@
|
||||
# ORACLE LINUX 7
|
||||
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.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
|
41
packaging/test/Makefile.rhel
Normal file
41
packaging/test/Makefile.rhel
Normal file
@ -0,0 +1,41 @@
|
||||
# RHEL 7
|
||||
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.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
|
41
packaging/test/Makefile.suse
Normal file
41
packaging/test/Makefile.suse
Normal file
@ -0,0 +1,41 @@
|
||||
# Suse 15.1
|
||||
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.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
|
62
packaging/test/Makefile.ubuntu
Normal file
62
packaging/test/Makefile.ubuntu
Normal file
@ -0,0 +1,62 @@
|
||||
# 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 18.04
|
||||
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 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_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
|
72
packaging/test/scripts/alt.sh
Executable file
72
packaging/test/scripts/alt.sh
Executable file
@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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 <<EOF > /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 /app/www;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
/etc/init.d/nginx start
|
||||
|
||||
# install POSTGRESQL
|
||||
|
||||
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} -y
|
||||
${PKG_NAME} --help
|
||||
${PKG_NAME} --version
|
||||
|
||||
# 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} -y
|
||||
${PKG_NAME} --help
|
||||
${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 --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}"
|
||||
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
|
75
packaging/test/scripts/alt_forks.sh
Executable file
75
packaging/test/scripts/alt_forks.sh
Executable file
@ -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 [ ${PBK_EDITION} == 'ent' ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
apt-get clean -y
|
||||
apt-get update -y
|
||||
apt-get install nginx su -y
|
||||
|
||||
adduser nginx
|
||||
|
||||
cat <<EOF > /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 /app/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
|
136
packaging/test/scripts/deb.sh
Executable file
136
packaging/test/scripts/deb.sh
Executable file
@ -0,0 +1,136 @@
|
||||
#!/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
|
||||
|
||||
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 <<EOF > /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 /app/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
|
||||
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 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}"
|
||||
|
||||
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
|
149
packaging/test/scripts/deb_forks.sh
Executable file
149
packaging/test/scripts/deb_forks.sh
Executable file
@ -0,0 +1,149 @@
|
||||
#!/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
|
||||
|
||||
# TODO: remove after release
|
||||
exit 0
|
||||
|
||||
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
|
||||
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 <<EOF > /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 /app/www;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
nginx -s reload || (pkill -9 nginx || nginx -c /etc/nginx/nginx.conf &)
|
||||
|
||||
# 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
|
||||
|
||||
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
|
||||
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-${PBK_EDITION}-${PG_VERSION}
|
||||
pg_probackup-${PBK_EDITION}-${PG_VERSION} --help
|
||||
pg_probackup-${PBK_EDITION}-${PG_VERSION} --version
|
||||
|
||||
|
||||
if [ ${PBK_EDITION} == 'std' ]; then
|
||||
export PGDATA=/tmp/data
|
||||
su postgres -c "${BINDIR}/initdb -k -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-${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-${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-${PBK_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 [ ${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-${PBK_EDITION}-${PG_VERSION}
|
||||
#fi
|
||||
|
||||
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 [ ${PBK_EDITION} == 'ent' ]; then
|
||||
if [ ${PG_VERSION} == '11' ] || [ ${PG_VERSION} == '10' ] || [ ${PG_VERSION} == '9.6' ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
pg_probackup-${PBK_EDITION}-${PG_VERSION} --help
|
||||
pg_probackup-${PBK_EDITION}-${PG_VERSION} --version
|
||||
|
||||
if [ ${PBK_EDITION} == 'ent' ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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-${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-${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
|
||||
echo "select count(*) from pgbench_accounts;" | su postgres -c "${BINDIR}/psql" || exit 1
|
||||
|
||||
exit 0
|
166
packaging/test/scripts/rpm.sh
Executable file
166
packaging/test/scripts/rpm.sh
Executable file
@ -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 <<EOF > /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 /app/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
|
173
packaging/test/scripts/rpm_forks.sh
Executable file
173
packaging/test/scripts/rpm_forks.sh
Executable file
@ -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 [ ${PBK_PBK_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 <<EOF > /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 /app/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 [ $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
|
||||
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}
|
||||
|
||||
${PKG_NAME} --help
|
||||
${PKG_NAME} --version
|
||||
|
||||
if [ $PBK_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
|
128
packaging/test/scripts/suse.sh
Executable file
128
packaging/test/scripts/suse.sh
Executable file
@ -0,0 +1,128 @@
|
||||
#!/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
|
||||
|
||||
# currenctly we do not build std|ent packages for Suse
|
||||
if [[ ${PBK_EDITION} != '' ]] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PG_TOG=$(echo $PG_VERSION | sed 's|\.||g')
|
||||
|
||||
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 <<EOF > /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 /app/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
|
||||
|
||||
exit 0
|
||||
|
||||
# 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
|
5
packaging/test/scripts/suse_forks.sh
Normal file
5
packaging/test/scripts/suse_forks.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -xe
|
||||
set -o pipefail
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user