Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hack around problems with PubSub emulator install #730

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions bin/start_pubsub
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,22 @@ sudo apt-get install apt-transport-https ca-certificates gnupg

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

sudo apt-get update

#
# Second step is to actually try the apt-get install. If that fails, then try the gcloud components version.
#

(sudo apt-get update && sudo apt-get install google-cloud-sdk-pubsub-emulator) ||
(gcloud components install pubsub-emulator && gcloud components update)
#
# Ugly hack for package dependency problems, not recommended.
# https://askubuntu.com/questions/176121/dpkg-error-trying-to-overwrite-file-which-is-also-in
HACK_OPT="-o Dpkg::Options::=--force-overwrite"

echo Trying emulator install: apt-get install $HACK_OPT google-cloud-sdk-pubsub-emulator
if ! sudo apt-get install $HACK_OPT google-cloud-sdk-pubsub-emulator; then
echo Failed apt-get install, trying: gcloud components install pubsub-emulator && gcloud components update
gcloud components install pubsub-emulator && gcloud components update
fi

echo Starting pubsub emulator...
mkdir -p out/
Expand Down
Loading