Google App Engine,Google Cloud Console,Jenkins触发器远程构建,未找到gcloud命令 [英] Google App Engine, Google Cloud Console, Jenkins trigger builds remotely, gcloud command not found

查看:404
本文介绍了Google App Engine,Google Cloud Console,Jenkins触发器远程构建,未找到gcloud命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用URL远程部署我的GAE应用程序,这部分工作很好。
Jenkins正确检出最新修订版,但在尝试使用 Google Cloud Help

  gcloud --project =<项目-id>预览应用程序部署-q app.yaml 

我收到以下错误消息:

  [工作区] $ / bin / sh -xe /opt/bitnami/apache-tomcat/temp/hudson7352698921882428590.sh 
+ gcloud - project = XYZXYZXYZ预览app部署-q app.yaml
/opt/bitnami/apache-tomcat/temp/hudson7352698921882428590.sh:2:
/opt/bitnami/apache-tomcat/temp/hudson7352698921882428590.sh :gcloud:未找到
构建步骤'Execute shell'标记构建失败

我有改变了项目ID为我的,但我不明白为什么它缺少gcloud命令..



编辑



我跑了

  / usr / local / bin / gcloud --project =< ;项目-ID>预览应用程序部署-q app.yaml 

现在我得到了这个错误:

 追溯(最近一次调用最后一次):
文件/usr/local/bin/../share/google/google-cloud- sdk /./lib/googlecloudsdk/gcloud/gcloud.py,第199行,在< module>
_cli = CreateCLI()
文件/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py,第197行,在CreateCLI
返回loader.Generate()
文件/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py ,第384行,生成
cli = self .__ MakeCLI(top_group)
文件/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk /calliope/cli.py,第546行,在__MakeCLI
log.AddFileLogging(self .__ logs_dir)
文件/usr/local/bin/../share/google/google-cloud-sdk /./lib/googlecloudsdk/core/log.py,第546行,在AddFileLogging
中_log_manager.AddLogsDir(logs_dir = logs_dir)
文件/usr/local/bin/../share/google /google-cloud-sdk/./lib/googlecloudsdk/core/log.py,行330,位于AddLogsDir
log_file = self._SetupLogsDir(logs_dir)
文件/ usr / local / bin / ../share/google/google-cloud-sdk/./lib/googlecloudsdk/core/log.py,第407行,位于_SetupLogsDir
os.makedirs(day_dir_path)
文件/ usr / LIB / python2.7 / os.py,行150,makedirs
makedirs(head,mode)
文件/usr/lib/python2.7/os.py,行150,在makedirs
makedirs(head,mode)
文件/usr/lib/python2.7/os.py,第150行,在makedirs
makedirs(head,mode)
文件 /usr/lib/python2.7/os.py,行157,makedirs
mkdir(name,mode)
OSError:[Errno 13]权限被拒绝:'/.config'
构建步骤'Execute shell'标记构建失败



FINAL EDIT



对于稍后在此处提到的任何人,我并没有完全解决这个问题,但至少我设法通过Google在指南中写入的命令创建一个全新的虚拟机来解决此错误与詹金斯进行推送部署

  $ PASSWORD =< password> #12或更多字符,包含字母和数字
$ PROJECT_ID =< project-id>
$ BITNAMI_IMAGE =< bitnami-image> #例如bitnami-jenkins-1-606-0-linux-debian-7-x86-64


$ gcloud compute \
实例创建bitnami-jenkins \
--project $ {PROJECT_ID} \
--image-project bitnami-launchpad \
--image $ {BITNAMI_IMAGE} \
--zone us-central1-a \\ \\
--machine-type n1-standard-1 \
--metadatabitnami-base-password = $ {PASSWORD},bitnami-default-user = user,bitnami-key = jenkins, bitnami名=詹金斯,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/auth/userinfo.email,https://www.googleapis.com/auth/devstorage.full_control,https:// www.googleapis.com/auth/projecthosting,https://www.googleapis.com/auth/appengine.admin\
--tagsbitnami-launchpad

至少在这个新虚拟机中,我可以前进,现在我已经接近完成它的工作了ing,但我被困在另一个错误,我现在已经创建了另一个问题:
Gcloud预览应用程序无法解析我的yaml 尝试指定 gcloud 可执行文件的完整路径 - 它可能无法在jenkins的shell PATH环境中访问。


I'm trying to deploy my GAE app remotely with a URL, and this part works nicely. Jenkins checks out the latest revision correctly but when trying to build with the command specified in the Google Cloud Help:

gcloud --project=<project-id> preview app deploy -q app.yaml

I get the follow error message:

[workspace] $ /bin/sh -xe /opt/bitnami/apache-tomcat/temp/hudson7352698921882428590.sh
+ gcloud --project=XYZXYZXYZ preview app deploy -q app.yaml
/opt/bitnami/apache-tomcat/temp/hudson7352698921882428590.sh: 2:
/opt/bitnami/apache-tomcat/temp/hudson7352698921882428590.sh: gcloud: not found
Build step 'Execute shell' marked build as failure

I have changed the project-id to mine, but i can't figure out why it's missing the gcloud command..

EDIT

I ran

/usr/local/bin/gcloud --project=<project-id> preview app deploy -q app.yaml

and now i got this error:

Traceback (most recent call last):
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 199, in <module>
_cli = CreateCLI()
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 197, in CreateCLI
return loader.Generate()
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 384, in Generate
cli = self.__MakeCLI(top_group)
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 546, in __MakeCLI
log.AddFileLogging(self.__logs_dir)
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/core/log.py", line 546, in AddFileLogging
_log_manager.AddLogsDir(logs_dir=logs_dir)
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/core/log.py", line 330, in AddLogsDir
log_file = self._SetupLogsDir(logs_dir)
File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/core/log.py", line 407, in _SetupLogsDir
os.makedirs(day_dir_path)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/.config'
Build step 'Execute shell' marked build as failure

FINAL EDIT

For anyone comming around here later, i did not exactly solve this, but at least i managed to get around this error by creating an all new VM through the command Google has written in the guide Push-to-Deploy with Jenkins:

$ PASSWORD=<password>                # 12 or more chars, with letters and numbers
$ PROJECT_ID=<project-id>
$ BITNAMI_IMAGE=<bitnami-image>      # e.g. bitnami-jenkins-1-606-0-linux-debian-7-x86-64


$ gcloud compute \
    instances create bitnami-jenkins \
    --project ${PROJECT_ID} \
    --image-project bitnami-launchpad \
    --image ${BITNAMI_IMAGE} \
    --zone us-central1-a \
    --machine-type n1-standard-1 \
    --metadata "bitnami-base-password=${PASSWORD},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 "bitnami-launchpad"

At least with this new VM i could move forward and i'm now close to get it working, but i'm stuck on another error which i've created another question for now: Gcloud preview app can't parse my yaml

解决方案

Try specifying the gcloud executable with its full path - it might not be accessible in jenkins' shell PATH environment.

这篇关于Google App Engine,Google Cloud Console,Jenkins触发器远程构建,未找到gcloud命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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