-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up Google environment for
search-api-v2
This allows an engineer working on `search-api-v2` using GOV.UK Docker to authenticate on their host machine using `gcloud` and set an environment variable for their datastore in the dev GCP environment. - Add mounting of `~/.config/gcloud` into the `search-api-v2` containers - Add mirroring of local `DISCOVERY_ENGINE_DATASTORE` environment variable into containers - Add checks to the Makefile to ensure user setup is correct
- Loading branch information
Showing
3 changed files
with
42 additions
and
9 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 |
---|---|---|
@@ -1,2 +1,22 @@ | ||
search-api-v2: bundle-search-api-v2 | ||
search-api-v2: check-env-search-api-v2 bundle-search-api-v2 | ||
$(GOVUK_DOCKER) run $@-lite bundle exec rake document_sync_worker:create_queue | ||
|
||
BOLD_RED=\033[1;31m | ||
REG_RED=\033[0;31m | ||
RESET=\033[0m | ||
|
||
define SEARCH_API_V2_WARN_GCLOUD | ||
\033[1;31mWarning: gcloud not found on PATH.\n\ | ||
\033[0;31msearch-api-v2 requires credentials from the gcloud CLI to access Google Cloud Platform. \ | ||
These are mounted into the container. See the README for details.\033[0m | ||
endef | ||
|
||
define SEARCH_API_V2_WARN_DATASTORE | ||
\033[1;31mWarning: DISCOVERY_ENGINE_DATASTORE environment variable is not set.\ | ||
\n\033[0;31mYou need to set this environment variable locally before running govuk-docker up,\ | ||
otherwise the app will not be able to access Discovery Engine. See the README for details.\033[0m | ||
endef | ||
|
||
prerequisites-search-api-v2: | ||
@command -v gcloud >/dev/null 2>&1 || { echo "$(SEARCH_API_V2_WARN_GCLOUD)"; } | ||
@[ -n "$${DISCOVERY_ENGINE_DATASTORE}" ] || { echo "$(SEARCH_API_V2_WARN_DATASTORE)"; } |
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