Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
21

kostis-codefresh/newest-dockerhub-tag kostis-codefresh/newest-dockerhub-tag

Finds the newest tag of a dockerhub image according to semantic versioning.

arguments

  • BASE_IMAGE - name of Dockerhub image

returns

  • NEWEST_TAG - Newest tag that was found in Dockerhub
    version: '1.0'
steps:
  find_newest_dockerhub_tag:
    title: Finding newest tag of Ubuntu
    type: kostis-codefresh/newest-dockerhub-tag
    arguments:
      BASE_IMAGE: ubuntu
  print_tag:
    title: Printing newest tag
    image: alpine
    commands:
      - echo $NEWEST_TAG
      - 'echo ${{steps.find_newest_dockerhub_tag.output.NEWEST_TAG}}'

  
github.com
Kostis Kapelonis
Apr 27, 2020