Dynamic step image name

Hi,

I would like to get a dynamic docker image name for a given step. It works with ${DRONE_BRANCH} variable but not with a custom “build param” which seems to be only available in step environment.

pipeline:
  build:
    image: foo/bar-${OS_VERSION}-buildimage:${DRONE_BRANCH}
    commands:
      - date

=> ok

pipeline:
  build:
    image: foo/bar-${OS_VERSION}-buildimage:${CUSTOM_BUILD_PARAM}
    commands:
      - date

=> not ok

It seems that the custom build param passed through downstream plugin or drone cli is not available during the yaml parsing phase.

Is there a way to achieve this ?

Thanks

1 Like