Skip to content

Commit

Permalink
Add nats-server version for release-notes
Browse files Browse the repository at this point in the history
  • Loading branch information
winkingturtle-vmw committed May 6, 2024
1 parent 7740ff6 commit c1202c6
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
19 changes: 19 additions & 0 deletions nats-release/pipelines/nats-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,21 @@ jobs:
input_mapping:
release-repo: release-branch

- task: get-nats-server-version
image: image
file: ci/shared/tasks/run-command-for-repo/linux.yml
params:
CMD: |
export COMMAND_OUTPUT=$PWD/../command-output
cd src/code.cloudfoundry.org
echo "## ✨ Built with $(go list -m github.com/nats-io/nats-server/v2)" > $COMMAND_OUTPUT/nats-version.md
- task: build-release-notes-nats
image: image
file: ci/shared/tasks/build-release-notes/linux.yml
input_mapping:
previous-github-release: github-release
extra-metadata: command-output

- name: ship-it
serial: true
Expand All @@ -527,6 +537,15 @@ jobs:
input_mapping:
release-repo: release-branch

- task: get-nats-server-version
image: image
file: ci/shared/tasks/run-command-for-repo/linux.yml
params:
CMD: |
export COMMAND_OUTPUT=$PWD/../command-output
cd src/code.cloudfoundry.org
echo "## ✨ Built with $(go list -m github.com/nats-io/nats-server/v2)" > $COMMAND_OUTPUT/nats-version.md
- task: build-release-notes-nats
image: image
file: ci/shared/tasks/build-release-notes/linux.yml
Expand Down
14 changes: 14 additions & 0 deletions shared/tasks/run-command-for-repo/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
platform: linux

inputs:
- name: ci
- name: repo

outputs:
- name: command-output

params:
CMD:
run:
path: ci/shared/tasks/run-command-for-repo/task.bash
7 changes: 7 additions & 0 deletions shared/tasks/run-command-for-repo/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
readme: |
This task will run a generic command for a repo and output can be saved to command-output
oses:
- linux
params:
CMD: Multiline command to run
19 changes: 19 additions & 0 deletions shared/tasks/run-command-for-repo/task.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -eEu
set -o pipefail

THIS_FILE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export TASK_NAME="$(basename $THIS_FILE_DIR)"
source "$THIS_FILE_DIR/../../../shared/helpers/helpers.bash"
unset THIS_FILE_DIR

function run(){
pushd "repo" > /dev/null

eval "${CMD}"

popd > /dev/null
}

run "$@"

0 comments on commit c1202c6

Please sign in to comment.