Skip to content

Commit

Permalink
fix integration bump
Browse files Browse the repository at this point in the history
  • Loading branch information
orouz committed Feb 14, 2024
1 parent e83f460 commit ef159fb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/bump_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
}

Expand All @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit ef159fb

Please sign in to comment.