everyone, I am currently attempting to build a CodePipeline between my git repository and an S3 bucket for my Angular application but can't seem to get a build to pass. Specifically, I am getting the error in the title.
Essentially, I followed step for step this guide: https://medium.com/faun/ci-cd-with-angular-8-github-and-aws-codepipeline-b83d2b01e594
And for the most part everything went as described in the guide. However, there is a part where it says to modify the S3_Bucket attribute in the buildspec. I'll post below an example of what mine looks like (url name changed, but format is the same.)
Based on the error, I feel like that is probably where the issue is but I can't seem to get the url in a format that will make the build be successful.
version: 0.2
env:
variables:
CACHE_CONTROL: "86400"
S3_BUCKET: "NOTMYACTUALDOMAIN.com.s3-website.us-east-2.amazonaws.com"
BUILD_FOLDER: "dist"
phases:
install:
runtime-versions:
nodejs: 10
commands:
- echo Installing source NPM dependencies...
- npm install
- npm install -g @angular/cli
build:
commands:
Here's the Phase Table of the build if that helps at all.
SUBMITTED Succeeded<1 sec Oct 26, 2019 1:41 AM Oct 26, 2019 1:41 AM
QUEUED Succeeded<1 sec Oct 26, 2019 1:41 AM Oct 26, 2019 1:41 AM
PROVISIONING Succeeded 12 secs Oct 26, 2019 1:41 AM Oct 26, 20191:41 AM
DOWNLOAD_SOURCE Failed CLIENT_ERROR: invalid S3 ARN for primary source 3 secs Oct 26, 2019 1:41 AM Oct 26, 2019 1:41 AM
FINALIZING Succeeded 4 secsOct 26, 2019 1:41 AM Oct 26, 2019 1:41 AM
COMPLETED Succeeded
Are you trying to start the build from CodeBuild directly? Since the build project was created via CodePipeline, its Source is set as CODEPIPELINE [1] which means the Build project cannot be invoked by itself (it will not have a Source in that case) and must be invoked through CodePipeline (e.g. via "Release Change" button on CodePipeline Console). In the latter case, CodePipeline will provide the primary source artifact to the Build project.
[1] "source-type" - https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html#create-project-cli
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With