Skip to content

Commit

Permalink
Add local dev with container
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmiller609 committed Jan 22, 2024
1 parent 314ff7a commit 527fa14
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
30 changes: 27 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@ and install against an existing Postgres setup or develop against pgrx managed
development environment (which installs and allows you to test against multiple
Postgres versions).

## Develop inside container

You can use this command to setup a development environment. You will need Docker running.

```
docker build -t local-dev-pg-later . && docker run -it --rm -v $(pwd):/app local-dev-pg-later /bin/bash
```

When the above command completes, you will have a shell inside of a container with the necessary dependencies installed, and the code shared between the container and your workstation.

Start postgres inside the container like this:

```
cargo pgrx run
```

If you are running on a ARM machine, then you will get a warning message like this, which you can ignore `<jemalloc>: MADV_DONTNEED does not work`. When that's done building the local version of your source code for pg_later, then you will be in a psql shell.

Create extension like this:

```
CREATE EXTENSION pg_later cascade;
```

### Install to a pre-existing Postgres

Initialize `cargo-pgrx`, and tell it the path to the your `pg_config`. For example,
Expand Down Expand Up @@ -75,7 +99,7 @@ CREATE EXTENSION pg_later cascade;

# Releases and versioning

`pg_later` Postgres Extension releases are automated through a [Github workflow](https://github.com/tembo-io/pg_later/blob/main/.github/workflows/pg_later_ext.yml).
The compiled binaries are publish to and hosted at [pgt.dev](https://pgt.dev). To create a release, create a new tag follow a valid [semver](https://semver.org/), then create a release with the same name.
This release must match the version found in Cargo.toml.
`pg_later` Postgres Extension releases are automated through a [Github workflow](https://github.com/tembo-io/pg_later/blob/main/.github/workflows/pg_later_ext.yml).
The compiled binaries are publish to and hosted at [pgt.dev](https://pgt.dev). To create a release, create a new tag follow a valid [semver](https://semver.org/), then create a release with the same name.
This release must match the version found in Cargo.toml.
Auto-generate the release notes and/or add more relevant details as needed.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM --platform=linux/amd64 quay.io/coredb/pgrx-builder:pg15-pgrx0.11.2

RUN cargo install pg-trunk

USER root

RUN chown -R postgres:postgres /usr/share/postgresql
RUN chown -R postgres:postgres /usr/lib/postgresql

USER postgres

RUN trunk install pgmq
RUN trunk install pg_partman

0 comments on commit 527fa14

Please sign in to comment.