Label overrides supported with the CodeBuild-hosted GitLab runner - AWS CodeBuild

Label overrides supported with the CodeBuild-hosted GitLab runner

In your GitLab CI/CD pipeline YAML, you can provide a variety of label overrides that modify your self-managed runner build. Any builds not recognized by CodeBuild will be ignored but will not fail your webhook request. For example, the following YAML includes overrides for image, instance size, fleet, and the buildspec:

workflow: name: HelloWorld stages: - build build-job: stage: build script: - echo "Hello World!" tags: - codebuild-myProject-$CI_PROJECT_ID-$CI_PIPELINE_IID-$CI_JOB_NAME - image:arm-3.0 - instance-size:small - fleet:myFleet - buildspec-override:true

codebuild-<project-name>-$CI_PROJECT_ID-$CI_PIPELINE_IID-$CI_JOB_NAME (required)

  • Example: codebuild-myProject-$CI_PROJECT_ID-$CI_PIPELINE_IID-$CI_JOB_NAME

  • Required for all GitLab CI/CD pipeline YAMLs. <project name> should be equal to the name of the project for which the self-managed runner webhook is configured.

image:<environment-type>-<image-identifier>

instance-size:<instance-size>

fleet:<fleet-name>

buildspec-override:<boolean>

  • Example: buildspec-override:true

  • Allows the build to run buildspec commands in the INSTALL, PRE_BUILD, and POST_BUILD phases if set to true.