Jenkins推送应用程序引擎部署失败 [英] Jenkins push-to-deploy setup for app-engine fails

查看:138
本文介绍了Jenkins推送应用程序引擎部署失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从bitnami-jenkins映像创建了一个新的计算引擎实例来自动部署我的应用程序引擎应用程序。我使用了下面的命令:

  gcloud compute instances创建deployer 
--project myapp --image-项目bitnami-launchpad
--image bitnami-jenkins-1-638-1-linux-debian-7-x86-64
--zone us-central1 -a --machine-type g1-small
--metadatabitnami-base-password = mypassword,bitnami-default-user = user,bitnami-key = jenkins,bitnami-name = Jenkins,bitnami-url = // bitnami.com/stack/jenkins, bitnami-description = Jenkins,startup-script-url = https://dl.google.com/dl/jenkins/p2dsetup/setup-script.sh
--scopeshttps://www.googleapis。 COM /认证/ userinfo.email,HTTPS://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/projecthosting,https://www.googleapis.com/auth/ appengine.admin
--tagsjenkins

创建机器后,创建了一个工作来部署代码,如下所述:


https://cloud.google.com/tools/cloud-repositories/docs/push-to-deploy


但是,我的工作失败,出现以下错误:

 错误:错误响应:[403 ]请求的认证范围不足。 
错误:(gcloud.preview.app.deploy)无法检索[myapp]的默认Google云端存储分区。请重试或使用[bucket]参数。

有其他人遇到过吗?我有另一台jenkins机器,上面有一个老版本的gcloud。它从不抛出与云存储桶相关的任何错误。所以我有一个预感,它与新版本的gcloud有关。



请帮忙。感谢。

编辑:这是gcloud命令的输出,其中 - 详细调试
gcloud输出

解决方案当我尝试使用最新版本的Cloud SDK(0.9.88)重现此操作时,出现以下错误消息:

 错误:(gcloud.preview.app.deploy)必填范围['https://www.googleapis.com/auth/cloud-platform']缺少['https://www.googleapis .com / auth / appengine.admin','https://www.googleapis.com/auth/devstorage.full_control','https://www.googleapis.com/auth/projecthosting','https:// www .googleapis.com / AUTH / userinfo.email']。这个VM实例可能需要重新创建缺少的范围。 

解决方案是像以前一样重新创建虚拟机,但添加作用域 https://www.googleapis.com/auth/cloud-platform - 作用域 flag。



我将确保文档得到修复以反映这一点。 编辑:文档已被修复。

I created a new compute engine instance from the bitnami-jenkins image to auto-deploy my app-engine application. I used the following command to do so:

gcloud compute instances create deployer
--project myapp --image-project bitnami-launchpad
--image bitnami-jenkins-1-638-1-linux-debian-7-x86-64
--zone us-central1-a --machine-type g1-small 
--metadata "bitnami-base-password=mypassword,bitnami-default-user=user,bitnami-key=jenkins,bitnami-name=Jenkins,bitnami-url=//bitnami.com/stack/jenkins,bitnami-description=Jenkins,startup-script-url=https://dl.google.com/dl/jenkins/p2dsetup/setup-script.sh" 
--scopes "https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/projecthosting,https://www.googleapis.com/auth/appengine.admin" 
--tags "jenkins"

Once the machine was created, I created a job to deploy the code as described here:

https://cloud.google.com/tools/cloud-repositories/docs/push-to-deploy

However, my job fails with the following error:

ERROR: Error Response: [403] Request had insufficient authentication scopes.
ERROR: (gcloud.preview.app.deploy) Could not retrieve the default Google Cloud Storage bucket for [myapp]. Please try again or use the [bucket] argument.

Has anybody else encountered this? I had another jenkins machine with an older version of gcloud on it. It never threw any errors related to a cloud-storage bucket. So I have a hunch that it is related to newer versions of gcloud.

Please help. Thanks.

Edit: Here is the output of the gcloud command with --verbosity debug. gcloud output

解决方案

When I attempt to reproduce this using the latest version of the Cloud SDK (0.9.88), I get the following error message:

ERROR: (gcloud.preview.app.deploy) Required scopes ['https://www.googleapis.com/auth/cloud-platform'] missing from ['https://www.googleapis.com/auth/appengine.admin', 'https://www.googleapis.com/auth/devstorage.full_control', 'https://www.googleapis.com/auth/projecthosting', 'https://www.googleapis.com/auth/userinfo.email']. This VM instance probably needs to be recreated with the missing scopes.

The solution is to re-create the VM, as before, but add the scope https://www.googleapis.com/auth/cloud-platform to the list provided in the --scopes flag.

I'll make sure the documentation gets fixed to reflect this. EDIT: the documenation is now fixed.

这篇关于Jenkins推送应用程序引擎部署失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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