package com.freeleaps.devops.enums

enum ImageBuilderTypes {
  DOCKER_IN_DOCKER("dind", "docker:dind"),
  KANIKO("kaniko", "gcr.io/kaniko-project/executor:latest")

  final String builder
  final String image

  ImageBuilderTypes(String builder, String image) {
    this.builder = builder
    this.image = image
  }

  static ImageBuilderTypes parse(String builder) {
    switch (builder) {
      case 'dind':
        return ImageBuilderTypes.DOCKER_IN_DOCKER
      case 'kaniko':
        return ImageBuilderTypes.KANIKO
      default:
        return null
    }
  }
}