1

我正在尝试通过 Travis-CI 自动构建到谷歌云,但是当我尝试运行“gcloud docker any_command”时,我收到了消息

ERROR: (gcloud) Invalid choice: 'docker'. Did you mean 'config'?

当我尝试使用“gcloud components install docker”安装docker时,我得到了

You cannot perform this action because the component manager has been 
disabled for this installation.  If you would like get the latest 
version of the Google Cloud SDK, please see our main download page at:
  https://developers.google.com/cloud/sdk/
ERROR: (gcloud.components.update) The component manager is disabled for this installation 

这是我的 .travis.yml 文件 -

sudo: required
language: python
python:
  - "2.7"
deploy:
  provider: gae
  keyfile: client-secret.json
  project: galvanic-being-138423
notifications:
  email: false
services:
  - docker
cache:
  directories:
  - $HOME/google-cloud-sdk/
env:
- GAE_PYTHONPATH=${HOME}/.cache/google_appengine PATH=$PATH:${HOME}/google-cloud-sdk/bin
  PYTHONPATH=${PYTHONPATH}:${GAE_PYTHONPATH} CLOUDSDK_CORE_DISABLE_PROMPTS=1
before_install:
- openssl aes-256-cbc -K $encrypted_3ae578884e67_key -iv $encrypted_3ae578884e67_iv
  -in credentials.tar.gz.enc -out credentials.tar.gz -d
- rm -rf ${HOME}/google-cloud-sdk/
- curl https://sdk.cloud.google.com | bash;
- ls -l ${HOME}/google-cloud-sdk/bin
- which gcloud
- gcloud --version
- if [ ! -d "${GAE_PYTHONPATH}" ]; then python scripts/fetch_gae_sdk.py $(dirname
  "${GAE_PYTHONPATH}"); fi
- if [ ! -d ${HOME}/google-cloud-sdk ]; then curl https://sdk.cloud.google.com | bash;
  fi

install:
- pip install pyOpenSSL
- sudo rm -rf /opt/google-cloud-sdk/
- export CLOUDSDK_CORE_DISABLE_PROMPTS=1
- export CLOUDSDK_PYTHON_SITEPACKAGES=1
- tar -xzf credentials.tar.gz
- mkdir -p lib
- gcloud auth activate-service-account galvanic-being-138423@appspot.gserviceaccount.com --key-file client-secret.json
- gcloud config set project galvanic-being-138423
- gcloud config set compute/zone europe-west1-c
- gcloud config set container/cluster example-cluster
- ssh-keygen -q -N "" -f ~/.ssh/google_compute_engine
- gcloud init galvanic-being-138423
- gcloud components update
- gcloud components install docker
- curl -L  https://github.com/kubernetes/kubernetes/releases/download/v1.3.3/kubernetes.tar.gz > kubernetes.tar.gz 
- tar -xf kubernetes.tar.gz
- sudo cp kubernetes/platforms/linux/amd64/kubectl /usr/local/bin/kubectl
- sudo chmod +x /usr/local/bin/kubectl
- docker pull wordpress:latest
- docker build -t gcr.io/galvanic-being-138423/wordpress-testing:v1 docker/
- gcloud docker push gcr.io/galvanic-being-138423/wordpress-testing:v1
- kubectl config set-cluster example-cluster --server=http://galvanic-being-138423.appspot.com
- kubectl config set-context example-cluster --cluster=example-cluster
- kubectl config use-context example-cluster
- kubectl run wordpress-testing --image=gcr.io/galvanic-being-138423/wordpress-testing:v1 --port=80

编辑:

gcloud --version 给出:

Google Cloud SDK 0.9.37
bq 2.0.18
bq-nix 2.0.18
compute 2014.11.25
core 2014.11.25
core-nix 2014.11.25
dns 2014.11.25
gcutil 1.16.5
gcutil-nix 1.16.5
gsutil 4.6
gsutil-nix 4.6
sql 2014.11.25
4

0 回答 0