diff --git a/scripts/bump_integration.sh b/scripts/bump_integration.sh index 5170dfa2b9..3a7fcfbaaa 100755 --- a/scripts/bump_integration.sh +++ b/scripts/bump_integration.sh @@ -4,8 +4,8 @@ set -euo pipefail export MANIFEST_PATH="packages/cloud_security_posture/manifest.yml" export CHANGELOG_PATH="packages/cloud_security_posture/changelog.yml" export INTEGRATION_REPO="elastic/integrations" -export BRANCH="bump-to-$NEXT_CLOUDBEAT_VERSION" -MAJOR_MINOR_CLOUDBEAT=$(echo "$NEXT_CLOUDBEAT_VERSION" | cut -d. -f1,2) +export BRANCH="bump-to-$CURRENT_CLOUDBEAT_VERSION" +MAJOR_MINOR_CLOUDBEAT=$(echo "$CURRENT_CLOUDBEAT_VERSION" | cut -d. -f1,2) export MAJOR_MINOR_CLOUDBEAT @@ -20,11 +20,11 @@ checkout_integration_repo() { get_next_integration_version() { current_version=$(yq '.[0].version' changelog.yml | tr -d '"') preview_number="${current_version##*-preview}" - preview_number="${preview_number##*(0)}" # Remove leading zeros + preview_number="${preview_number##*(0)}" ((next_preview_number = preview_number + 1)) next_preview_number_formatted=$(printf "%02d" "$next_preview_number") NEXT_INTEGRATION_VERSION="${current_version%-*}-preview${next_preview_number_formatted}" - + echo "• Next integration version: $NEXT_INTEGRATION_VERSION" export NEXT_INTEGRATION_VERSION } @@ -35,8 +35,8 @@ update_manifest_version_vars() { # cis_aws + vuln_mgmt_aws echo "• Update cloudformation-* in manifest.yml" - sed -i'' -E "s/cloudformation-cnvm-[0-9]+\.[0-9]+\.[0-9]+/cloudformation-cnvm-$NEXT_CLOUDBEAT_VERSION/g" $MANIFEST_PATH - sed -i'' -E "s/cloudformation-cspm-ACCOUNT_TYPE-[0-9]+\.[0-9]+\.[0-9]+/cloudformation-cspm-ACCOUNT_TYPE-$NEXT_CLOUDBEAT_VERSION/g" $MANIFEST_PATH + sed -i'' -E "s/cloudformation-cnvm-[0-9]+\.[0-9]+\.[0-9]+/cloudformation-cnvm-$CURRENT_CLOUDBEAT_VERSION/g" $MANIFEST_PATH + sed -i'' -E "s/cloudformation-cspm-ACCOUNT_TYPE-[0-9]+\.[0-9]+\.[0-9]+/cloudformation-cspm-ACCOUNT_TYPE-$CURRENT_CLOUDBEAT_VERSION/g" $MANIFEST_PATH # cis_azure echo "• Update cloudshell_git_branch in manifest.yml" @@ -86,7 +86,7 @@ update_changelog_version() { checkout_integration_repo get_next_integration_version -update_manifest_version_vars update_manifest_version -update_changelog_version +update_manifest_version_vars create_integrations_pr +update_changelog_version