mirror of
https://github.com/prodrigestivill/docker-postgres-backup-local.git
synced 2026-07-10 20:27:51 +00:00
Add CI script test
This commit is contained in:
@@ -7,8 +7,51 @@ on:
|
|||||||
- '!master'
|
- '!master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:latest
|
||||||
|
env:
|
||||||
|
POSTGRES_DB: "database"
|
||||||
|
POSTGRES_USER: "user"
|
||||||
|
POSTGRES_PASSWORD: "test"
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
# Set health checks to wait until postgres has started
|
||||||
|
options:
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Test backup script
|
||||||
|
env:
|
||||||
|
POSTGRES_DB: "database"
|
||||||
|
POSTGRES_USER: "user"
|
||||||
|
POSTGRES_PASSWORD: "test"
|
||||||
|
POSTGRES_HOST: "127.0.0.1"
|
||||||
|
POSTGRES_PORT: 5432
|
||||||
|
POSTGRES_EXTRA_OPTS: "-Z0"
|
||||||
|
BACKUP_DIR: ".data"
|
||||||
|
# Defaults
|
||||||
|
POSTGRES_DB_FILE: "**None**"
|
||||||
|
POSTGRES_USER_FILE: "**None**"
|
||||||
|
POSTGRES_PASSWORD_FILE: "**None**"
|
||||||
|
POSTGRES_PASSFILE_STORE: "**None**"
|
||||||
|
POSTGRES_CLUSTER: "FALSE"
|
||||||
|
BACKUP_SUFFIX: ".sql.gz"
|
||||||
|
BACKUP_KEEP_DAYS: 7
|
||||||
|
BACKUP_KEEP_WEEKS: 4
|
||||||
|
BACKUP_KEEP_MONTHS: 6
|
||||||
|
run: |
|
||||||
|
mkdir -p "$BACKUP_DIR"
|
||||||
|
sh -xe backup.sh
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ test ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
.data
|
||||||
Reference in New Issue
Block a user