getporter/porter

Allow use of --custom argument for image repository, tag, and/or digest values

Opened this issue · 0 comments

madrum commented

Is your feature request related to a problem? Please describe.

  • It is cumbersome to maintain logic/scripts to update image repository, tag, and/or digest values in the porter.yaml file within a pipeline when the logic could be simplified if the porter CLI allowed setting these values with --custom arguments.
  • Scenario:
    • A pipeline builds an application and creates/pushes/tags a docker image for that application.
    • A subsequent stage of the pipeline creates a porter bundle that includes this image.
      • In order for the bundle to include the proper image, the porter.yaml must be updated with the tag used in the first stage of the pipeline run.
    • The next stage uses the porter bundle to deploy the application and dependencies in a temporary environment for an end-to-end test.

Describe the solution you'd like

  • I would like the porter CLI to allow the use of custom argument values for image repository, tag, and digest values, as described by @carolynvs in this issue discussion: #1882
  • An example snippet of the porter.yaml is below.

Describe alternatives you've considered
We currently use a script to modify the porter.yaml file before creating porter bundles.

Additional context
Example porter.yaml snippet that would allow the custom application image tag to be updated with a custom argument.

name: mybundle

custom:
  powershellImageTag: latest # 7.3.6, 7.3.5, 7.2.13
  myCustomAppImageTag: 1.2.3.4
  myCustomAppImageRepoProject: main

images:
  powershell:
    description: Basic PowerShell docker image... usually "latest", but not always
    repository: mcr.microsoft.com/powershell
    tag: ${ bundle.custom.powershellImageTag }
  my-custom-application:
    description: My custom application image where image tag changes with every build pipeline run, and repo path can vary depending on which branch the code was built from.
    repository: myacr.azurecr.io/${ bundle.custom.myCustomAppImageRepoProject }/my-custom-app
    tag: ${ bundle.custom.myCustomAppImageTag }