Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
pgbackrest_version: ["2.47_arenadata4", "2.50_arenadata4", "2.52_arenadata12"]
pgbackrest_version: ["2.52_arenadata12", "2.54_arenadata13"]
env:
download_url: "https://github.com/arenadata/pgbackrest/archive"
steps:
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
run: |
IMAGE_TAG="$(echo ${TAG} | cut -d_ -f1)-gpdb"
docker buildx build \
-f Dockerfile_make \
-f Dockerfile \
--platform ${BUILD_PLATFORMS} \
--build-arg BACKREST_VERSION=${TAG} \
--build-arg REPO_BUILD_TAG=${REPO_TAG} \
Expand All @@ -206,7 +206,7 @@ jobs:
run: |
IMAGE_TAG="$(echo ${TAG} | cut -d_ -f1)-gpdb"
docker buildx build \
-f Dockerfile_make.alpine \
-f Dockerfile.alpine \
--platform ${BUILD_PLATFORMS} \
--build-arg BACKREST_VERSION=${TAG} \
--build-arg REPO_BUILD_TAG=${REPO_TAG} \
Expand All @@ -227,7 +227,7 @@ jobs:
echo ${DOCKERHUB_PKG} | docker login -u ${DOCKERHUB_USER} --password-stdin
IMAGE_TAG="$(echo ${TAG} | cut -d_ -f1)-gpdb"
docker buildx build --push \
-f Dockerfile_make \
-f Dockerfile \
--platform ${BUILD_PLATFORMS} \
--build-arg BACKREST_VERSION=${TAG} \
--build-arg REPO_BUILD_TAG=${REPO_TAG} \
Expand Down Expand Up @@ -255,7 +255,7 @@ jobs:
echo ${DOCKERHUB_PKG} | docker login -u ${DOCKERHUB_USER} --password-stdin
IMAGE_TAG="$(echo ${TAG} | cut -d_ -f1)-gpdb"
docker buildx build --push \
-f Dockerfile_make.alpine \
-f Dockerfile.alpine \
--platform ${BUILD_PLATFORMS} \
--build-arg BACKREST_VERSION=${TAG} \
--build-arg REPO_BUILD_TAG=${REPO_TAG} \
Expand Down
38 changes: 30 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ BACKREST_VERSIONS = 2.54.2 2.55.0 2.55.1 2.56.0 2.57.0
TAG?=2.57.0
TAG_MESON_BUILD=2.51
BACKREST_DOWNLOAD_URL = https://github.com/pgbackrest/pgbackrest/archive/release
BACKREST_GPDB_VERSIONS = 2.47_arenadata4 2.50_arenadata4 2.52_arenadata12
TAG_GPDB?=2.52_arenadata12
BACKREST_GPDB_VERSIONS = 2.52_arenadata12 2.54_arenadata13
TAG_GPDB?=2.54_arenadata13
BACKREST_GPDB_DOWNLOAD_URL = https://github.com/arenadata/pgbackrest/archive
BACKREST_COMP_VERSION?=v0.11
BACKREST_OLD_COMP_VERSION?=v0.10
Expand Down Expand Up @@ -37,16 +37,26 @@ build_version:
$(BACKREST_GPDB_VERSIONS):
$(call gpdb_image_tag,IMAGE_TAG,$@)
$(call get_completion_version,COMP_VERSION,$@)
$(eval IS_MAKE_BUILD := $(call version_compare,$@,$(TAG_MESON_BUILD)))
@echo "Build pgbackrest:$(IMAGE_TAG) docker image"
docker build --pull -f Dockerfile_make --build-arg BACKREST_VERSION=$@ --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) .
@if [ "$(IS_MAKE_BUILD)" = "true" ]; then \
docker build --pull -f Dockerfile_make --build-arg BACKREST_VERSION=$@ --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) . ; \
else \
docker build --pull -f Dockerfile --build-arg BACKREST_VERSION=$@ --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) . ; \
fi
docker run pgbackrest:$(IMAGE_TAG)

.PHONY: build_version_gpdb
build_version_gpdb:
$(call gpdb_image_tag,IMAGE_TAG,$(TAG_GPDB))
$(call get_completion_version,COMP_VERSION,$(TAG_GPDB))
$(eval IS_MAKE_BUILD := $(call version_compare,$(TAG_GPDB),$(TAG_MESON_BUILD)))
@echo "Build pgbackrest:$(IMAGE_TAG) docker image"
docker build --pull -f Dockerfile_make --build-arg BACKREST_VERSION=$(TAG_GPDB) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) .
@if [ "$(IS_MAKE_BUILD)" = "true" ]; then \
docker build --pull -f Dockerfile_make --build-arg BACKREST_VERSION=$(TAG_GPDB) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) . ; \
else \
docker build --pull -f Dockerfile --build-arg BACKREST_VERSION=$(TAG_GPDB) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) . ; \
fi
docker run pgbackrest:$(IMAGE_TAG)

