-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
staged_rollouts/v1.54.3.txt: Expand rollout to 60%
Signed-off-by: Tobias Knöppler <[email protected]>
- Loading branch information
1 parent
bb98f59
commit 8fa19a5
Showing
2 changed files
with
71 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
#min=$((101-${1:-50})) | ||
total_count="${1?}" | ||
target_file="${2?}" | ||
all=({100..1}) | ||
cohortes=() | ||
for i in "${all[@]:0:${1?}}" | ||
|
||
while IFS="" read -r line || [ -n "$line" ] | ||
do | ||
[[ -n "$line" ]] || continue | ||
cohortes+=("$line") | ||
done < "${target_file}" | ||
|
||
cohortes_count=${#cohortes[@]} | ||
count=$(( total_count - cohortes_count )) | ||
|
||
for i in "${all[@]:0:${count}}" | ||
do | ||
cohorte_id=$((RANDOM % i)) | ||
while [[ " ${cohortes[*]} " =~ .*" ${cohorte_id} ".* ]] | ||
do | ||
cohorte_id=$((cohorte_id+1)) | ||
if [[ $cohorte_id -eq 101 ]] | ||
then | ||
cohorte_id=1 | ||
fi | ||
done | ||
cohortes+=($cohorte_id) | ||
done | ||
|
||
echo "${cohortes[*]}" | tr ' ' $'\n' | ||
(IFS=$'\n'; echo -n "${cohortes[*]}" | sort -h | head -c -1 >| "$target_file") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,60 @@ | ||
43 | ||
44 | ||
79 | ||
65 | ||
76 | ||
33 | ||
72 | ||
11 | ||
77 | ||
3 | ||
4 | ||
60 | ||
5 | ||
86 | ||
58 | ||
41 | ||
61 | ||
53 | ||
6 | ||
9 | ||
11 | ||
12 | ||
42 | ||
74 | ||
3 | ||
40 | ||
13 | ||
73 | ||
57 | ||
14 | ||
17 | ||
23 | ||
24 | ||
25 | ||
26 | ||
28 | ||
29 | ||
30 | ||
32 | ||
33 | ||
35 | ||
38 | ||
40 | ||
41 | ||
42 | ||
43 | ||
44 | ||
45 | ||
46 | ||
47 | ||
48 | ||
49 | ||
50 | ||
51 | ||
52 | ||
53 | ||
54 | ||
55 | ||
56 | ||
57 | ||
58 | ||
60 | ||
61 | ||
62 | ||
64 | ||
65 | ||
66 | ||
35 | ||
6 | ||
67 | ||
68 | ||
72 | ||
73 | ||
74 | ||
75 | ||
76 | ||
77 | ||
78 | ||
79 | ||
80 | ||
81 | ||
82 | ||
86 |