-2

Using gcloud in scrutinizer-ci, I want to automatically deploy to gcp.

There is no information anywhere, but who has something done?

  • Can you please elaborate your use case by letting us know which product you want to use in Google Cloud Platform and how? – Taher Jan 23 '18 at 23:26
  • `# Create an environment variable for the correct distribution export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" # Add the Cloud SDK distribution URI as a package source echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list # Import the Google Cloud Platform public key curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -` – Rei OKawara Jan 26 '18 at 07:31
  • `# Update the package list and install the Cloud SDK sudo apt-get -y update && sudo apt-get -y install google-cloud-sdk gcloud auth activate-service-account --key-file=/home/scrutinizer/build/credential_key.json` – Rei OKawara Jan 26 '18 at 07:31
  • I resoled these. – Rei OKawara Jan 26 '18 at 07:31

1 Answers1

1
# Create an environment variable for the correct distribution
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"

# Add the Cloud SDK distribution URI as a package source
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

# Update the package list and install the Cloud SDK
sudo apt-get -y update && sudo apt-get -y install google-cloud-sdk

#/home/scrutinizer/build/php.info
#vi /home/scrutinizer/build/credential_key.json

gcloud auth activate-service-account --key-file=/home/scrutinizer/build/credential_key.json

thx, I resoled this shell