Skip to content

Commit

Permalink
chore: release chart without version (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
JashBook authored Nov 16, 2023
1 parent bd4bb67 commit 4aa96b4
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
7 changes: 6 additions & 1 deletion .github/utils/helm_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ package_chart() {
package_flag=0
for i in {1..10}; do
echo "helm package "${args[@]}" --version $release_version --dependency-update"
ret_msg=$(helm package "${args[@]}" --version $release_version --dependency-update)
ret_msg=""
if [[ -z "$release_version" ]]; then
ret_msg=$(helm package "${args[@]}" --dependency-update)
else
ret_msg=$(helm package "${args[@]}" --version $release_version --dependency-update)
fi
echo "return message:$ret_msg"
if [[ "$ret_msg" == *"Successfully packaged"* ]]; then
echo "$(tput -T xterm setaf 2)$ret_msg$(tput -T xterm sgr0)"
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/release-charts-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,18 @@ jobs:
run: |
CHARS_DIR="${{ inputs.CHART_DIR }}"
CHARS_DIR="${CHARS_DIR%/*}"
args=()
if [[ -n "$CHARS_DIR" ]]; then
args+=(--charts-dir "$CHARS_DIR" )
fi
if [[ -n "${{ steps.get_version.outputs.VERSION }}" ]]; then
args+=(--release-version "${{ steps.get_version.outputs.VERSION }}" )
fi
args=(--charts-dir "$CHARS_DIR" \
--release-version ${{ steps.get_version.outputs.VERSION }} \
--specify-chart "${{ inputs.SPECIFY_CHART }}")
if [[ -n "${{ inputs.SPECIFY_CHART }}" ]]; then
args+=(--specify-chart "${{ inputs.SPECIFY_CHART }}" )
fi
"${{ github.workspace }}/apecloud-cd/.github/utils/helm_package.sh" "${args[@]}"
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/release-charts-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,18 @@ jobs:
run: |
CHARS_DIR="${{ inputs.CHART_DIR }}"
CHARS_DIR="${CHARS_DIR%/*}"
args=()
if [[ -n "$CHARS_DIR" ]]; then
args+=(--charts-dir "$CHARS_DIR" )
fi
if [[ -n "${{ steps.get_version.outputs.VERSION }}" ]]; then
args+=(--release-version "${{ steps.get_version.outputs.VERSION }}" )
fi
args=(--charts-dir "$CHARS_DIR" \
--release-version ${{ steps.get_version.outputs.VERSION }} \
--specify-chart "${{ inputs.SPECIFY_CHART }}")
if [[ -n "${{ inputs.SPECIFY_CHART }}" ]]; then
args+=(--specify-chart "${{ inputs.SPECIFY_CHART }}" )
fi
"${{ github.workspace }}/apecloud-cd/.github/utils/helm_package.sh" "${args[@]}"
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/release-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,18 @@ jobs:
run: |
CHARS_DIR="${{ inputs.CHART_DIR }}"
CHARS_DIR="${CHARS_DIR%/*}"
args=()
if [[ -n "$CHARS_DIR" ]]; then
args+=(--charts-dir "$CHARS_DIR" )
fi
if [[ -n "${{ steps.get_version.outputs.VERSION }}" ]]; then
args+=(--release-version "${{ steps.get_version.outputs.VERSION }}" )
fi
args=(--charts-dir "$CHARS_DIR" \
--release-version ${{ steps.get_version.outputs.VERSION }} \
--specify-chart "${{ inputs.SPECIFY_CHART }}")
if [[ -n "${{ inputs.SPECIFY_CHART }}" ]]; then
args+=(--specify-chart "${{ inputs.SPECIFY_CHART }}" )
fi
"${{ github.workspace }}/apecloud-cd/.github/utils/helm_package.sh" "${args[@]}"
Expand Down

0 comments on commit 4aa96b4

Please sign in to comment.