skip to Main Content

I have reactJs application and using AWS s3 to deploy static site. I’ve setup AWS code build for CI/CD. I’m using bitbucket and when any PR merge to master branch Web-hook comes into picture to trigger react application build and upload build on s3.

It was working fine for last 2 years but in last build I got a below error.

W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging [email protected]
E: The repository ‘https://dl.yarnpkg.com/debian stable InRelease’ is not signed.

[Container] 2021/02/04 07:39:02 Command did not exit successfully
apt-get update exit status 100 [Container] 2021/02/04 07:39:02 Phase
complete: INSTALL State: FAILED [Container] 2021/02/04 07:39:02 Phase
context status code: COMMAND_EXECUTION_ERROR Message: Error while
executing command: apt-get update. Reason: exit status 100

Here is the full log output.

enter image description here

here is the buildspec.yml file

# aws codebuild for React and deployment to S3
version: 0.2
phases:
  install:
    runtime-versions:
      nodejs: 10
    commands:
      - echo Installing build dependencies...
      - apt-get update
      - apt-get install -y sshpass zip unzip
  pre_build:
    commands:
      - echo Build started on `date`
      - echo Installing source NPM dependencies...
      - npm ci
      - cp src/gatsby-overrides/gatsby-sharp.js node_modules/gatsby-plugin-sharp/index.js
      - cp src/gatsby-overrides/gatsby-image.js node_modules/gatsby-image/index.js
  build:
    commands:
      - npm run build
      - chmod u+x script.sh
      - ./script.sh
    finally:
      - echo Build completed on `date`
cache:
  paths:
    - 'public/**/*'

2

Answers


  1. The signing key it complains about on line 82, what happens when you install it before apt update? Like suggested here: https://github.com/yarnpkg/yarn/issues/7866

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
    
    Login or Signup to reply.
  2. Worked for me without sudo. Below command worked:

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search