.PHONY: $(BACKREST_VERSIONS)-alpine
Expand All @@ -72,16 +82,26 @@ build_version_alpine:
$(addsuffix -alpine,$(BACKREST_GPDB_VERSIONS)):
$(call gpdb_image_tag_alpine,IMAGE_TAG,$@)
$(call get_completion_version,COMP_VERSION,$(subst -alpine,,$@))
$(eval IS_MAKE_BUILD := $(call version_compare,$(subst -alpine,,$@),$(TAG_MESON_BUILD)))
@echo "Build pgbackrest:$(IMAGE_TAG) docker image"
docker build --pull -f Dockerfile_make.alpine --build-arg BACKREST_VERSION=$(subst -alpine,,$@) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) .
@if [ "$(IS_MAKE_BUILD)" = "true" ]; then \
docker build --pull -f Dockerfile_make.alpine --build-arg BACKREST_VERSION=$(subst -alpine,,$@) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) . ; \
else \
docker build --pull -f Dockerfile.alpine --build-arg BACKREST_VERSION=$(subst -alpine,,$@) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) . ; \
fi
docker run pgbackrest:$(shell echo $@ | cut -d_ -f1)-gpdb-alpine

.PHONY: build_version_gpdb_alpine
build_version_gpdb_alpine:
$(call gpdb_image_tag_alpine,IMAGE_TAG,$(TAG_GPDB))
$(call get_completion_version,COMP_VERSION,$(TAG_GPDB))
$(eval IS_MAKE_BUILD := $(call version_compare,$(TAG_GPDB),$(TAG_MESON_BUILD)))
@echo "Build pgbackrest:$(IMAGE_TAG) docker image"
docker build --pull -f Dockerfile_make.alpine --build-arg BACKREST_VERSION=$(TAG_GPDB) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) .
@if [ "$(IS_MAKE_BUILD)" = "true" ]; then \
docker build --pull -f Dockerfile_make.alpine --build-arg BACKREST_VERSION=$(TAG_GPDB) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) . ; \
else \
docker build --pull -f Dockerfile.alpine --build-arg BACKREST_VERSION=$(TAG_GPDB) --build-arg BACKREST_COMPLETION_VERSION=$(COMP_VERSION) --build-arg BACKREST_DOWNLOAD_URL=$(BACKREST_GPDB_DOWNLOAD_URL) -t pgbackrest:$(IMAGE_TAG) . ; \
fi
docker run pgbackrest:$(IMAGE_TAG)

.PHONY: test-e2e
Expand Down Expand Up @@ -139,8 +159,10 @@ endef
define version_compare
$(shell ( \
v1="$(1)"; v2="$(2)"; \
IFS='.' read -ra V1 <<< "$$v1"; \
IFS='.' read -ra V2 <<< "$$v2"; \
v1_clean=$$(echo "$$v1" | cut -d_ -f1); \
v2_clean=$$(echo "$$v2" | cut -d_ -f1); \
IFS='.' read -ra V1 <<< "$$v1_clean"; \
IFS='.' read -ra V2 <<< "$$v2_clean"; \
max_len=$$(( $${#V1[@]} > $${#V2[@]} ? $${#V1[@]} : $${#V2[@]} )); \
for (( i=0; i<max_len; i++ )); do \
v1_part=$${V1[i]:-0}; \
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ Supported pgBackRest version tags:

The repository also contains information for releases of pgBackRest fork with Greenplum support (see [pgbackrest/pull/1833](https://github.com/pgbackrest/pgbackrest/pull/1833)). Details - [build with Greenplum support](#build-with-greenplum-support).

The repository contains information for the last 3 releases of pgBackRest fork with Greenplum support. If necessary to use an older version - do a [manual build](#build).
The repository contains information for the last 2 releases of pgBackRest fork with Greenplum support. If necessary to use an older version - do a [manual build](#build).

Supported pgBackRest version tags with Greenplum support:
* `2.54-gpdb`
* `2.54-gpdb-alpine`
* `2.52-gpdb`
* `2.52-gpdb-alpine`
* `2.50-gpdb`
* `2.50-gpdb-alpine`
* `2.47-gpdb`
* `2.47-gpdb-alpine`

The image is based on the official ubuntu or alpine image. For ubuntu image each version of pgBackRest builds from the source code in a separate `builder` container. For alpine image each version of pgBackRest builds from the source code in container using virtual package `.backrest-build`.

Expand Down Expand Up @@ -255,7 +253,7 @@ docker build -f Dockerfile.alpine --build-arg BACKREST_VERSION=2.57.0 --build-ar

### Build pgBackRest < `v2.51`

Since version `v2.51`, the build system for pgBackRest is `meson`. The `autoconf/make` build will not receive any new features and will be removed in future. If you need to build pgBackRest lower than `v2.51`, use the files [Dockerfile_make](./Dockerfile) or [Dockerfile_make.alpine](./Dockerfile_make.alpine).
Since version `v2.51`, the build system for pgBackRest is `meson`. The `autoconf/make` build will not receive any new features and will be removed in future. If you need to build pgBackRest lower than `v2.51`, use the files [Dockerfile_make](./Dockerfile_make) or [Dockerfile_make.alpine](./Dockerfile_make.alpine).

```bash
make build_version TAG=2.49
Expand Down Expand Up @@ -308,9 +306,13 @@ docker pull ghcr.io/woblerr/pgbackrest:tag-gpdb-alpine
### Run

```bash
docker run --rm pgbackrest:2.52-gpdb pgbackrest help
docker run --rm pgbackrest:2.54-gpdb pgbackrest help
```

### Build pgBackRest < `v2.51` with Greenplum support

If you need to build pgBackRest with Greenplum support lower than `v2.51`, use the files [Dockerfile_make](./Dockerfile_make) or [Dockerfile_make.alpine](./Dockerfile_make.alpine).

## Running tests

Run the end-to-end tests:
Expand Down