-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI/CD pipeline to handle Postgres migration
- Loading branch information
Showing
3 changed files
with
10 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,11 @@ | |
# Store object store files under `data/objects` | ||
BRIOCHE_REGISTRY_OBJECT_STORE_URL=relative-file:///./data/objects | ||
|
||
# Store the database under `data/dev.db` | ||
BRIOCHE_REGISTRY_DATABASE_URL=sqlite://./data/dev.db?mode=rwc | ||
# Set to a running Postgres instance (see `docker-compose.yml`) | ||
BRIOCHE_REGISTRY_DATABASE_URL=postgresql://postgres:[email protected]:6543 | ||
|
||
# Used only for the sqlx CLI | ||
DATABASE_URL=sqlite://./data/schema.db?mode=ro | ||
|
||
# Set this to enable builds even without a running database | ||
# CARGO_SQLX_OFFLINE=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
.PHONY: dev | ||
dev: | ||
cargo watch -x 'run -- serve' | ||
|
||
.PHONY: update-db-schema | ||
update-db-schema: | ||
# Run cargo check first to make sure `brioche` gets build. Otherwise, sqlx | ||
# will try to check Brioche's queries and fail | ||
cargo check || true | ||
mkdir -p ./data | ||
DATABASE_URL=sqlite://$(CURDIR)/data/schema.db?mode=rwc cargo sqlx migrate run | ||
DATABASE_URL=sqlite://$(CURDIR)/data/schema.db cargo sqlx prepare | ||
|
||
.PHONY: check-db-schema | ||
check-db-schema: | ||
# Run cargo check first to make sure `brioche` gets build. Otherwise, sqlx | ||
# will try to check Brioche's queries and fail | ||
cargo check || true | ||
mkdir -p ./data | ||
DATABASE_URL=sqlite://$(CURDIR)/data/schema.db?mode=rwc cargo sqlx migrate run | ||
DATABASE_URL=sqlite://$(CURDIR)/data/schema.db cargo sqlx prepare --check |