Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
Plugin's icon
14.5K

semversioner semversioner

Operates on semver versions

arguments

  • SEMVERSIONER_ACTION - Options: 'bump' or 'compare'. Default: 'bump'
  • SEMVERSIONER_PART - Part of the semver to be bumped. Options: 'major', 'minor' and 'patch'. Default: 'patch'
  • SEMVERSIONER_VERSION - Input semver version
  • SEMVERSIONER_VERSION_TO_COMPARE - Input semver version to compare against SEMVERSIONER_VERSION

returns

  • SEMVERSIONER_RESULT - Result of the action performed. If SEMVERSIONER_ACTION is 'bump', the result will be a semver version. If the SEMVERSIONER_ACTION is 'compare', the result will be '-1', '0' or '1'
    bumpVersion:
  type: semversioner
  arguments:
    SEMVERSIONER_VERSION: 5.7.1
    SEMVERSIONER_ACTION: bump
    SEMVERSIONER_PART: major
checkVersion:
  image: alpine
  commands:
    - 'echo VERSION=${{steps.bumpVersion.output.SEMVERSIONER_RESULT}}'

  
    bumpVersion:
  type: semversioner
  arguments:
    SEMVERSIONER_VERSION: 5.7.1
    SEMVERSIONER_ACTION: compare
    SEMVERSIONER_VERSION_TO_COMPARE: 5.6.98
checkVersion:
  image: alpine
  commands:
    - 'echo COMPARISON_RESULT=${{steps.bumpVersion.output.SEMVERSIONER_RESULT}}'

  
    bumpVersion:
  type: semversioner
  arguments:
    SEMVERSIONER_VERSION: 5.7.1
    SEMVERSIONER_PART: minor

  
github.com
Francisco Cocozza
Jul 4, 2021