File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -eo pipefail
3+ set -xeo pipefail
44
55VERSION_SEPERATOR=" -"
66[[ ${CIRRUS_RELEASE:- } != " " ]] && VERSION_SEPERATOR=" +"
77
8- LAST_TAG =$( gh api " /repos/{owner}/{repo}/releases?per_page=2 " --jq " . [1].tag_name" )
8+ PREVIOUS_RELEASE =$( gh api " /repos/{owner}/{repo}/releases" --jq " [.[] | select(.target_commitish== \" ${CIRRUS_BRANCH} \" )] [1].tag_name" )
99
10- [ -z " $LAST_TAG " ] && LAST_TAG=" HEAD" || echo $LAST_TAG
10+ # There MIGHT be a some edge case where PREVIOUS_RELEASE shouldn't be HEAD,
11+ # for example, releasing a patch for non-LTA. To be investigated.
12+ [[ -z " ${PREVIOUS_RELEASE} " ]] && PREVIOUS_RELEASE=" HEAD" || echo " ${PREVIOUS_RELEASE} "
1113
12- echo $( ct list-changed --since $LAST_TAG )
14+ echo $( ct list-changed --since " ${PREVIOUS_RELEASE} " --target-branch " ${CIRRUS_BRANCH} " )
1315
14- for chart in $( ct list-changed --since $LAST_TAG ) ; do
16+ for chart in $( ct list-changed --since " ${PREVIOUS_RELEASE} " --target-branch " ${CIRRUS_BRANCH} " ) ; do
1517 _original_version=$( cat $chart /Chart.yaml | yq ' .version' -)
16- _new_version=" $_original_version$ VERSION_SEPERATOR$ BUILD_NUMBER "
17- helm dependency build $ chart
18- helm package --version $ _new_version $ chart
19- done
18+ _new_version=" ${ _original_version}${ VERSION_SEPERATOR}${ BUILD_NUMBER} "
19+ helm dependency build " ${ chart} "
20+ helm package --version " ${ _new_version} " " ${ chart} "
21+ done
You can’t perform that action at this time.
0 commit comments