I have an AWS CodeBuild process kicking off whenever I check code into master branch of my GitHub repo. My codebase is a dotnet core serverless application. I have a dependency on a private nuget package residing in GitHub Package Repository. My CodeBuild process is failing when trying to find the package:
error NU1101: Unable to find package datastop.io.data-dictionary.
No packages exist with this id in source(s): nuget.org
datastop.io.data-dictionary
is a private nuget package residing in GitHub Package Repository, not in nuget.org. It appears from the error message the CodeBuild process is attempting to find 'datastop.io.data-dictionary' in nuget.
Here's my current buildspec.yml file:
version: 0.2
phases:
install:
runtime-versions:
dotnet: 2.1
commands:
- echo Entered the install phase...
- export PATH="$PATH:/root/.dotnet/tools"
- dotnet tool install -g Amazon.Lambda.Tools
pre_build:
commands:
- echo Entered the pre_build phase...
- dotnet restore
build:
commands:
- echo Entered the build phase...
- echo Build started on `date`
- cd $FOLDER
- dotnet lambda package --configuration release --framework netcoreapp2.1 -o ./$ZIPPED_APPLICATION
- aws cloudformation package --template-file infrastructure.yml --s3-bucket $S3_DEPLOYMENT_BUCKET --output-template-file packaged-infrastructure.yml --region us-east-2
- aws cloudformation deploy --template-file packaged-infrastructure.yml --stack-name $CLOUDFORMATION_STACK_NAME --capabilities CAPABILITY_IAM --region us-east-2
The build process is failing while running dotnet restore
.
I'm assuming I need to modify my buildspec.yml file somehow to let the build process know to look at the correct package repository (our private GitHub Package Repository). How do I modify my buildspec.yml file to point to the appropriate GitHub Package Repository when trying to find datastop.io.data-dictionary
package?