gcloud:找不到命令

发布于 2025-02-10 17:04:06 字数 885 浏览 2 评论 0原文

我得到了以下错误:

运行管道上的管道失败管道gitlab 将这工作部署到生产没有成功。

Running with gitlab-runner 15.1.0 (76984217)
  on ci 3wNvyH89
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on localhost.localdomain...
Getting source from Git repository
00:00
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/3wNvyH89/0/root/yogesh1/.git/
Checking out 668d7d24 as main...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
$ echo $SERVICE_ACCOUNT > /tmp/$CI_PIPELINE_ID.json
$ gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json
bash: line 125: gcloud: command not found
Running after_script
00:00
Running after script...
$ rm /tmp/$CI_PIPELINE_ID.json
ERROR: Job failed: exit status 1

I got the followwing error:

error failed pipeline on run pipeline gitlab
The deployment of this job to Production did not succeed.

Running with gitlab-runner 15.1.0 (76984217)
  on ci 3wNvyH89
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on localhost.localdomain...
Getting source from Git repository
00:00
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/3wNvyH89/0/root/yogesh1/.git/
Checking out 668d7d24 as main...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
$ echo $SERVICE_ACCOUNT > /tmp/$CI_PIPELINE_ID.json
$ gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json
bash: line 125: gcloud: command not found
Running after_script
00:00
Running after script...
$ rm /tmp/$CI_PIPELINE_ID.json
ERROR: Job failed: exit status 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羁客 2025-02-17 17:04:06

这取决于您在gitlab-ci.yml中使用的图像。

例如,在文章中,“ 如何为Google Cloud App Engine设置Gitlab CI管道?”来自 nofollow noreferrer“>他正在使用:

image: google/cloud-sdk:alpine

deploy_production:
  stage: deploy
  environment: Production
  only:
  - master
  script:
  - echo $SERVICE_ACCOUNT > /tmp/$CI_PIPELINE_ID.json
  - gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json
  - gcloud --quiet --project $PROJECT_ID app deploy app.yaml dispatch.yaml

这意味着gcloud已经安装在$ path中。

It depends on the image you are using in your gitlab-ci.yml.

For instance, in the article "How to Setup Gitlab CI Pipeline For Google Cloud App Engine?" from Tapendra Dev, he is using:

image: google/cloud-sdk:alpine

deploy_production:
  stage: deploy
  environment: Production
  only:
  - master
  script:
  - echo $SERVICE_ACCOUNT > /tmp/$CI_PIPELINE_ID.json
  - gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json
  - gcloud --quiet --project $PROJECT_ID app deploy app.yaml dispatch.yaml

Which means gcloud is already installed and in the $PATH.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文