We have 2 reports
- Repo 1
- Repo 2
Inside Repo 1 > package.json there is a dependency
"dependencies": {
"repo-2": "git+https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo-2/"
}
Then, inside CodeBuild for "repo-1", we have the following buildspec
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- mkdir -p ./deploy
build:
commands:
- echo "Server copy START $(date)"
- cp -r ./index.js ./deploy/index.js
- cp -r ./package.json ./deploy/package.json
- cp -r ./buildspec.yml ./deploy/buildspec.yml
- echo "Server copy END $(date)"
- echo "Server npm install START $(date)"
- cd ./deploy && npm install --production
- echo "Server npm install END $(date)"
post_build:
commands:
artifacts:
files:
- '**/*'
base-directory: 'deploy'
The error CodeBuild throws is the following
npm ERR! fatal: unable to access 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo-2/': The requested URL returned error: 403
Basically, the question is: Can I use CodeCommit repo as npm dependency and what is the proper way to do it?
Try #1
I tried to add this (and similar variations) but no success https://medium.com/@ngchiwang/aws-npm-install-private-codecommit-module-8512c3203c37
#Try 2
I also tried to change the dependency URL to this
"repo-2": "git://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo-2"
But gettings the following error
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fatal: unable to connect to git-codecommit.us-east-1.amazonaws.com:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: git-codecommit.us-east-1.amazonaws.com[0: 52.94.233.146]: errno=Connection refused