Question:
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 yarn@dan.cx
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.
here is the buildspec.yml
file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# 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/**/*' |
Answer:
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
1 2 |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - |