From 63b6b929d76b44aecfd2a1e8ced4026aa3572142 Mon Sep 17 00:00:00 2001 From: aramdata Date: Mon, 6 Feb 2023 17:39:49 +0330 Subject: [PATCH 1/7] update base dockerfile , add env for multiple db names --- .dir-locals.el | 8 +- .dockerignore | 4 +- .github/workflows/build-and-push-images.yml | 92 +++++------ .gitignore | 2 +- Dockerfile | 61 ++++---- LICENSE.txt | 42 ++--- README.md | 164 ++++++++++---------- docker-compose.yaml | 56 +++---- src/backup.sh | 96 +++++++----- src/env.sh | 4 +- template.env | 8 +- 11 files changed, 274 insertions(+), 263 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 3b14d0c..5978186 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,4 +1,4 @@ -;;; Directory Local Variables -;;; For more information see (info "(emacs) Directory Variables") - -((sh-mode . ((sh-basic-offset . 2)))) +;;; Directory Local Variables +;;; For more information see (info "(emacs) Directory Variables") + +((sh-mode . ((sh-basic-offset . 2)))) diff --git a/.dockerignore b/.dockerignore index dbce115..505bf47 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,2 @@ -* -!src/* +* +!src/* diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index 90d1101..9c8ba45 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -1,46 +1,46 @@ -name: build and push images - -on: - push: - branches: ['master'] - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - - strategy: - matrix: - include: - - { postgres: 11, alpine: '3.10' } - - { postgres: 12, alpine: '3.12' } - - { postgres: 13, alpine: '3.14' } - - { postgres: 14, alpine: '3.16' } - - { postgres: 15, alpine: '3.17' } - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Log in to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: ${{ github.repository }}:${{ matrix.postgres }} - build-args: | - ALPINE_VERSION=${{ matrix.alpine }} - platforms: | - linux/amd64 - linux/arm64 +name: build and push images + +on: + push: + branches: ['master'] + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - { postgres: 11, alpine: '3.10' } + - { postgres: 12, alpine: '3.12' } + - { postgres: 13, alpine: '3.14' } + - { postgres: 14, alpine: '3.16' } + - { postgres: 15, alpine: '3.17' } + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log in to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ github.repository }}:${{ matrix.postgres }} + build-args: | + ALPINE_VERSION=${{ matrix.alpine }} + platforms: | + linux/amd64 + linux/arm64 diff --git a/.gitignore b/.gitignore index 3bf780b..4c5a937 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -.idea +.idea .env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 16915d7..d443697 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,31 @@ -ARG ALPINE_VERSION -FROM alpine:${ALPINE_VERSION} -ARG TARGETARCH - -ADD src/install.sh install.sh -RUN sh install.sh && rm install.sh - -ENV POSTGRES_DATABASE '' -ENV POSTGRES_HOST '' -ENV POSTGRES_PORT 5432 -ENV POSTGRES_USER '' -ENV POSTGRES_PASSWORD '' -ENV PGDUMP_EXTRA_OPTS '' -ENV S3_ACCESS_KEY_ID '' -ENV S3_SECRET_ACCESS_KEY '' -ENV S3_BUCKET '' -ENV S3_REGION 'us-west-1' -ENV S3_PATH 'backup' -ENV S3_ENDPOINT '' -ENV S3_S3V4 'no' -ENV SCHEDULE '' -ENV PASSPHRASE '' -ENV BACKUP_KEEP_DAYS '' - -ADD src/run.sh run.sh -ADD src/env.sh env.sh -ADD src/backup.sh backup.sh -ADD src/restore.sh restore.sh - -CMD ["sh", "run.sh"] +ARG ALPINE_VERSION=3.17 +FROM alpine:${ALPINE_VERSION} +ARG TARGETARCH + +ADD src/install.sh install.sh +RUN sh install.sh && rm install.sh + +ENV POSTGRES_DATABASES '' +ENV POSTGRES_HOST '' +ENV POSTGRES_PORT 5432 +ENV POSTGRES_USER '' +ENV POSTGRES_PASSWORD '' +ENV PGDUMP_EXTRA_OPTS '' +ENV S3_ACCESS_KEY_ID '' +ENV S3_SECRET_ACCESS_KEY '' +ENV S3_BUCKET '' +ENV S3_REGION 'us-west-1' +ENV S3_PATH 'backup' +ENV S3_ENDPOINT '' +ENV S3_S3V4 'no' +ENV SCHEDULE '' +ENV PASSPHRASE '' +ENV BACKUP_KEEP_DAYS '' +ENV WEBHOOK_URL '' + +ADD src/run.sh run.sh +ADD src/env.sh env.sh +ADD src/backup.sh backup.sh +ADD src/restore.sh restore.sh + +CMD ["sh", "run.sh"] diff --git a/LICENSE.txt b/LICENSE.txt index d1988db..6367391 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2017 Johannes Schickling - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2017 Johannes Schickling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 0164acf..13803c4 100644 --- a/README.md +++ b/README.md @@ -1,82 +1,82 @@ -# Introduction -This project provides Docker images to periodically back up a PostgreSQL database to AWS S3, and to restore from the backup as needed. - -# Usage -## Backup -```yaml -services: - postgres: - image: postgres:13 - environment: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - - backup: - image: eeshugerman/postgres-backup-s3:15 - environment: - SCHEDULE: '@weekly' # optional - BACKUP_KEEP_DAYS: 7 # optional - PASSPHRASE: passphrase # optional - S3_REGION: region - S3_ACCESS_KEY_ID: key - S3_SECRET_ACCESS_KEY: secret - S3_BUCKET: my-bucket - S3_PREFIX: backup - POSTGRES_HOST: postgres - POSTGRES_DATABASE: dbname - POSTGRES_USER: user - POSTGRES_PASSWORD: password -``` - -- Images are tagged by the major PostgreSQL version supported: `11`, `12`, `13`, `14`, or `15`. -- The `SCHEDULE` variable determines backup frequency. See go-cron schedules documentation [here](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules). Omit to run the backup immediately and then exit. -- If `PASSPHRASE` is provided, the backup will be encrypted using GPG. -- Run `docker exec sh backup.sh` to trigger a backup ad-hoc. -- If `BACKUP_KEEP_DAYS` is set, backups older than this many days will be deleted from S3. -- Set `S3_ENDPOINT` if you're using a non-AWS S3-compatible storage provider. - -## Restore -> **WARNING:** DATA LOSS! All database objects will be dropped and re-created. -### ... from latest backup -```sh -docker exec sh restore.sh -``` -> **NOTE:** If your bucket has more than a 1000 files, the latest may not be restored -- only one S3 `ls` command is used -### ... from specific backup -```sh -docker exec sh restore.sh -``` - -# Development -## Build the image locally -`ALPINE_VERSION` determines Postgres version compatibility. See [`build-and-push-images.yml`](.github/workflows/build-and-push-images.yml) for the latest mapping. -```sh -DOCKER_BUILDKIT=1 docker build --build-arg ALPINE_VERSION=3.14 . -``` -## Run a simple test environment with Docker Compose -```sh -cp template.env .env -# fill out your secrets/params in .env -docker compose up -d -``` - -# Acknowledgements -This project is a fork and re-structuring of @schickling's [postgres-backup-s3](https://github.com/schickling/dockerfiles/tree/master/postgres-backup-s3) and [postgres-restore-s3](https://github.com/schickling/dockerfiles/tree/master/postgres-restore-s3). - -## Fork goals -These changes would have been difficult or impossible merge into @schickling's repo or similarly-structured forks. - - dedicated repository - - automated builds - - support multiple PostgreSQL versions - - backup and restore with one image - -## Other changes and features - - some environment variables renamed or removed - - uses `pg_dump`'s `custom` format (see [docs](https://www.postgresql.org/docs/10/app-pgdump.html)) - - drop and re-create all database objects on restore - - backup blobs and all schemas by default - - no Python 2 dependencies - - filter backups on S3 by database name - - support encrypted (password-protected) backups - - support for restoring from a specific backup by timestamp - - support for auto-removal of old backups +# Introduction +This project provides Docker images to periodically back up a PostgreSQL database to AWS S3, and to restore from the backup as needed. + +# Usage +## Backup +```yaml +services: + postgres: + image: postgres:13 + environment: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + + backup: + image: eeshugerman/postgres-backup-s3:15 + environment: + SCHEDULE: '@weekly' # optional + BACKUP_KEEP_DAYS: 7 # optional + PASSPHRASE: passphrase # optional + S3_REGION: region + S3_ACCESS_KEY_ID: key + S3_SECRET_ACCESS_KEY: secret + S3_BUCKET: my-bucket + S3_PREFIX: backup + POSTGRES_HOST: postgres + POSTGRES_DATABASE: dbname + POSTGRES_USER: user + POSTGRES_PASSWORD: password +``` + +- Images are tagged by the major PostgreSQL version supported: `11`, `12`, `13`, `14`, or `15`. +- The `SCHEDULE` variable determines backup frequency. See go-cron schedules documentation [here](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules). Omit to run the backup immediately and then exit. +- If `PASSPHRASE` is provided, the backup will be encrypted using GPG. +- Run `docker exec sh backup.sh` to trigger a backup ad-hoc. +- If `BACKUP_KEEP_DAYS` is set, backups older than this many days will be deleted from S3. +- Set `S3_ENDPOINT` if you're using a non-AWS S3-compatible storage provider. + +## Restore +> **WARNING:** DATA LOSS! All database objects will be dropped and re-created. +### ... from latest backup +```sh +docker exec sh restore.sh +``` +> **NOTE:** If your bucket has more than a 1000 files, the latest may not be restored -- only one S3 `ls` command is used +### ... from specific backup +```sh +docker exec sh restore.sh +``` + +# Development +## Build the image locally +`ALPINE_VERSION` determines Postgres version compatibility. See [`build-and-push-images.yml`](.github/workflows/build-and-push-images.yml) for the latest mapping. +```sh +DOCKER_BUILDKIT=1 docker build --build-arg ALPINE_VERSION=3.14 . +``` +## Run a simple test environment with Docker Compose +```sh +cp template.env .env +# fill out your secrets/params in .env +docker compose up -d +``` + +# Acknowledgements +This project is a fork and re-structuring of @schickling's [postgres-backup-s3](https://github.com/schickling/dockerfiles/tree/master/postgres-backup-s3) and [postgres-restore-s3](https://github.com/schickling/dockerfiles/tree/master/postgres-restore-s3). + +## Fork goals +These changes would have been difficult or impossible merge into @schickling's repo or similarly-structured forks. + - dedicated repository + - automated builds + - support multiple PostgreSQL versions + - backup and restore with one image + +## Other changes and features + - some environment variables renamed or removed + - uses `pg_dump`'s `custom` format (see [docs](https://www.postgresql.org/docs/10/app-pgdump.html)) + - drop and re-create all database objects on restore + - backup blobs and all schemas by default + - no Python 2 dependencies + - filter backups on S3 by database name + - support encrypted (password-protected) backups + - support for restoring from a specific backup by timestamp + - support for auto-removal of old backups diff --git a/docker-compose.yaml b/docker-compose.yaml index 16ac481..f8aaa3b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,28 +1,28 @@ -# this file is here to facilitate development/testing -# $ docker compose up -d --build --force-recreate - -services: - postgres: - image: postgres:14 - environment: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - - backup: - build: - context: . - args: - ALPINE_VERSION: '3.16' - environment: - SCHEDULE: '@weekly' # optional - BACKUP_KEEP_DAYS: 7 # optional - PASSPHRASE: passphrase # optional - S3_REGION: - S3_ACCESS_KEY_ID: - S3_SECRET_ACCESS_KEY: - S3_BUCKET: - S3_PREFIX: backup - POSTGRES_HOST: postgres - POSTGRES_DATABASE: postgres - POSTGRES_USER: user - POSTGRES_PASSWORD: password +# this file is here to facilitate development/testing +# $ docker compose up -d --build --force-recreate + +services: + postgres: + image: postgres:14 + environment: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + + backup: + build: + context: . + args: + ALPINE_VERSION: '3.16' + environment: + SCHEDULE: '@weekly' # optional + BACKUP_KEEP_DAYS: 7 # optional + PASSPHRASE: passphrase # optional + S3_REGION: + S3_ACCESS_KEY_ID: + S3_SECRET_ACCESS_KEY: + S3_BUCKET: + S3_PREFIX: backup + POSTGRES_HOST: postgres + POSTGRES_DATABASE: postgres + POSTGRES_USER: user + POSTGRES_PASSWORD: password diff --git a/src/backup.sh b/src/backup.sh index 294a9aa..4fdfc6a 100644 --- a/src/backup.sh +++ b/src/backup.sh @@ -5,46 +5,56 @@ set -o pipefail source ./env.sh -echo "Creating backup of $POSTGRES_DATABASE database..." -pg_dump --format=custom \ - -h $POSTGRES_HOST \ - -p $POSTGRES_PORT \ - -U $POSTGRES_USER \ - -d $POSTGRES_DATABASE \ - $PGDUMP_EXTRA_OPTS \ - > db.dump - -timestamp=$(date +"%Y-%m-%dT%H:%M:%S") -s3_uri_base="s3://${S3_BUCKET}/${S3_PREFIX}/${POSTGRES_DATABASE}_${timestamp}.dump" - -if [ -n "$PASSPHRASE" ]; then - echo "Encrypting backup..." - gpg --symmetric --batch --passphrase "$PASSPHRASE" db.dump - rm db.dump - local_file="db.dump.gpg" - s3_uri="${s3_uri_base}.gpg" -else - local_file="db.dump" - s3_uri="$s3_uri_base" -fi - -echo "Uploading backup to $S3_BUCKET..." -aws $aws_args s3 cp "$local_file" "$s3_uri" -rm "$local_file" - -echo "Backup complete." - -if [ -n "$BACKUP_KEEP_DAYS" ]; then - sec=$((86400*BACKUP_KEEP_DAYS)) - date_from_remove=$(date -d "@$(($(date +%s) - sec))" +%Y-%m-%d) - backups_query="Contents[?LastModified<='${date_from_remove} 00:00:00'].{Key: Key}" - - echo "Removing old backups from $S3_BUCKET..." - aws $aws_args s3api list-objects \ - --bucket "${S3_BUCKET}" \ - --prefix "${S3_PREFIX}" \ - --query "${backups_query}" \ - --output text \ - | xargs -n1 -t -I 'KEY' aws $aws_args s3 rm s3://"${S3_BUCKET}"/'KEY' - echo "Removal complete." -fi +for POSTGRES_DATABASE in $(echo $POSTGRES_DATABASES | sed "s/,/ /g") +do + echo "Creating backup of $POSTGRES_DATABASE database ${POSTGRES_DATABASE} ..." + pg_dump --format=custom \ + -h $POSTGRES_HOST \ + -p $POSTGRES_PORT \ + -U $POSTGRES_USER \ + -d $POSTGRES_DATABASE \ + $PGDUMP_EXTRA_OPTS \ + > db.dump + + timestamp=$(date +"%Y-%m-%dT%H:%M:%S") + s3_uri_base="s3://${S3_BUCKET}/${S3_PREFIX}/${POSTGRES_DATABASE}_${timestamp}.dump" + + if [ -n "$PASSPHRASE" ]; then + echo "Encrypting backup..." + gpg --symmetric --batch --passphrase "$PASSPHRASE" db.dump + rm db.dump + local_file="db.dump.gpg" + s3_uri="${s3_uri_base}.gpg" + else + local_file="db.dump" + s3_uri="$s3_uri_base" + fi + + echo "Uploading backup to $S3_BUCKET..." + aws $aws_args s3 cp "$local_file" "$s3_uri" + rm "$local_file" + + echo "Backup complete." + + if [ -n "$BACKUP_KEEP_DAYS" ]; then + sec=$((86400*BACKUP_KEEP_DAYS)) + date_from_remove=$(date -d "@$(($(date +%s) - sec))" +%Y-%m-%d) + backups_query="Contents[?LastModified<='${date_from_remove}'].{Key: Key}" + + echo "Removing old backups from $S3_BUCKET... ${backups_query}" + aws $aws_args s3api list-objects \ + --bucket "${S3_BUCKET}" \ + --prefix "${S3_PREFIX}" \ + --query "${backups_query}" \ + --output text \ + | xargs -n1 -t -I 'KEY' aws $aws_args s3 rm s3://"${S3_BUCKET}"/'KEY' + echo "Removal complete." + fi + + if [ -n "$WEBHOOK_URL" ]; then + echo "Notifying webhook ${WEBHOOK_URL}" + curl -m 10 --retry 5 $WEBHOOK_URL + fi + +done + diff --git a/src/env.sh b/src/env.sh index af495e4..bf90175 100644 --- a/src/env.sh +++ b/src/env.sh @@ -3,8 +3,8 @@ if [ -z "$S3_BUCKET" ]; then exit 1 fi -if [ -z "$POSTGRES_DATABASE" ]; then - echo "You need to set the POSTGRES_DATABASE environment variable." +if [ -z "$POSTGRES_DATABASES" ]; then + echo "You need to set the POSTGRES_DATABASES environment variable." exit 1 fi diff --git a/template.env b/template.env index e0b5c24..80ece29 100644 --- a/template.env +++ b/template.env @@ -1,4 +1,4 @@ -S3_REGION="" -S3_ACCESS_KEY_ID="" -S3_SECRET_ACCESS_KEY="" -S3_BUCKET="" +S3_REGION="" +S3_ACCESS_KEY_ID="" +S3_SECRET_ACCESS_KEY="" +S3_BUCKET="" From 2b960c024a0ee90a6999ef803e62f0aea50f9bbb Mon Sep 17 00:00:00 2001 From: aramdata Date: Mon, 6 Feb 2023 17:49:25 +0330 Subject: [PATCH 2/7] update readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 13803c4..b9bbdf0 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,9 @@ services: S3_SECRET_ACCESS_KEY: secret S3_BUCKET: my-bucket S3_PREFIX: backup + S3_ENDPOINT: if your s3 storage is not on aws POSTGRES_HOST: postgres - POSTGRES_DATABASE: dbname + POSTGRES_DATABASES: 'dbname1,dbname2,dbname3,...' POSTGRES_USER: user POSTGRES_PASSWORD: password ``` From 25f0233758af8ac4087a54681dac73309d77192e Mon Sep 17 00:00:00 2001 From: aramdata Date: Mon, 6 Feb 2023 18:00:43 +0330 Subject: [PATCH 3/7] remove old postgres matrix from ci cd --- .github/workflows/build-and-push-images.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index 9c8ba45..d095b24 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -11,10 +11,10 @@ jobs: strategy: matrix: include: - - { postgres: 11, alpine: '3.10' } - - { postgres: 12, alpine: '3.12' } - - { postgres: 13, alpine: '3.14' } - - { postgres: 14, alpine: '3.16' } + # - { postgres: 11, alpine: '3.10' } + # - { postgres: 12, alpine: '3.12' } + # - { postgres: 13, alpine: '3.14' } + # - { postgres: 14, alpine: '3.16' } - { postgres: 15, alpine: '3.17' } steps: From f099af8795c42737d8fbbb327ae64a21c7dcac74 Mon Sep 17 00:00:00 2001 From: aramdata Date: Sat, 3 Feb 2024 13:09:34 +0330 Subject: [PATCH 4/7] add postgress 16 --- .github/workflows/build-and-push-images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index d095b24..ef157da 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -16,6 +16,7 @@ jobs: # - { postgres: 13, alpine: '3.14' } # - { postgres: 14, alpine: '3.16' } - { postgres: 15, alpine: '3.17' } + - { postgres: 16, alpine: '3.19' } steps: - name: Checkout repository From cc5057948ac89359eebceb512d7eba927d810324 Mon Sep 17 00:00:00 2001 From: aramdata Date: Sat, 3 Feb 2024 13:26:43 +0330 Subject: [PATCH 5/7] test postgress 16 --- .github/workflows/build-and-push-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index ef157da..5d708a9 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -15,7 +15,7 @@ jobs: # - { postgres: 12, alpine: '3.12' } # - { postgres: 13, alpine: '3.14' } # - { postgres: 14, alpine: '3.16' } - - { postgres: 15, alpine: '3.17' } + # - { postgres: 15, alpine: '3.17' } - { postgres: 16, alpine: '3.19' } steps: From 6f72efb0bdcbb99f373208b0642d7d77bbe7327b Mon Sep 17 00:00:00 2001 From: aramdata Date: Sat, 3 Feb 2024 13:30:05 +0330 Subject: [PATCH 6/7] change aws install method --- .github/workflows/build-and-push-images.yml | 2 +- src/install.sh | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index 5d708a9..ef157da 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -15,7 +15,7 @@ jobs: # - { postgres: 12, alpine: '3.12' } # - { postgres: 13, alpine: '3.14' } # - { postgres: 14, alpine: '3.16' } - # - { postgres: 15, alpine: '3.17' } + - { postgres: 15, alpine: '3.17' } - { postgres: 16, alpine: '3.19' } steps: diff --git a/src/install.sh b/src/install.sh index d25fe05..5077ee2 100644 --- a/src/install.sh +++ b/src/install.sh @@ -11,9 +11,7 @@ apk add postgresql-client # install gpg apk add gnupg -apk add python3 -apk add py3-pip # separate package on edge only -pip3 install awscli +apk add aws-cli # install go-cron apk add curl From e5ab47f46a22894b697bf382a735df5cf3a6124c Mon Sep 17 00:00:00 2001 From: Mohsen Sheikhzadeh Date: Mon, 25 Nov 2024 11:42:37 +0330 Subject: [PATCH 7/7] Update to postgres 17 --- .github/workflows/build-and-push-images.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index ef157da..ce0efec 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -17,6 +17,7 @@ jobs: # - { postgres: 14, alpine: '3.16' } - { postgres: 15, alpine: '3.17' } - { postgres: 16, alpine: '3.19' } + - { postgres: 17, alpine: '3.20' } steps: - name: Checkout repository