Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev v4.0.16 #358

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ proxy_url = VALUE
| <a name="input_deployment_storage_account_name"></a> [deployment\_storage\_account\_name](#input\_deployment\_storage\_account\_name) | Name of exising deployment storage account | `string` | `""` | no |
| <a name="input_enable_application_insights"></a> [enable\_application\_insights](#input\_enable\_application\_insights) | Enable Application Insights. | `bool` | `true` | no |
| <a name="input_function_access_restriction_enabled"></a> [function\_access\_restriction\_enabled](#input\_function\_access\_restriction\_enabled) | Allow public access, Access restrictions apply to inbound access to internal vent | `bool` | `false` | no |
| <a name="input_function_app_dist"></a> [function\_app\_dist](#input\_function\_app\_dist) | Function app code dist | `string` | `"dev"` | no |
| <a name="input_function_app_dist"></a> [function\_app\_dist](#input\_function\_app\_dist) | Function app code dist | `string` | `"release"` | no |
| <a name="input_function_app_identity_name"></a> [function\_app\_identity\_name](#input\_function\_app\_identity\_name) | The user assigned identity name for the function app (if empty - new one is created). | `string` | `""` | no |
| <a name="input_function_app_log_level"></a> [function\_app\_log\_level](#input\_function\_app\_log\_level) | Log level for function app (from -1 to 5). See https://github.com/rs/zerolog#leveled-logging | `number` | `1` | no |
| <a name="input_function_app_storage_account_container_prefix"></a> [function\_app\_storage\_account\_container\_prefix](#input\_function\_app\_storage\_account\_container\_prefix) | Weka storage account container name prefix | `string` | `"weka-tf-functions-deployment-"` | no |
Expand Down
18 changes: 18 additions & 0 deletions release/calculate_next_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -ex

git checkout main
git pull
git fetch --tags
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
echo "latest tag: $latest_tag"
major=$(echo "$latest_tag" | cut -d. -f1)
major="${major:1}" # remove v
minor=$(echo "$latest_tag" | cut -d. -f2)
patch=$(echo "$latest_tag" | cut -d. -f3)
new_patch=$((patch + 1))

new_tag="v$major.$minor.$new_patch"
echo "new tag: $new_tag"
git checkout -
28 changes: 10 additions & 18 deletions release/create_draft_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,23 @@
set -ex

# This script will be called when a new content was merged to the main branch.
# It will create a new draft release with the new weka version.
# It will create a new draft release.
export new_tag="$1"

export new_weka_version="$1"
if [ -z "$new_tag" ]
then
echo "Calculating next tag"
source release/calculate_next_tag.sh
else
echo "Using provided tag: $new_tag"
fi

git checkout main
git pull
git fetch --tags
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
echo "latest tag: $latest_tag"
major=$(echo "$latest_tag" | cut -d. -f1)
major="${major:1}" # remove v
minor=$(echo "$latest_tag" | cut -d. -f2)
patch=$(echo "$latest_tag" | cut -d. -f3)
new_patch=$((patch + 1))

new_tag="v$major.$minor.$new_patch"
echo "new tag: $new_tag"
git tag "$new_tag"
git push origin "$new_tag"

if [ -z "$new_weka_version" ]
then
message="Fill release notes here."
else
message="Updated WEKA default version to $new_weka_version"
fi
message="Fill release notes here."

gh release create "$new_tag" --draft --title "$new_tag" --notes "- $message"
36 changes: 7 additions & 29 deletions release/create_new_release_branch.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
#!/bin/bash
set -ex

# By default, new terraform releases will be aligned with new weka version releases.
# This script will be used for this release flow, i.e. when a new weka release is published.
# For terraform module hot fixes we will have a different release flow.
# prerequisites: github cli: https://cli.github.com/

export new_weka_version="$1"
export new_tag="$1"
export base_branch="$2"

if [ -z "$new_weka_version" ]
if [ -z "$new_tag" ]
then
echo "Please provide the new weka version"
exit 1
echo "Calculating next tag"
source release/calculate_next_tag.sh
fi

if [ -z "$base_branch" ]
Expand All @@ -22,24 +17,7 @@ fi

git checkout "$base_branch"
git pull
git checkout -b "$base_branch-$new_weka_version"
old_weka_version=$(awk '/Weka version/{getline;print $NF;}' variables.tf | tr -d \")

file_paths=(
variables.tf
examples/existing_private_network/main.tf
examples/existing_private_network_with_peering/main.tf
)
for file_path in "${file_paths[@]}"; do
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/$old_weka_version/$new_weka_version/" "$file_path"
else
sed -i "s/$old_weka_version/$new_weka_version/" "$file_path"
fi
git add "$file_path"
done

git commit -m "chore: update weka default version: $new_weka_version"
git checkout -b "$base_branch-$new_tag"

if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/= "dev"/= "release"/' variables.tf
Expand All @@ -49,7 +27,7 @@ fi
git add variables.tf
git commit -m "chore: update function app distribution to release" || true

git push --set-upstream origin "$base_branch-$new_weka_version"
git push --set-upstream origin "$base_branch-$new_tag"
capitalized_base_branch=$(echo "$base_branch" | awk '{print toupper(substr($0, 1, 1)) tolower(substr($0, 2))}')
gh pr create --base main --title "$capitalized_base_branch $new_weka_version" --body ""
gh pr create --base main --title "$capitalized_base_branch $new_tag" --body ""
gh pr view --web
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ variable "function_app_version" {
variable "function_app_dist" {
type = string
description = "Function app code dist"
default = "dev"
default = "release"

validation {
condition = contains(["dev", "release"], var.function_app_dist)
Expand Down