简体   繁体   中英

ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1

I am trying to deploy my first app in google cloud bucket by using bitbucket pipeline, but I am getting the following error in google cloud console.

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
[...]

Basically, I have an app in React Js which need to be deploy in google cloud, I have resolved all the bugs successfully, but at this time I am not getting what is the issue

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$

I just wanna deploy this app into google cloud app engine

It appears to be using the incorrect version of node.js, as per this line:

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

You're specifying 10.15.1 in your pipeline, though. Can you ensure that the proper version is being applied for your project?

In my case there were people using yarn and npm in the same project. Once I went into the repo and ran npm install it updated a few packages and the docker workflow was fine after.

In app.yaml file, you need to mention:

runtime: nodejs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM