-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Auto rollout #4
Changes from all commits
2ae7a6d
dbeb8d8
9af35ca
737a3b9
b886548
79d6255
33b4edc
06c1490
2475874
1fcf328
7cc8fc9
8d7a6dc
8c8471f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ configuration_path=${7} | |
enable_otel_config_write_back=${8} | ||
configuration_output_dir=${9} | ||
token=${10} | ||
enable_auto_rollout=${11} | ||
|
||
# This branch name will be compared to target_branch to determine if the action | ||
# should apply or write back configurations. | ||
|
@@ -157,7 +158,29 @@ main() { | |
bindplane apply "$destination_path" | ||
|
||
echo "Applying configuration path: $configuration_path" | ||
bindplane apply "$configuration_path" | ||
bindplane apply "$configuration_path" > configuration.out | ||
cat configuration.out | ||
|
||
# When auto rollout is enabled | ||
if [ "$enable_auto_rollout" = true ]; then | ||
echo "Auto rollout enabled." | ||
awk '{print $2}' < configuration.out | while IFS= read -r config | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This loops through each line in the file. The file looks like this:
Awk is used to grab the second column, which would be the config name with the version suffix. This allows us to do a |
||
do | ||
status=$(bindplane rollout status "${config}" -o json | jq .status) | ||
case "$status" in | ||
0) | ||
echo "Configuration ${config} has a pending rollout, triggering rollout." | ||
bindplane rollout start "$config" | ||
;; | ||
4) | ||
echo "Configuration ${config} is stable, skipping rollout." | ||
;; | ||
*) | ||
echo "Configuration ${config} has an unknown status, skipping rollout." | ||
;; | ||
esac | ||
done | ||
fi | ||
|
||
# When write back is enabled, write the raw otel configs | ||
# back to the repository. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capture the output in configuration.out to be used later. Cat it out so it is still visable in the action output.