Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: flag to control pg_cron setup #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,21 @@ This is no longer the case.
We're determining how much of a performance increase does this variant actually give before we decide to bring it back.
If you used the legacy PostgreSQL image and you have data on the ram vs non-ram variant build times, please open a GitHub Issue and let us know.

#### Feature Control

To disable the PostgreSQL extension `pg_cron` set the Environment Variable `DISABLE_PG_CRON` to the value `true`

```yaml
jobs:
build:
docker:
- image: cimg/postgres:13.1-postgis
environment:
DISABLE_PG_CRON: true
steps:
- checkout
- run: echo "Do things"
```

### Tagging Scheme

Expand Down
10 changes: 10 additions & 0 deletions pg_cron.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env bash

# set DISABLE_PG_CRON to false if unset
DISABLE_PG_CRON=${DISABLE_PG_CRON:-false}

# if DISABLE_PG_CRON is set to true then exit gracefully
# as the runner has opted not to use pg_cron
if [ "${DISABLE_PG_CRON}" = true ]; then
exit 0
fi

# use same db as the one from env
dbname="$POSTGRES_DB"

Expand Down