mirror of
https://git.koehn.com/docker/postgres-wal-g.git
synced 2026-11-27 09:43:20 -06:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28b4645545 | ||
|
|
b89fdb75cb |
No files matched your search
@@ -1,65 +0,0 @@
|
|||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Get Postgres and WAL-G versions
|
|
||||||
env:
|
|
||||||
TAG: ${{ gitea.ref_name }}
|
|
||||||
id: versions
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=postgres::${TAG:0:4}"
|
|
||||||
echo "::set-output name=walg::${TAG:5:6}"
|
|
||||||
|
|
||||||
- name: Setup deployment key
|
|
||||||
id: ssh
|
|
||||||
env:
|
|
||||||
KEY: ${{ secrets.SSH_KEY }}
|
|
||||||
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }}
|
|
||||||
run: |
|
|
||||||
mkdir "$HOME/.ssh"
|
|
||||||
chmod 700 "$HOME/.ssh"
|
|
||||||
echo "$KEY" > "$HOME/.ssh/id_rsa"
|
|
||||||
chmod 600 "$HOME/.ssh/id_rsa"
|
|
||||||
eval "$(ssh-agent -s)"
|
|
||||||
ssh-add "$HOME/.ssh/id_rsa"
|
|
||||||
echo "::set-output name=ssd-path::$HOME/.ssh"
|
|
||||||
echo "::set-output name=ssh-agent-pid::$SSH_AGENT_PID"
|
|
||||||
echo "::set-output name=ssh-auth-sock::$SSH_AUTH_SOCK"
|
|
||||||
ssh -o StrictHostKeyChecking=no -l root -- k3s-sd-03.koehn.com docker version
|
|
||||||
|
|
||||||
- name: Install Docker
|
|
||||||
run: curl -fsSL https://get.docker.com | sh
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
append: |
|
|
||||||
- endpoint: ssh://root@k3s-sd-03.koehn.com
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.koehn.com
|
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
needs: [versions, ssh]
|
|
||||||
with:
|
|
||||||
build-args: |
|
|
||||||
BASE=${{ steps.versions.outputs.postgres }}
|
|
||||||
WAL_G=${{ steps.versions.outputs.walg }}
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: git.koehn.com/docker/postgres-wal-g:${{ steps.versions.outputs.postgres }}-${{ steps.versions.outputs.walg }}
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
stages:
|
||||||
|
- build
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
timeout: 3h
|
||||||
|
image:
|
||||||
|
name: moby/buildkit:latest
|
||||||
|
entrypoint: [""]
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
mkdir /root/.docker
|
||||||
|
cat > /root/.docker/config.json <<EOF
|
||||||
|
{
|
||||||
|
"auths": {
|
||||||
|
"https://index.docker.io/v1/": {
|
||||||
|
"auth":"${DOCKER_AUTH}"
|
||||||
|
},
|
||||||
|
"${CI_REGISTRY}": {
|
||||||
|
"username": "${CI_REGISTRY_USER}",
|
||||||
|
"password": "${CI_REGISTRY_PASSWORD}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
- buildctl-daemonless.sh build --frontend=dockerfile.v0 --local context=$CI_PROJECT_DIR --local dockerfile=$CI_PROJECT_DIR --output type=image,name=docker.io/koehn/postgres-wal-g:14.2-$CI_COMMIT_TAG,push=true --opt build-arg:BASE=14.2 --opt build-arg:WALG_RELEASE=$(echo $CI_COMMIT_TAG | awk -F '-' '{print $1}') --opt platform=linux/amd64
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
pipeline:
|
||||||
|
build-image:
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
branch: master
|
||||||
|
secrets: [ docker_username, docker_password ]
|
||||||
|
settings:
|
||||||
|
repo: koehn/postgres-wal-g
|
||||||
|
platforms: linux/amd64
|
||||||
|
mtu: 1300
|
||||||
|
build_args:
|
||||||
|
- BASE=${CI_COMMIT_TAG:0:3}
|
||||||
|
- WALG_RELEASE=${CI_COMMIT_TAG:4:10}
|
||||||
|
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
ARG BASE=latest
|
ARG BASE
|
||||||
|
|
||||||
FROM golang:1 as build
|
FROM golang:1 as build
|
||||||
|
|
||||||
ARG WALG_RELEASE=master
|
ARG WALG_RELEASE=v1.1
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -qqy --no-install-recommends --no-install-suggests cmake liblzo2-dev libsodium23 libsodium-dev && \
|
RUN apt-get update && apt-get install -qqy --no-install-recommends --no-install-suggests cmake liblzo2-dev libsodium23 libsodium-dev && \
|
||||||
cd /go/src/ && \
|
cd /go/src/ && \
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
[](https://woodpecker.koehn.com/docker/postgres-wal-g)
|
||||||
|
|
||||||
# Postgres WAL-G
|
# Postgres WAL-G
|
||||||
|
|
||||||
This image extends the stock [Postgres Image](https://hub.docker.com/_/postgres/)
|
This image extends the stock [Postgres Image](https://hub.docker.com/_/postgres/)
|
||||||
@@ -29,7 +31,7 @@ To run a full backup, simply run `/wal-g/backup.sh`.
|
|||||||
## Continuous Backups
|
## Continuous Backups
|
||||||
These will happen automatically once you've started Postgres with your edited
|
These will happen automatically once you've started Postgres with your edited
|
||||||
`postgresql.conf` file (see
|
`postgresql.conf` file (see
|
||||||
[Configuration](#configuration), above).
|
[Configuration](https://gitlab.koehn.com/docker/postgres-wal-g#configuration), above).
|
||||||
|
|
||||||
## Recovery
|
## Recovery
|
||||||
Testing recovery is simple: run a new Docker container with the correct
|
Testing recovery is simple: run a new Docker container with the correct
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ IMAGE_NAME=koehn/postgres-wal-g
|
|||||||
build_image() {
|
build_image() {
|
||||||
BASE=$1
|
BASE=$1
|
||||||
IMAGE=$IMAGE_NAME:$BASE-$WALG_VERSION
|
IMAGE=$IMAGE_NAME:$BASE-$WALG_VERSION
|
||||||
docker buildx build -t $IMAGE --push . --build-arg BASE=$PG_VERSION --build-arg WALG_RELEASE=$WALG_VERSION --ulimit memlock=16384:16384 --platform linux/amd64,linux/arm64 --builder multiarch
|
docker buildx build --builder k3s-sd -t $IMAGE --push . --build-arg BASE=$PG_VERSION --build-arg WALG_RELEASE=$WALG_VERSION --ulimit memlock=16384:16384
|
||||||
}
|
}
|
||||||
|
|
||||||
build_image "$PG_VERSION" "$WALG_VERSION"
|
build_image "$PG_VERSION" "$WALG_VERSION"
|
||||||
|
|||||||
Reference in new issue
Block a user