Questions tagged [aws-codebuild]

Describes Amazon Web Services CodeBuild questions and answers. Scope should be limited to AWS CodeBuild.

aws-codebuild
Filter by
Sorted by
Tagged with
0 votes
0 answers
147 views

How to use AWS ECR image in AWS codebuild?

I am learning CICD with AWS codebuild. I use sqitch to manage database changes in my project. I have successfully configured docker-sqitch for the Snowflake database and it is working fine in the ...
Hkachhia's user avatar
  • 4,485
0 votes
0 answers
135 views

I was building the code in CodeBuild,but getting error in UPLOAD_ARTIFACTS phase- "CLIENT_ERROR: no matching artifact paths found

I was building the code in CodeBuild,but getting error in UPLOAD_ARTIFACTS phase- CLIENT_ERROR: no matching artifact paths found". while building the artifact file location is "/var/www/html/...
Akarsha's user avatar
0 votes
1 answer
545 views

How to load environment variables from AWS secret into CodeDeploy?

We are building a CI/CD pipeline in AWS CodePipeline with the goal of sourcing code from github, building a Docker image, testing the image and deploying it to a staging server. Here is how our Build ...
Alvaro Bataller's user avatar
0 votes
0 answers
88 views

How to get the project name during aws code build?

We have our code in a repository named test and we have buildspec.yaml and test_engine folder where the source code is. In buildspec.yaml, I used a python script at post_build to upload artifacts to a ...
kadina's user avatar
  • 5,170
0 votes
1 answer
1k views

How to obtain the sonar.pullrequest.key dynamically

I am setting PR decoration for my project and I am adding the following configuration in my sonar-project.properties: sonar.pullrequest.provider=GitHub sonar.pullrequest.github.repository=<...
msaavedra91's user avatar
0 votes
1 answer
125 views

Chrome is crashing in AWS windows server 2019 while running selenium test cases

I have created a selenium project using the cucumber framework. I have feature files, TestRunner, and Testbase class in test/java file. While code is running locally and testcases are getting ...
Ujjay Hirbhagat's user avatar
0 votes
0 answers
65 views

Amazon linux container4.0 can't not run in local machine. "failed to start daemon: error initializing graphdriver: driver not supported"

Greeting : Hello, I use Amazon linux2 images to run my CI/CD with Codebuild service. And I do a lab to perpare build Amazon linxu with myself. here it the Amazon images: https://gallery.ecr.aws/...
狗狗兔兔's user avatar
1 vote
2 answers
951 views

Use AWS CodePipeline variables in a custom stage

There's the following buildspec that runs some commands and exports a variable in the end: env: exported-variables: - PROPERTY_FROM_BUILD I'd like to use this variable inside a custom pipeline ...
Hirasawa Yui's user avatar
  • 1,246
2 votes
0 answers
81 views

Module not found: Error: Can't resolve './Routes' in '/codebuild/output/src806512313/src/src'

[Container] 2023/06/02 05:14:41 Running command npm run build > [email protected] build > react-scripts build Creating an optimized production build... Failed to compile. Module not ...
weaponKing's user avatar
1 vote
0 answers
169 views

React build fails on AWS CodeBuild with TypeError in stylis-plugin-rtl

In the last days I try to build my react app throughout AWS CodeBuild and in all attempts the build fail. When I build locally in my machine the yarn build command work fine! The specs of the build ...
Yuri Stolai's user avatar
1 vote
0 answers
232 views

AWS CoPilot pass on the environment variables/secrets defined in service manifest to the build environment

Is it possible to pass on environment variables/secrets defined in service manifest to the build environment (CodeBuild in the pipeline)? variables: DBNAME: my_database secrets: GITHUB_TOKEN: ...
Shanika Ediriweera's user avatar
0 votes
0 answers
11 views

How to find the corresponding build to a deployment in aws?

