错误:构建步骤0“ gcr.io/cloud-builders/docker”失败:退出状态1

时间:2019-04-22 17:40:45

标签: google-cloud-platform bitbucket google-cloud-storage gcloud bitbucket-api

我正在尝试使用bitbucket管道在google云存储桶中部署我的第一个应用程序,但是在google cloud控制台中出现以下错误。

ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1
ERROR
The command '/bin/sh -c yarn install --production || ((if [ -f yarn-error.log ]; then cat yarn-error.log; fi) && false)' returned a non-zero code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Found incompatible module
error acp-web@1.0.0: The engine "node" is incompatible with this module. Expected version "9.11.1". Got "9.11.2"
[1/5] Validating package.json...
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
yarn install v1.15.2
---> Running in c25c801a41d0
Step 5/6 : RUN yarn install --production || ((if [ -f yarn-error.log ]; then cat yarn-error.log; fi) && false)
---> 9a31a847bb75
[...]

基本上,我在React Js中有一个应用程序需要部署在Google云端中,我已经成功解决了所有错误,但是目前我没有得到什么问题

bitbucket-pipeline.yml

image: node:10.15.1

pipelines:
  default:
    - step:
        name: Build and Test
        script:
          - npm install
          - npm test
    - step:
        name: Deploy
        script:
          - pipe: atlassian/google-app-engine-deploy:0.2.1
            variables:
              KEY_FILE: $KEY_FILE
              PROJECT: '[project-name] is here'

app.yaml

env: flex
runtime: custom
api_version: 1
threadsafe: true
handlers:
- url: /(.*\.(html|css|js|png|jpg|woff|json))
  static_files: dist/\1
  upload: dist/(.*\.(html|css|js|png|jpg|woff|json))
- url: /.*
  static_files: dist/index.html
  upload: dist/index.html
- url: /
  static_dir: build
skip_files:
- node_modules/
- ^\.git/.*
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- ^(.*/)?.*\.bak$

我只是想将此应用程序部署到Google云应用引擎中

3 个答案:

答案 0 :(得分:1)

按照此行,它似乎使用了错误版本的node.js:

error acp-web@1.0.0: The engine "node" is incompatible with this module. Expected version "9.11.1". Got "9.11.2"

不过,您正在管道中指定10.15.1。您可以确保为您的项目应用正确的版本吗?

答案 1 :(得分:0)

app.yaml 文件中,您需要提及:

runtime: nodejs

答案 2 :(得分:0)

在我的案例中,有人在同一项目中使用yarn和npm。一旦我进入了仓库并运行了npm安装程序,它就更新了一些软件包,之后docker工作流程就很好了。