cmd/relui: add instructions to enable cloud build in local relui Change-Id: Ic73cfd43aedadc8e585d24f9166b4017235d17b1 Reviewed-on: https://go-review.googlesource.com/c/build/+/601895 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Hongxiang Jiang <hxjiang@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/cmd/relui/README.md b/cmd/relui/README.md index 7fe39d1..da21edc 100644 --- a/cmd/relui/README.md +++ b/cmd/relui/README.md
@@ -26,6 +26,32 @@ make dev ``` +### Enable Cloud Build in your local relui + +Set your personal Google Cloud Project. + +```bash +gcloud config set project PROJECT_ID +``` + +Enable the Cloud Build API from your project. + +```bash +gcloud services enable cloudbuild.googleapis.com +``` + +Create a GCS bucket in your project. +```bash +gcloud storage buckets create gs://GCS_BUCKET_NAME +``` + +Run relui with additional parameters `-cloud-build-project` and +`-scratch-files-base`. The local relui will run cloud build in you project and +copy the results to your GCS bucket. +```bash +PGHOST=localhost PGDATABASE=relui-dev PGUSER=postgres go run . -listen-http=localhost:8080 -cloud-build-project PROJECT_ID -scratch-files-base gs://GCS_BUCKET_NAME +``` + ### Updating Queries Create or edit SQL files in `internal/relui/queries`. @@ -37,7 +63,7 @@ ### Creating & Running Database Migrations -Migrations are managed using `github.com/golang-migrate/migrate`. +Migrations are managed using `github.com/golang-migrate/migrate`. #### Creating @@ -61,7 +87,7 @@ Run go test with the appropriate [libpq-style environment variables](https://www.postgresql.org/docs/current/libpq-envars.html) set. If the database connection fails, database integration tests will -be skipped. If PGDATABASE is unset, relui-test is created, migrated, +be skipped. If PGDATABASE is unset, relui-test is created, migrated, and used by default. ```bash