I want to know, what commit is deployed, not using the pipeline. I can find the build artifact s3, but now I wonder, how I can find the corresponding build in the build history.
David's user avatar
  • 2,989
1 vote
1 answer
732 views

Running docker inside a container in AWS CodeBuild

I got a Java application. In local, I can connect to Dev Container using Visual Studio Code. Now I wanna build a CodePipeline in AWS. But it displays an error like this when I tried to start docker in ...
julanove's user avatar
  • 445
0 votes
0 answers
89 views

AWS SAM template deployed docker but failed in BUILD and POST_BUILD. when building on aws codebuild getting this error: exit status 125

Trying to build docker container using aws sam through cloudformation template. when my code is building on aws codebuild i'm getting this error: Phase context status code: COMMAND_EXECUTION_ERROR ...
Sam's user avatar
  • 1
0 votes
0 answers
95 views

AWS CodeBuild project with the same source multiple times

When trying to create a codebuild project with the same github repo used as the source I'm receiving an error from the CodeBuild API: Invalid input: conflicting source locations (Service: ...
Bob's user avatar
  • 553
0 votes
0 answers
146 views

AWS CDK v2 Invoke Lambda from Codepipeline

I need to invoke a Lambda function from AWS CDK v2. The Lambda function invalidates a Cloudfront Distribution. The Lambda function is completed and works fine. I just need to know how to call this ...
dx4100's user avatar
  • 21
0 votes
1 answer
308 views

AWS CodeBuild throws an error "CLIENT_ERROR Message: no matching artifact paths found

AWS CodeBuild throws an error "CLIENT_ERROR Message: no matching artifact paths found". I'm trying to build a docker app using CodeCommit repository, Build phase seems to be passing without ...
Kunal Koli's user avatar
0 votes
0 answers
129 views

AWS codepipeline webhooks getting triggered if the branch name contains head_ref name

I have created a project in codebuild. I want to trigger this build only when there is a push on "main" branch. I added this on my webhook source event. THis is github webhook Problem I am ...
Abdulkarim Ahmed's user avatar
0 votes
0 answers
23 views

Artifact config of AWS codebuild project not executed in AWS Code pipeline

As part of CI/CD, I have an aws codebuild project that builds a jar file and I am storing the jar file in an AWS s3 bucket using Artifact config as shown in the image and it works fine. But when i use ...
PRAM's user avatar
  • 19
0 votes
1 answer
180 views

Python subprocess not running correctly in Codebuild buildspec yml

I have a python script to update ECR images in my repo and keep a couple previous images as well in case of errors in new ones. I'm trying to run this from my buildspec yml file in Codebuild but it's ...
frktclr's user avatar
  • 11
0 votes
1 answer
374 views

Can I make Github action not to wait for CodeBuild's completion?

I have used the below in workflow.yml and set up Github actions in my project. - name: Run CodeBuild uses: aws-actions/aws-codebuild-run-build@v1 with: project-name: CodeBuildProjectName ...
Muthu's user avatar
  • 1
1 vote
1 answer
298 views

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 ...
AutoMationKing's user avatar
0 votes
0 answers
17 views

Inject secrets from codebuild into an EC2 machine

Is it possible to define a environment variable in codebuild and pass it to an Ec2 machine somehow or at least to refer to it in the appspec in codedeploy? I tried to address it by echoing the ...
David's user avatar
  • 2,989
0 votes
1 answer
130 views

How to reference a secret properly in AWS codebuild as environment variable?

When I reference a secret in codebuild as environmen variable, I use But when referring to the password: I get the following error in the build: minimum field size of 32, GetSecretValueInput....
David's user avatar
  • 2,989
0 votes
0 answers
55 views

Cross AWS account Code Pipeline deployment confusion

I am going to set up the following, but some concepts are not clear to me: AWS Account A with code pipeline setup, AWS ECR and code build to run K8s commands and deploy into AWS Account B EKS cluster. ...
OnlySlaveInMyCompany's user avatar
1 vote
0 answers
223 views

