Skip to content

Commit

Permalink
Merge pull request #3 from woblerr/backrest_2.34
Browse files Browse the repository at this point in the history
Add pgBackRest v2.34
  • Loading branch information
woblerr authored Jun 22, 2021
2 parents c9856f9 + 344e4a2 commit 3235153
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 56 deletions.
89 changes: 45 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pgbackrest_version: ["2.29", "2.30", "2.31", "2.32", "2.33"]
pgbackrest_version: ["2.30", "2.31", "2.32", "2.33", "2.34"]
env:
latest_version: "2.33"
latest_version: "2.34"
pgbackrest_completion_version: "v0.3"
steps:
- uses: actions/checkout@v2
Expand All @@ -35,58 +35,59 @@ jobs:
env:
TAG: ${{ matrix.pgbackrest_version }}

- name: Push pgbackrest images to Docker Hub
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
docker login -u ${DOCKERHUBUSER} -p ${DOCKERHUBPKG}
docker tag pgbackrest:${TAG} docker.io/woblerr/pgbackrest:${TAG}
docker push docker.io/woblerr/pgbackrest:${TAG}
docker tag pgbackrest:${TAG} docker.io/woblerr/pgbackrest:${TAG}-${REPO_TAG}
docker push docker.io/woblerr/pgbackrest:${TAG}-${REPO_TAG}
docker logout
env:
TAG: ${{ matrix.pgbackrest_version }}
DOCKERHUBUSER: ${{ secrets.DOCKEHUB_USER }}
DOCKERHUBPKG: ${{ secrets.DOCKEHUB_TOKEN }}
REPO_TAG: ${{ steps.vars.outputs.repo_tag }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Push pgbackrest image to Docker Hub with tag 'latest'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && matrix.pgbackrest_version == env.latest_version
run: |
docker login -u ${DOCKERHUBUSER} -p ${DOCKERHUBPKG}
docker tag pgbackrest:${TAG} docker.io/woblerr/pgbackrest:latest
docker push docker.io/woblerr/pgbackrest:latest
docker logout
env:
TAG: ${{ matrix.pgbackrest_version }}
DOCKERHUBUSER: ${{ secrets.DOCKEHUB_USER }}
DOCKERHUBPKG: ${{ secrets.DOCKEHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Push pgbackrest images to GitHub Registry
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Build and push tag image to ghcr.io and Docker Hub
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
echo ${GITHUBPKG} | docker login ghcr.io -u ${GITHUBUSER} --password-stdin
docker tag pgbackrest:${TAG} ghcr.io/woblerr/pgbackrest:${TAG}
docker push ghcr.io/woblerr/pgbackrest:${TAG}
docker tag pgbackrest:${TAG} ghcr.io/woblerr/pgbackrest:${TAG}-${REPO_TAG}
docker push ghcr.io/woblerr/pgbackrest:${TAG}-${REPO_TAG}
docker logout
echo ${GITHUB_PKG} | docker login ghcr.io -u ${GITHUB_USER} --password-stdin
echo ${DOCKERHUB_PKG} | docker login -u ${DOCKERHUB_USER} --password-stdin
docker buildx build --push \
-f Dockerfile \
--platform linux/amd64,linux/arm64
--build-arg BACKREST_VERSION=${TAG} \
--build-arg REPO_BUILD_TAG=${REPO_TAG} \
--build-arg BACKREST_COMPLETION_VERSION=${COMPL_TAG} \
-t ghcr.io/${GITHUB_USER}/pgbackrest:${TAG} \
-t ghcr.io/${GITHUB_USER}/pgbackrest:${TAG}-${REPO_TAG} \
-t ${DOCKERHUB_USER}/pgbackrest:${TAG} \
-t ${DOCKERHUB_USER}/pgbackrest:${TAG}-${REPO_TAG} .
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_PKG: ${{ secrets.GUTHUB_CR_PAT }}
DOCKERHUB_USER: ${{ secrets.DOCKEHUB_USER }}
DOCKERHUB_PKG: ${{ secrets.DOCKEHUB_TOKEN }}
TAG: ${{ matrix.pgbackrest_version }}
GITHUBUSER: ${{ github.actor }}
GITHUBPKG: ${{ secrets.GUTHUB_CR_PAT }}
REPO_TAG: ${{ steps.vars.outputs.repo_tag }}
COMPL_TAG: ${{ env.pgbackrest_completion_version }}

- name: Push pgbackrest image to GitHub Registry with tag 'latest'

- name: Build and push tag (latest) image to ghcr.io and Docker Hub
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && matrix.pgbackrest_version == env.latest_version
run: |
echo ${GITHUBPKG} | docker login ghcr.io -u ${GITHUBUSER} --password-stdin
docker tag pgbackrest:${TAG} ghcr.io/woblerr/pgbackrest:latest
docker push ghcr.io/woblerr/pgbackrest:latest
docker logout
echo ${GITHUB_PKG} | docker login ghcr.io -u ${GITHUB_USER} --password-stdin
echo ${DOCKERHUB_PKG} | docker login -u ${DOCKERHUB_USER} --password-stdin
docker buildx build --push \
-f Dockerfile \
--platform linux/amd64,linux/arm64
--build-arg BACKREST_VERSION=${TAG} \
--build-arg REPO_BUILD_TAG=${REPO_TAG} \
--build-arg BACKREST_COMPLETION_VERSION=${COMPL_TAG} \
-t ghcr.io/${GITHUB_USER}/pgbackrest:latest \
-t ${DOCKERHUB_USER}/pgbackrest:latest .
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_PKG: ${{ secrets.GUTHUB_CR_PAT }}
DOCKERHUB_USER: ${{ secrets.DOCKEHUB_USER }}
DOCKERHUB_PKG: ${{ secrets.DOCKEHUB_TOKEN }}
TAG: ${{ matrix.pgbackrest_version }}
GITHUBUSER: ${{ github.actor }}
GITHUBPKG: ${{ secrets.GUTHUB_CR_PAT }}
REPO_TAG: ${{ steps.vars.outputs.repo_tag }}

COMPL_TAG: ${{ env.pgbackrest_completion_version }}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BACKREST_VERSIONS = 2.29 2.30 2.31 2.32 2.33
TAG?=2.33
BACKREST_VERSIONS = 2.30 2.31 2.32 2.33 2.34
TAG?=2.34
BACKREST_COMP_VERSION?=v0.3

all: $(BACKREST_VERSIONS)
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

[pgBackRest](https://pgbackrest.org/) inside Docker can be useful when you using [Dedicated Repository Host](https://pgbackrest.org/user-guide.html#repo-host) or inside CI/CD systems.

Supported pgBackRest version tags:
Supported pgBackRest version tags (last 5 releases):

* `2.33`, `latest`
* `2.34`, `latest`
* `2.33`
* `2.32`
* `2.31`
* `2.30`
* `2.29`

The image is based on the official ubuntu image. Each version of pgBackRest builds from the source code in a separate `builder` container.

Expand Down Expand Up @@ -47,16 +47,16 @@ You will need to mount the necessary directories or files inside the container (
### Simple

```bash
docker run --rm pgbackrest:2.33 pgbackrest help
docker run --rm pgbackrest:2.34 pgbackrest help
```

### Injecting inside

```bash
docker run --rm -it pgbackrest:2.33 bash
docker run --rm -it pgbackrest:2.34 bash

pgbackrest@cac1f58b56f2:/$ pgbackrest version
pgBackRest 2.33
pgBackRest 2.34
```

### Example for Dedicated Repository Host
Expand All @@ -70,7 +70,7 @@ docker run --rm \
-v ~/.ssh/id_rsa:/home/pgbackrest/.ssh/id_rsa \
-v /etc/pgbackrest:/etc/pgbackrest \
-v /var/lib/pgbackrest:/var/lib/pgbackrest \
pgbackrest:2.33 \
pgbackrest:2.34 \
pgbackrest backup --stanza demo --type full --log-level-console info
```

Expand Down Expand Up @@ -102,18 +102,18 @@ docker run --rm \
-v /var/lib/postgresql/12/main:/var/lib/postgresql/12/main \
-v /var/lib/pgbackrest:/var/lib/pgbackrest \
-v /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432 \
pgbackrest:2.33 \
pgbackrest:2.34 \
pgbackrest backup --stanza demo --type full --log-level-console info
```

## Build

```bash
make build_version TAG=2.33
make build_version TAG=2.34
```

or

```bash
docker build -f Dockerfile --build-arg BACKREST_VERSION=2.33 --build-arg BACKREST_COMPLETION_VERSION=v0.3 -t pgbackrest:2.33 .
docker build -f Dockerfile --build-arg BACKREST_VERSION=2.34 --build-arg BACKREST_COMPLETION_VERSION=v0.3 -t pgbackrest:2.34 .
```

0 comments on commit 3235153

Please sign in to comment.