Running parallel builds in codebuild

279 Views Asked by At

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:
  pre_build:
    commands:
      - aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ECR_URI
      - aws eks update-kubeconfig --name $EKS_CLUSTER_NAME
  build:
    commands:
    - echo "hi world" && sleep 10
    - echo "hey" && sleep 20
    batch:
      fast-fail: false
      build-list:
        - identifier: build1
        - identifier: build2

Can anyone please guide me on what I am doing wrong or what am I missing here.

P.S: this is just a sample buildspec.

0

There are 0 best solutions below