Getting error when trying to run a python script from AWS codebuild which builds an image using Docker sdk for python

I am trying to run a python script from AWS codebuild which which builds an image using Docker sdk for python. There are project specific reasons to put this code in a python file and not directly ...
Red_Coder's user avatar
0 votes
1 answer
258 views

How to get the last succesful build number from Code Build through Terraform?

I'm trying to create a Docker image where the tag is going to be the last succesful build number, and I cannot seem to find a way to doing so. This is my script resource "aws_codebuild_project&...
user avatar
0 votes
0 answers
93 views

Parameterize the source or git repo name in AWS codebuild pipeline

Is there a way to parameterize the git repo name and branch name in source stage of the AWS build pipeline. I have to run same pipeline against multiple repos and my existing setup is 1 pipeline for 1 ...
PRAM's user avatar
  • 19
0 votes
1 answer
344 views

Accessing private dockerhub repository from aws codebuild

I created a codebuild project in aws. Now I want to build a docker container and push it in the ecr. My buildspec.yaml in short looks like this: version: 0.2 phases: pre_build: commands: - ...
user732456's user avatar
  • 2,648
0 votes
0 answers
84 views

Prevent CodeBuild projects without VPC

I need to prevent AWS users from creating CodeBuild projects without the VPC set. My organization wants to prohibit creation and running of CodeBuild outside of a VPC. It's is not necessary to name ...
Michael's user avatar
  • 89
1 vote
0 answers
681 views

Run aws codebuild build only if the change occur on a specific folder

I have a small microservice app and i want to use codebuild with codepipeline to implemant a ci/cd pipeline The structure of my project looks like this: project-folder service-1 buildspec.yaml ...
laghrissi_chafik's user avatar
0 votes
0 answers
81 views

Build angular plotlyjs project using codebuild in AWS

I'm struggling to implement code pipeline for ci/cd specifically for my project in AWS. I keep having an error about plotlyjs which is actually a dependency i'm using in my application. After ...
Dev Team's user avatar
0 votes
1 answer
88 views

How od I make sure Codebuild stage never fails even if there is error?

I am trying to run 3 stages in Codebuild in parallel and I want to run Codebuild even if it fails for demonstration purposes. How do I make sure that Codebuild never fails even if exit status from ...
Jatin Mehrotra's user avatar
1 vote
1 answer
424 views

AWS CodeDeploy not extracting files before deploy

I am working with AWS CodePipeline to deploy a static website to an S3 bucket. I have the process set up and running, but my only problem is that the zip file build artifact is not being extracted ...
Football52's user avatar
1 vote
0 answers
116 views

ReadTimeout trying to connect to dynamodb-local in CodeBuild

I am trying to execute pytests that use dynamodb-local docker container in CodeBuild. I figured out how to run docker in CodeBuild by setting Privileged mode to True. The docker container gets built ...
afreeman's user avatar
2 votes
2 answers
608 views

Send entire cloudwatch logs to slack when aws codebuild is finished

I have created a lambda function that send codebuild cloudwatch logs to slack. Its working but everytime the logs is generated while codebuild is running. It is throwing messages to slack like a spam. ...
Santosh's user avatar
  • 3,655
-1 votes
1 answer
146 views

How do I automate a cloudformation.json (or yaml) file stored in codecommit to auto deploy via cloudformation

From what I can tell, if I create a buildspec.yaml, I can run it through codepipeline with a codebuild to run the cloud formation. However, to do this requires spinning up an ec2 to the execute the ...
Quadgnim's user avatar
  • 541
0 votes
1 answer
96 views

Golang migration stuck with no error message in Codebuild

When running golang migrate command, Golang migration stuck with no error message in AWS Codebuild. I am using RDS ( Aurora PostgreSQL 13.9). Do you have similar issues? I added -verbose flag but ...
myronix's user avatar
  • 21
