用gcloud设置scrutinizer-ci

时间:2018-01-23 04:04:13

标签: gcloud gcp scrutinizer

在scrutinizer-ci中使用gcloud, 我想自动部署到gcp。

在任何地方都没有任何信息,但谁做了什么?

1 个答案:

答案 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