Questions tagged [buildspec]
55 questions
1
vote
0 answers
Running parallel builds in codebuild
I am trying to run commands in parallel in codebuild using the batch-list function, however, I cannot get it to work as intended. The commands are getting executed sequentially and not in parallel. Below is the buildspec file.
version: 0.2
phases:
…

Bhargav Mg
- 337
- 4
- 12
1
vote
1 answer
How to set a custom Build Version in AWS CodeBuild
I am trying to set an environmental variable in a format of YYYY.MM.DD.BuildId for versioning binaries, but I cannot seem to figure out how to do this. I need it available from the buildspec.yml file to reference in the compiler commands. It…

Jeremy Holovacs
- 22,480
- 33
- 117
- 254
1
vote
1 answer
How to add files from S3 bucket to output artifacts in AWS CodePipeline? (NodeJS)
I am using a AWS CodePipeline which fetches the source from my git repository, uses CodeBuild buildSpec to build and save output artifacts to S3 bucket, which ultimately gets deployed to Elastic BeanStalk (NodeJS Environment).
Everything works fine…

saibbyweb
- 2,864
- 2
- 27
- 48
0
votes
0 answers
CodeBuild - build the latest commit only
I have successfully configured my CodeBuild CI project to source from GitHub using webhooks, and I've recently introduced automated tests with S3 caching into my workflow. However, this has led to a significant increase in build times, especially…

Lucas
- 3,517
- 13
- 46
- 75
0
votes
0 answers
How to refer to buildspec files from CDK code?
I am currently building a codepipeline using AWS CDK in which I am making use of multiple codebuild projects for different codebuild actions that are part of several codepipeline stages. I have separate build specification files for each of the…

Prerak Jain
- 13
- 1
- 5
0
votes
0 answers
AWS CodeCommit buildspec, is it possible to use an environmental variable for a secrets manager key?
In my buildspec.yaml, I want to use an environmental variable, for example, "$ASPNETCORE_ENVIRONMENT", for a key of secrets manager. Also, I want to convert a value of the environment variable to upper case.
I tried the following, but it…

Yoo Matsuo
- 2,361
- 2
- 28
- 41
0
votes
0 answers
How to install node 16 inside of a buildspec yaml's install step within an Alpine Linux container?
I have a buildspec (v 0.2) file that will be deployed and built using CodeBuild. Inside of my deploy file I am using a very specific image (cant be changed) and it is an alpine linux container. In there, I need to run some npm commands in the build…

CodeConnoisseur
- 1,452
- 4
- 21
- 49
0
votes
0 answers
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: GITHUB_TOKEN
DB_SECRET:
secretsmanager:…

Shanika Ediriweera
- 1,975
- 2
- 24
- 31
0
votes
1 answer
Create invalidation for multiple AWS CloudFront distributions in a loop
I have a list of CloudFront distributions that need to be invalidated. I have made the list using this command:-
dist_id=$(aws cloudfront list-distributions --query…

Sh4dy
- 143
- 2
- 15
0
votes
1 answer
How to get CodeBuild project name from buildspec file
This is my buildspec file to build an Angular, React, Vue or similar project through AWS CodeCommit and publish the resulting artifact to an S3 bucket:
version: 0.2
env:
variables:
S3_BUCKET: "my-bucket"
phases:
install:
…

Hugo
- 1,662
- 18
- 35
0
votes
0 answers
CodeBuild with parallel builds
I'm using CodeBuild with this syntax in buildspec:
version: 0.2
phases:
pre_build:
commands:
- pwd
build:
commands:
- echo "hi" && sleep 50
- echo "hi" && sleep 20
batch:
fast-fail: false
build-list:
…

Danny88
- 1
- 1
0
votes
0 answers
COMMAND_EXECUTION_ERROR AWS CodeBuild
I am trying to setup a s3 bucket and github account to create a pipeline in aws codepipeline service. I am getting an error I can't seem to find. It seems to be related to the NPM Install command, but not sure why. Can someone help…
0
votes
0 answers
Pass env vars from CodeBuild to EKS configmap?
I have Angular app building in CodeBuild and pushed to ECR where EKS is using it. In configmap I have settings.json file and my pod is looking for this file. I want to create another file named env.ts and want to pass to this file env vars from…

Danny88
- 1
- 1
0
votes
0 answers
How to setup buildspec.yml file for two different repositories?
I have setup a cicd pipeline using AWS Codepipeline and AWS CodeBuild. Right now my application's frontend and backend are present in different repositories. I have two source stages in my Codepipeline. Now I want to build both frontend image and…

Rehan Shakeel
- 3
- 3
0
votes
1 answer
CodeBuild: Always run the 'artifacts' phase regardless of success or failure
I'm using an Jenkins pipeline to trigger AWS CodeBuild, and in my buildspec I run some tests that I wish to publish as artefacts so that they can be downloaded and read by Jenkins.
When all of my tests pass, this works just fine. However, when one…

David Gard
- 11,225
- 36
- 115
- 227