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

Create a release in Octopus Deploy octopusdeploy-create-release

Create a release in Octopus Deploy

arguments

  • CHANNEL - Name or ID of the channel to use
  • GIT_COMMIT - Git Commit Hash; Specify this in addition to Git Reference if you want to reference a commit other than the latest for that branch/tag.
  • GIT_REF - Git Reference e.g. refs/heads/main. Only relevant for config-as-code projects
  • IGNORE_EXISTING - If a release with the same version exists, do nothing instead of failing.
  • OCTOPUS_ACCESS_TOKEN - Access token for octopus deploy (required when OCTOPUS_API_KEY is not provided)
  • OCTOPUS_API_KEY - API key for octopus deploy (required when OCTOPUS_ACCESS_TOKEN is not provided)
  • OCTOPUS_SPACE - Workspace for octopus deploy (required)
  • OCTOPUS_URL - URL of the octopus deploy server (required)
  • PACKAGES - Version specification a specific packages. Format as {package}:{version}, {step}:{version} or {package-ref-name}:{packageOrStep}:{version}
  • PACKAGE_VERSION - Default version to use for all Packages
  • PROJECT - The name of the project associated with this release (required)
  • RELEASE_NOTES - Release notes to attach
  • RELEASE_NOTES_FILE - Release notes to attach (from file)
  • RELEASE_NUMBER - The release number to create (optional)

returns

  • RELEASE - The release version that was created
    create-release:
  type: octopusdeploy-create-release
  arguments:
    OCTOPUS_API_KEY: '${{OCTOPUS_API_KEY}}'
    OCTOPUS_URL: '${{OCTOPUS_URL}}'
    OCTOPUS_SPACE: Spaces 1
    PROJECT: Project Name

  
    create-release:
  type: octopusdeploy-create-release
  arguments:
    OCTOPUS_API_KEY: '${{OCTOPUS_API_KEY}}'
    OCTOPUS_URL: '${{OCTOPUS_URL}}'
    OCTOPUS_SPACE: Spaces 1
    PROJECT: Project Name
    RELEASE_NUMBER: 1.0.0
    CHANNEL: Channel Name
    GIT_REF: refs/heads/main
    GIT_COMMIT: Commit ID
    PACKAGE_VERSION: 1.0.0
    PACKAGES:
      - 'Package:1.0.0'
    RELEASE_NOTES: This is a release note
    RELEASE_NOTES_FILE: /release-notes.txt
    IGNORE_EXISTING: false

  
    login:
  type: octopusdeploy-login
  arguments:
    ID_TOKEN: '${{ID_TOKEN}}'
    OCTOPUS_URL: '${{OCTOPUS_URL}}'
    OCTOPUS_SERVICE_ACCOUNT_ID: '${{OCTOPUS_SERVICE_ACCOUNT_ID}}'
create-release:
  type: octopusdeploy-create-release
  arguments:
    OCTOPUS_ACCESS_TOKEN: '${{OCTOPUS_ACCESS_TOKEN}}'
    OCTOPUS_URL: '${{OCTOPUS_URL}}'
    OCTOPUS_SPACE: Spaces 1
    PROJECT: Project Name

  
    login:
  type: octopusdeploy-login
  arguments:
    ID_TOKEN: '${{ID_TOKEN}}'
    OCTOPUS_URL: '${{OCTOPUS_URL}}'
    OCTOPUS_SERVICE_ACCOUNT_ID: '${{OCTOPUS_SERVICE_ACCOUNT_ID}}'
create-release:
  type: octopusdeploy-create-release
  arguments:
    OCTOPUS_ACCESS_TOKEN: '${{OCTOPUS_ACCESS_TOKEN}}'
    OCTOPUS_URL: '${{OCTOPUS_URL}}'
    OCTOPUS_SPACE: Spaces 1
    PROJECT: Project Name
    RELEASE_NUMBER: 1.0.0
    CHANNEL: Channel Name
    GIT_REF: refs/heads/main
    GIT_COMMIT: Commit ID
    PACKAGE_VERSION: 1.0.0
    PACKAGES:
      - 'Package:1.0.0'
    RELEASE_NOTES: This is a release note
    RELEASE_NOTES_FILE: /release-notes.txt
    IGNORE_EXISTING: false

  
github.com
OctopusDeploy
Nov 4, 2024