在Travis CI上使用gcloud [英] Using gcloud on Travis CI

查看:185
本文介绍了在Travis CI上使用gcloud的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已安装gcloud并正常工作,并且服务帐户也被激活。我运行以下并获得成功(?):

I have gcloud installed and working and a service account gets also activated. I run the following and get a success(?):

$ gcloud auth activate-service-account "${GAE_CLIENT_ACCOUNT}" --key-file "${GAE_CLIENT_KEY_JSON_FILE}"

Activated service account credentials for: [xxxxx@developer.gserviceaccount.com]

然后我运行这个:

$ gcloud preview app deploy app.yaml --project "${GAE_PROJECT_ID}" --quiet --version "${GAE_PROJECT_VERSION}"

You are about to deploy the following modules:
 - ricochet-robots/default/dev  From: [/home/travis/build/ricochetrobots/ricochetrobots-landing/app.yaml]

Updating module [default]...Go to the following link in your browser:

    https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=xxxxxxxx.apps.googleusercontent.com&access_type=offline

Updating module [default].../

正如你所看到的,它提示我跟随链接并做一个oauth。因为我在一个ci服务器,它是不可能跟随链接。
我如何抑制?

As you can see, it prompts me to follow the link and do an oauth. Because I'm on a ci server, it's not possible to follow the link. How kan I suppress that? Or is there a totally diffrent way of deploying the app automatically.

推荐答案

这是一个已知问题(版本0.9.61)。

This is a known issue in version 0.9.61.

现在,你可以固定到以前的版本:

For now, you can work around by pinning to a previous version:

gcloud config set component_manager/fixed_sdk_version 0.9.60
gcloud components update

由于您在CI服务器中运行,还要设置以下环境变量,如果您在脚本中运行 gcloud组件更新。根据您的CI服务器,这可能更容易解决。

Since you're running in a CI server, you can also set the following environment variable, if you run gcloud components update in your script. This may be an easier fix, depending on your CI server.

CLOUDSDK_COMPONENT_MANAGER_SNAPSHOT_URL=https://dl.google.com/dl/cloudsdk/release/components-v0.9.60.json

运行 gcloud预览app deploy --set-default 使用服务帐户在版本0.9.57到0.9.62中具有相同的问题。如果您要使用此命令,您可以固定到0.9.56。

Running gcloud preview app deploy --set-default using a service account has the same issue in versions 0.9.57 through 0.9.62. If you'd like to use this command, you can pin to 0.9.56.

我们的目标是修复0.9.63版本或之后不久。请按照gcloud错误跟踪器上的问题获取更多更新。

We're targeting a fix for version 0.9.63 or shortly thereafter. Follow the issue on the gcloud bug tracker for more updates.

编辑:此问题已在0.9.63版本中修复。

This issue was fixed in version 0.9.63.

这篇关于在Travis CI上使用gcloud的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