在scrutinizer-ci中使用gcloud, 我想自动部署到gcp。
在任何地方都没有任何信息,但谁做了什么?
答案 0 :(得分: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,我重新启动了这个shell