1 vote
1 answer
590 views

AWS CodeBuild SAM esbuild method not working

I have a Lambda's API Gateway repo in CodeCommit and I build it with CLI with esbuild and it works fine (SAM BUILD and then SAM DEPLOY) I want to integrate the building process with CodePipeline, so ...
Ari Waisberg's user avatar
  • 1,246
0 votes
1 answer
770 views

AWS CodeBuild - unable to commit and push changes to the CodeCommit repository

I have a pipeline in CodePipeline that is triggered on every push to the main branch in the CodeCommit repository. The pipeline includes a Build step that executes commands that can change some files ...
Andrii Bodnar's user avatar
0 votes
0 answers
241 views

AWS codebuild issue with assuming role

Newbie here, when trying to deploy I get the following error in codebuild: An error occurred (AccessDeniedException) when calling the DescribeRepositories operation: User: arn:aws:sts::XXXXXXXXXXX:...
Ricardo Linares's user avatar
1 vote
0 answers
3k views

Docker build failure when doing COPY --from=composer (mediaType in manifest should be v2 not v1)

Preface: I'm new to docker I'm using AWS and CodeBuild to deploy my app to ECS. When it gets to this line in my Dockerfile it fails - Step 21/47 : COPY --from=composer /usr/bin/composer /usr/local/bin/...
user15638540's user avatar
1 vote
1 answer
130 views

How to change default source version for secondary source for Codebuild in terraform

i have a codebuild project defined in terraform, it has a secondary source and i'd like to specify a default branch to it (not master, but using a feature branch) From Terraform doc, looks like we can ...
wawawa's user avatar
  • 3,115
1 vote
0 answers
82 views

How to cache go dependencies for subsequent, distinct docker builds

In a AWS Codebuild project I am building docker containers for multiple services one after the other. They all use a centralized go.mod, go.sum, and vendors/modules.txt file, though in each Dockerfile,...
QWER ASDF's user avatar
0 votes
1 answer
615 views

Headless mode and HTML report generation causing playwright test failures on AWS CodeBuild

I have successfully hosted my Playwright tests on AWS CodeBuild, and the report is generated as expected when all test cases pass. However, if any test case fails, the build fails and throws an error. ...
HARI PRASAD's user avatar
3 votes
3 answers
853 views

AWS CodeBuild get Github OAuth token

My use-case: I have private GitHub repository and private GitHub NPM registry for dependencies. Repository imports dependencies from private registries. For GitHub actions CI pipeline, GitHub ...
Kirill's user avatar
  • 7,921
0 votes
2 answers
638 views

CodePipeline: Action configuration for action '2ndSource' contains unknown configuration 'PollForSourceChanges'

There is AWS CodePipeline based on two Github source. Requirement is to restrict the pipeline auto trigger for primary source only. Found this snippet from terraform aws samples to disable auto ...
Ashish Kumar's user avatar
0 votes
1 answer
343 views

Why am I getting permission denied when running a Liquibase update?

G'day, I'm running a CodeBuild job where I install the latest version of Liquibase and then run the update command. Liquibase appears to be installed however I get a permission denied when running ...
Riaz's user avatar
  • 1
1 vote
1 answer
441 views

Re-use CodeBuild instance in CodePipeline

I'm working with AWS CodePipelines and CodeBuild (through the CodeBuildAction construct). Within my pipeline, I have multiple stages each with N number of actions. I end up having multiple CodeBuild ...
Garrett's user avatar
  • 1,632
0 votes
0 answers
221 views

AWS CodeBuild DOWNLOAD_SOURCE failed - CLIENT_ERROR

I always get the following failure message whenever my build is triggered via a GitHub webhook in CodeBuild: CLIENT_ERROR: open /codebuild/output/srcDownload/src/.git/refs/remotes/origin/feature/pre-...
jack.johnson's user avatar

1 2
3
4 5
30