Skip to content

Commit

Permalink
add SENTRY_CRON_ENDPOINT
Browse files Browse the repository at this point in the history
  • Loading branch information
frnandu committed Feb 2, 2024
1 parent 9734ced commit ea20844
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions postgres-backup-s3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ENV S3_PATH 'backup'
ENV S3_ENDPOINT **None**
ENV S3_S3V4 no
ENV SCHEDULE **None**
ENV SENTRY_CRON_ENDPOINT **None**

ADD run.sh run.sh
ADD backup.sh backup.sh
Expand Down
4 changes: 4 additions & 0 deletions postgres-backup-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ An Endpoint is the URL of the entry point for an AWS web service or S3 Compitabl
You can specify an alternate endpoint by setting `S3_ENDPOINT` environment variable like `protocol://endpoint`

**Note:** S3 Compitable Storage Provider requires `S3_ENDPOINT` environment variable

### SENTRY CRON monitors

You can set `SENTRY_CRON_ENDPOINT` and it will call this endpoint with `?status=in_progress` in beginning and `?status=ok` in the end on success
6 changes: 6 additions & 0 deletions postgres-backup-s3/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ else
S3_PREFIX="/${S3_PREFIX}/"
fi

if [ "${SENTRY_CRON_ENDPOINT}" != "**None**" ]; then
curl "${ENTRY_CRON_ENDPOINT}?status=in_progress"
fi

if [ "${POSTGRES_BACKUP_ALL}" == "true" ]; then
echo "Creating dump of all databases from ${POSTGRES_HOST}..."
Expand Down Expand Up @@ -103,3 +106,6 @@ else
done
fi

if [ "${SENTRY_CRON_ENDPOINT}" != "**None**" ]; then
curl "${ENTRY_CRON_ENDPOINT}?status=ok"
fi

0 comments on commit ea20844

Please sign in to comment.