mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Turns out that the standard `pgoutput` plugin shipped with Postgres will do everything we need it to, and there are good examples of prior art decoding its binary output in Elixir (in production). So to avoid adding a dependency on `wal2json` here, we'll go with that.
This commit is contained in:
6
.github/workflows/_elixir.yml
vendored
6
.github/workflows/_elixir.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
services:
|
||||
postgres:
|
||||
image: us-east1-docker.pkg.dev/firezone-staging/firezone/postgres:15
|
||||
image: postgres:15
|
||||
ports:
|
||||
- 5432:5432
|
||||
env:
|
||||
@@ -131,7 +131,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
services:
|
||||
postgres:
|
||||
image: us-east1-docker.pkg.dev/firezone-staging/firezone/postgres:15
|
||||
image: postgres:15
|
||||
ports:
|
||||
- 5432:5432
|
||||
env:
|
||||
@@ -185,7 +185,7 @@ jobs:
|
||||
MIX_TEST_PARTITION: [1]
|
||||
services:
|
||||
postgres:
|
||||
image: us-east1-docker.pkg.dev/firezone-staging/firezone/postgres:15
|
||||
image: postgres:15
|
||||
ports:
|
||||
- 5432:5432
|
||||
env:
|
||||
|
||||
36
.github/workflows/build-postgres.yml
vendored
36
.github/workflows/build-postgres.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Build Postgres
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
||||
- uses: ./.github/actions/gcp-docker-login
|
||||
id: login
|
||||
with:
|
||||
project: firezone-staging
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
|
||||
with:
|
||||
context: elixir
|
||||
file: elixir/Dockerfile.postgres-dev
|
||||
platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
${{ steps.login.outputs.registry }}/firezone/postgres:latest
|
||||
${{ steps.login.outputs.registry }}/firezone/postgres:${{ github.sha }}
|
||||
${{ steps.login.outputs.registry }}/firezone/postgres:15
|
||||
@@ -2,8 +2,7 @@ services:
|
||||
# Dependencies
|
||||
postgres:
|
||||
# TODO: Enable pgaudit on dev instance. See https://github.com/pgaudit/pgaudit/issues/44#issuecomment-455090262
|
||||
# Includes wal2json
|
||||
image: us-east1-docker.pkg.dev/firezone-staging/firezone/postgres:15
|
||||
image: postgres:15
|
||||
command: ["postgres", "-c", "wal_level=logical"]
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# Builds a Postgres image with needed extensions and modules for local development
|
||||
|
||||
# Install wal2json
|
||||
ARG POSTGRES_VERSION=15
|
||||
FROM postgres:${POSTGRES_VERSION}-alpine AS builder
|
||||
RUN apk add --no-cache \
|
||||
build-base \
|
||||
git \
|
||||
llvm \
|
||||
clang \
|
||||
curl
|
||||
ARG WAL2JSON_VERSION=2_6
|
||||
RUN curl -fssL https://github.com/eulerto/wal2json/archive/refs/tags/wal2json_${WAL2JSON_VERSION}.tar.gz | tar -xzf - -C /tmp --strip-components=1
|
||||
WORKDIR /tmp
|
||||
RUN USE_PGXS=1 make && make install
|
||||
|
||||
# Prepare final image
|
||||
FROM postgres:${POSTGRES_VERSION}-alpine
|
||||
COPY --from=builder /tmp/wal2json.so /usr/local/lib/postgresql/
|
||||
Reference in New Issue
Block a user