Skip to content

GraphQL: Add query field to generate cloud runner provisioning script

In order to show the Terraform file that will allow the user to create a runner in GCP (and later automatically provision it), we will introduce a provisioningSteps query field.

We will leave the actual automated runner creation to a follow-up issue.

We should:

  • add validation to every argument
  • use "shell-safe" interpolation when building the script

Proposal

{
  project(fullPath: "gitlab-org/playground") {
    id
    runnerCloudProvisioning(
      provider: GOOGLE_CLOUD
      cloudProjectId: "dev-gcp-s3c-integrati-9abafed1"
    ) {
      ... on CiRunnerGoogleCloudProvisioning {
        provisioningSteps(
          region: "us-central1"
          zone: "us-central1-a"
          ephemeralMachineType: "n2d-standard-2"
          runnerToken: "glrt-Ei-AAaaaaAAAaaAA"
        ) {
          title
          languageIdentifier
          instructions
        }
      }
    }
  }
  group(fullPath: "gitlab-org") {
    id
    runnerCloudProvisioning(
      provider: GOOGLE_CLOUD
      cloudProjectId: "dev-gcp-s3c-integrati-9abafed1"
    ) {
      ... on CiRunnerGoogleCloudProvisioning {
        provisioningSteps(
          region: "us-central1"
          zone: "us-central1-a"
          ephemeralMachineType: "n2d-standard-2"
          runnerToken: "glrt-Ei-AAaaaaAAAaaAA"
        ) {
          title
          languageIdentifier
          instructions
        }
      }
    }
  }
}