Bitbucket Pipelines: How to create a release with release notes

I am successfully using an example from Bitbucket to create a release within Octopus Cloud from Bitbucket Pipelines

However what I’m not able to find any specific documentation for is how to supply release notes when a release is created

I’ve attempted the following, guessing at the RELEASE_NOTES and RELEASE_NOTES_FILE variables names after reading Create release | Documentation and Support. However neither seem to work

  - step:
       name: Create release in Octopus Deploy
       script:
        # Read SemVer into variable
        - export SEMVER=$(<version.txt)
        - export RELEASE_NOTES=$(<release-notes.md)
        - pipe: octopusdeploy/octopus-cli-run:0.23.0
          variables:
            CLI_COMMAND: 'create-release'
            OCTOPUS_SERVER: $OCTOPUS_SERVER
            OCTOPUS_APIKEY: $OCTOPUS_API_KEY
            OCTOPUS_SPACE: $OCTOPUS_SPACE
            PROJECT: $OCTOPUS_PROJECT
            RELEASE_NUMBER: $SEMVER
            # RELEASE_NOTES: $RELEASE_NOTES
            RELEASE_NOTES_FILE: 'release-notes.md'
            DEBUG: 'false'

Hi Peter,

Thanks for reaching out on our community forums! I am sorry you’re having trouble with the release notes in your bitbucket pipeline.

In your pipeline script, you’ll want to use the tag specified in the create release documentation. If you use --releaseNotesFile instead of the release_notes_file, you should have better luck.

Thanks for the response @brent_kinney

I’m not using the Octopus CLI directly, instead I’m using the Octopus CLI pipe

This means I’m not able to specify arguments to the CLI directly. Instead I have to use the variables that are exposed by the pipe.

Hi Peter,

Thanks for that clarification. We have a blog post that goes over setting up Bitbucket pipelines and integrating with Octopus. You might find the Push Build Information to Octopus section helpful as it offers some sample pipeline steps, and full build information bash script, that shows how to push build info to Octopus using Bitbucket pipelines.

Lastly, the entire sample pipeline YAML from that blog post is available on that page as well and might help you structure your pipeline steps. I know that this YAML is very similar to the one you originally posted but it might help to follow it better by referencing the blog post.

Hopefully, this helps.

Thanks,
Brent

Thanks @brent_kinney

Whilst reading the Bitbucket link you supplied, I found details of the EXTRA_ARGS parameter which I’ve been able to successfully use to include the release notes

  - step:
       name: Create release in Octopus Deploy
       script:
        # Read SemVer into variable
        - export SEMVER=$(<version.txt)
        - export RELEASE_NOTES=$(<release-notes.md)
        - pipe: octopusdeploy/octopus-cli-run:0.23.0
          variables:
            CLI_COMMAND: 'create-release'
            OCTOPUS_SERVER: $OCTOPUS_SERVER
            OCTOPUS_APIKEY: $OCTOPUS_API_KEY
            OCTOPUS_SPACE: $OCTOPUS_SPACE
            PROJECT: $OCTOPUS_PROJECT
            RELEASE_NUMBER: $SEMVER
            EXTRA_ARGS: ['--releaseNotesFile', '$BITBUCKET_CLONE_DIR/release-notes.md']
            DEBUG: 'false'

Hey Peter,
Awesome! Glad you got it working. If anything else comes up, don’t hesitate to reach out again on the community forums or with an email to support@octopus.com.

Happy Deployments!

Brent

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.