Questions tagged [buildspec]
55 questions
3
votes
4 answers
buildspec.yml to push to ECR is throwing this error "Command did not exit successfully $(aws ecr get-login --no-include-email --region us-east-1)"
I am learning on the codepipeline to push the build using CodeBuild to ECR. Below is my buildspec.yml file and the error from the Codebuild logs. Can anyone shed some lights what I am doing wrong? Thanks in advance.
buildspec.yml
version:…

Shivaramane
- 81
- 2
- 4
2
votes
0 answers
How to integrate AWS CodeBuild with Python pytest-cov code coverage report in buildspec.yaml
I have a Python-based application that consists of:
Some Python source code that uses the AWS Boto3 SDK to interact with AWS resource
A Dockerfile that builds upon the AWS public.ecr.aws/lambda/python:3.9 image
An AWS SAM (Serverless Application…

Jim Tough
- 14,843
- 23
- 75
- 96
2
votes
0 answers
Codebuild: How to send JSON body to a ENV file in buildspec?
I have code that takes in a local test.env.json that is injected into the start of the test.
However, now that I am running it through codebuild and using secrets manager, if I don't have a test.env.json file then it will not run correctly.
So far I…

Steve
- 197
- 7
- 17
2
votes
1 answer
how can we get contents of a buildspec.yml file from each codebuild project through Boto3 API
I am not able to find out any function which can get the content of buildspec.yml file. what i have been able to do so far is list all the projects in my AWS account
"`"
client = boto3.client('codebuild')
response = client.batch_get_projects(
…

Sam
- 21
- 2
2
votes
1 answer
How to change nodejs file to 14 in buildspec for codebuild?
Here is my buildspec.yml file used by codebuild:
version: 0.2
env:
shell: bash
phases:
install:
runtime-versions:
nodejs: 14
pre_build:
commands:
- echo Installing source NPM dependencies...
- npm install -g aws-cdk
…

Judi
- 710
- 3
- 10
- 25
1
vote
1 answer
Parameterize s3 bucket name in buildspec.yml file
Right now I hardcoded the bucket name to cp report file to that bucket but I want to create an environment variable which can pull a specific bucket from s3 bucket list and then cp my report file to the same bucket. i have read many articles but non…

AutoMationKing
- 53
- 7
1
vote
0 answers
aws code pipeline buildspec chocolatey choco command is not recognised
My end goal is to install wixtoolset as part of AWS Code Pipeline to build a project. As part of my buildspec file, I installed Chocolatey but the subsequent command to install wixtoolset through choco command isn't working. It's throwing an error…

ChinnaR
- 797
- 3
- 9
- 24
1
vote
1 answer
CodeBuild, get the list of folders that have changed files inside them buildspec.yml
Im trying to make my first build on aws and this is my buildspec.yml, I was just testing if my command does work on codebuild
version: 0.2
env:
git-credential-helper: yes
phases:
install:
runtime-versions:
nodejs: 16
pre_build:
…

Beginner
- 1,700
- 4
- 22
- 42
1
vote
0 answers
how to run python file in buildspec.yaml using docker-compose
I am new to docker world and I've a requirement for an AWS codebuild project where I need to use selenium/hub image and Dockerfile to run some UI tests.
So far what I've done is:
Create docker-compose.yaml file to pull selenium/hub and…

Ram
- 155
- 1
- 5
1
vote
0 answers
Install and initialise google-cloud-cli in AWS CodeBuild buildspec.yml
I am trying to push docker container image built in AWS CodeBuild project to GCP Artifact Registry. In order to push image from AWS managed Ubuntu CodeBuild env, I will need to install and initialise google-cloud-cli. However, to…

NWTM
- 11
- 2
1
vote
1 answer
How to do git push from one AWS account to another AWS Account using Codebuild buildspec.yml
I have two AWS accounts, a shared service AWS Account, and a Development AWS account.
I have pushed my Glue scripts from my local git to my Development Account's codecommit repository, and am able to deploy glue jobs successfully using…

Yuva
- 2,831
- 7
- 36
- 60
1
vote
0 answers
CodeBuild get Artifact Folder Path
I am running a build through a Codebuildpipeine. I am uploading artifacts based on each stage as documented which is working fine. As you know each time a build is run the artifact folder creates a new folder for the new set of artifacts (all in…

Maxamis4
- 137
- 8
1
vote
0 answers
angular 11: image path is given from assets after `Ng build` in s3 is listing directly under `dist` folder and `dist->assets` is wont created
it is s3 location after files deployed,it shows like this buti need it like this for the path cofigured
all the assets files are out side of the assets folder and asset folder wont created.
the image path is defined by assets folder.

guna
- 11
- 2
1
vote
1 answer
Cant install SBT in AWS CodeBuild Install Phase
Im working with CodePipeline and Codebuild, when i set my buildspec.yml with the commands the process gives error while trying to add the Lines in the /etc/apt/sources.list.d/sbt.list.
version: 0.2
phases:
install:
runtime-versions:
…

Bombi
- 11
- 1
1
vote
0 answers
AWS Codebuild for Angular Project is successful with build error
I am running an AWS CodePipeline building Angular project and shifting it to a S3-Bucket. Simplified buildspec looks like that:
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
pre_build:
commands:
- echo Building…

Boerger
- 143
- 1
- 10