Skip to content

Commit

Permalink
Enable team members to run dev with a Neon db branch (#534)
Browse files Browse the repository at this point in the history
Single command:

    just dev-with-neon-branch gerhard-2024-11-29

The above uses a branch that I created on the 29th of November. You can
create a new Neon db branch today, using your `$USER`, with the following
command:

    just neon-create-branch

This will create e.g. `USER-YYYY-MM-DD` prod db branch.

Here is a list of all the new commands that go well together:

    [team]
    dev-with-neon-branch branch                  # Run app in dev mode with $branch
    neon-branch-connection branch *ARGS          # Show $branch connection details
    neon-branches                                # List prod db branches
    neon-create-branch                           # Create a new branch off the prod db

This change also removes the now redundant way of creating Neon db branches.

Follow-up to:
- #533
- #508

Signed-off-by: Gerhard Lazu <[email protected]>
  • Loading branch information
gerhard authored Dec 5, 2024
1 parent 3440f5e commit 7c1500d
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 306 deletions.
13 changes: 11 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Required for op to know which account to use
export OP_ACCOUNT=changelog.1password.com

# Required for image publishing to work locally
export GITHUB_REPOSITORY="thechangelog/changelog.com"
export GITHUB_REF_NAME="master"
export GITHUB_REPOSITORY=thechangelog/changelog.com
export GITHUB_REF_NAME=master
export IMAGE_OWNER=thechangelog
export GHCR_USERNAME=$USER

# Required for Postgres imports to work locally
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH
export PGUSER=postgres
export DB_USER=$PGUSER
export CHANGELOG_DEV_DB=changelog_dev

# Load secrets if configured - only available to changelog.com team members:
# https://github.com/orgs/thechangelog/people
source_env_if_exists .envrc.secrets
1 change: 0 additions & 1 deletion changelog/.tool-versions

This file was deleted.

32 changes: 0 additions & 32 deletions changelog/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions changelog/dagger.json

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/dagger/.gitattributes

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/dagger/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions changelog/dagger/go.mod

This file was deleted.

37 changes: 0 additions & 37 deletions changelog/dagger/go.sum

This file was deleted.

99 changes: 0 additions & 99 deletions changelog/dagger/main.go

This file was deleted.

1 change: 0 additions & 1 deletion changelog/envrc

This file was deleted.

6 changes: 5 additions & 1 deletion envrc.secrets.op
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Required for Oban Pro to work locally
export OBAN_KEY_FINGERPRINT="op://changelog/oban/key_fingerprint"
export OBAN_LICENSE_KEY="op://changelog/oban/license_key"

Expand All @@ -7,7 +8,10 @@ export FLY_API_TOKEN="$(flyctl auth token)"
# Required for image publishing to work locally
export GHCR_PASSWORD="op://changelog/ghcr/credential"

# Required for db sync to work locally
# Required for loading prod db data into the local dev database
export DB_PROD_HOST="op://changelog/neon/server"
export DB_PROD_USERNAME="op://changelog/neon/username"
export DB_PROD_DBNAME="op://changelog/neon/database"

# Required to branch production db
export NEON_PROJECT_ID="op://changelog/neon/project"
39 changes: 0 additions & 39 deletions fly.io/dagger-engine-2024-03-28/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions fly.io/dagger-engine-2024-03-28/fly.toml

This file was deleted.

Loading

0 comments on commit 7c1500d

Please sign in to comment.