Skip to content
Open
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
97 changes: 50 additions & 47 deletions .github/workflows/publish_ghcr_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ env:

on:
push:
branches:
- 's3_comp'
tags:
- '*'
workflow_dispatch:

jobs:
publish:
Expand All @@ -25,26 +28,26 @@ jobs:
with:
go-version: "^1.25.3"

- name: Run unit tests
run: make test

- name: Define image name
id: image
run: |
OPERATOR_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//}"
echo "OPERATOR_IMAGE=$OPERATOR_IMAGE" >> $GITHUB_OUTPUT

- name: Define pooler image name
id: image_pooler
run: |
POOLER_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/pgbouncer:${GITHUB_REF/refs\/tags\//}"
echo "POOLER_IMAGE=$POOLER_IMAGE" >> $GITHUB_OUTPUT

- name: Define UI image name
id: image_ui
run: |
UI_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME_UI }}:${GITHUB_REF/refs\/tags\//}"
echo "UI_IMAGE=$UI_IMAGE" >> $GITHUB_OUTPUT
# - name: Run unit tests
# run: make test
#
# - name: Define image name
# id: image
# run: |
# OPERATOR_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//}"
# echo "OPERATOR_IMAGE=$OPERATOR_IMAGE" >> $GITHUB_OUTPUT
#
# - name: Define pooler image name
# id: image_pooler
# run: |
# POOLER_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/pgbouncer:${GITHUB_REF/refs\/tags\//}"
# echo "POOLER_IMAGE=$POOLER_IMAGE" >> $GITHUB_OUTPUT
#
# - name: Define UI image name
# id: image_ui
# run: |
# UI_IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME_UI }}:${GITHUB_REF/refs\/tags\//}"
# echo "UI_IMAGE=$UI_IMAGE" >> $GITHUB_OUTPUT

- name: Define logical backup image name
id: image_lb
Expand All @@ -65,33 +68,33 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push multiarch operator image to ghcr
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
push: true
build-args: BASE_IMAGE=alpine:3
tags: "${{ steps.image.outputs.OPERATOR_IMAGE }}"
platforms: linux/amd64,linux/arm64

- name: Build and push multiarch pooler image to ghcr
uses: docker/build-push-action@v3
with:
context: pooler
push: true
build-args: BASE_IMAGE=alpine:3.22
tags: "${{ steps.image_pooler.outputs.POOLER_IMAGE }}"
platforms: linux/amd64,linux/arm64

- name: Build and push multiarch ui image to ghcr
uses: docker/build-push-action@v3
with:
context: ui
push: true
build-args: BASE_IMAGE=python:3.11-slim
tags: "${{ steps.image_ui.outputs.UI_IMAGE }}"
platforms: linux/amd64,linux/arm64
# - name: Build and push multiarch operator image to ghcr
# uses: docker/build-push-action@v3
# with:
# context: .
# file: docker/Dockerfile
# push: true
# build-args: BASE_IMAGE=alpine:3
# tags: "${{ steps.image.outputs.OPERATOR_IMAGE }}"
# platforms: linux/amd64,linux/arm64
#
# - name: Build and push multiarch pooler image to ghcr
# uses: docker/build-push-action@v3
# with:
# context: pooler
# push: true
# build-args: BASE_IMAGE=alpine:3.22
# tags: "${{ steps.image_pooler.outputs.POOLER_IMAGE }}"
# platforms: linux/amd64,linux/arm64
#
# - name: Build and push multiarch ui image to ghcr
# uses: docker/build-push-action@v3
# with:
# context: ui
# push: true
# build-args: BASE_IMAGE=python:3.11-slim
# tags: "${{ steps.image_ui.outputs.UI_IMAGE }}"
# platforms: linux/amd64,linux/arm64

- name: Build and push multiarch logical-backup image to ghcr
uses: docker/build-push-action@v3
Expand Down
File renamed without changes.
17 changes: 16 additions & 1 deletion logical-backup/dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ function az_upload {
az storage blob upload --file "$1" --account-name "$LOGICAL_BACKUP_AZURE_STORAGE_ACCOUNT_NAME" --account-key "$LOGICAL_BACKUP_AZURE_STORAGE_ACCOUNT_KEY" -c "$LOGICAL_BACKUP_AZURE_STORAGE_CONTAINER" -n "$PATH_TO_BACKUP"
}

function aws_init_profile {

if [[ ! -z "$AWS_PROFILE_CONTENT" ]] ; then
mkdir -p $HOME/.aws
echo "$AWS_PROFILE_CONTENT" > $HOME/.aws/config
fi
}

function aws_delete_objects {
args=(
"--bucket=$LOGICAL_BACKUP_S3_BUCKET"
Expand Down Expand Up @@ -111,8 +119,14 @@ function aws_upload {

args=()

if [[ ! -z "$LOGICAL_BACKUP_S3_ACCELERATE_ENDPOINT" ]] ; then
# use accelerate_endpoint on upload
args+=("--endpoint-url=$LOGICAL_BACKUP_S3_ACCELERATE_ENDPOINT")
elif [[ ! -z "$LOGICAL_BACKUP_S3_ENDPOINT" ]]; then
args+=("--endpoint-url=$LOGICAL_BACKUP_S3_ENDPOINT")
fi

[[ ! -z "$EXPECTED_SIZE" ]] && args+=("--expected-size=$EXPECTED_SIZE")
[[ ! -z "$LOGICAL_BACKUP_S3_ENDPOINT" ]] && args+=("--endpoint-url=$LOGICAL_BACKUP_S3_ENDPOINT")
[[ ! -z "$LOGICAL_BACKUP_S3_REGION" ]] && args+=("--region=$LOGICAL_BACKUP_S3_REGION")
[[ ! -z "$LOGICAL_BACKUP_S3_SSE" ]] && args+=("--sse=$LOGICAL_BACKUP_S3_SSE")

Expand Down Expand Up @@ -145,6 +159,7 @@ function upload {
gcs_upload
;;
"s3")
aws_init_profile
aws_upload $(($(estimate_size) / DUMP_SIZE_COEFF))
aws_delete_outdated
;;
Expand Down