forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
68 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env bash | ||
|
||
function docker_prune() | ||
{ | ||
colima delete --force | ||
rm -rf ~/.colima ~/.docker | ||
|
||
colima start --dns 1.1.1.1 --dns 8.8.8.8 --runtime docker --cpu 6 --vm-type vz --vz-rosetta | ||
docker run --privileged --rm tonistiigi/binfmt --install linux/arm | ||
docker run --privileged --rm tonistiigi/binfmt --install linux/mips64le | ||
docker image rm tonistiigi/binfmt | ||
|
||
exit | ||
} | ||
|
||
function pre() | ||
{ | ||
rm -rf arts/* | ||
} | ||
|
||
function main() | ||
{ | ||
rm -f result?.log | ||
tmux new-window -d -k -t 3 -n "build" \ | ||
' | ||
./build.sh mips build |& tee -a result3.log ; | ||
./build.sh arm64 build |& tee -a result3.log ; | ||
' | ||
tmux new-window -d -k -t 4 -n "build" \ | ||
' | ||
./build.sh x86_64 build |& tee -a result4.log | ||
./build.sh arm build |& tee -a result4.log | ||
' | ||
} | ||
|
||
function post() | ||
{ | ||
local _i _q | ||
for (( _i = 0 ; _i < 10 ; _i++ )); do | ||
docker image ls | sort | ||
if [[ "$(docker image ls | grep "^telegraf" | wc -l)" -ge 100 ]]; then | ||
break | ||
fi | ||
tmux select-window -t 3 ; sleep 25 | ||
tmux select-window -t 4 ; sleep 25 | ||
tmux select-window -t 2 | ||
read -e -t 10 -p "Stop [y/N]: " _q | ||
if [[ "${_q}" == "y" ]]; then | ||
break | ||
fi | ||
done | ||
|
||
cd arts | ||
file telegraf.* > o | ||
cd .. | ||
diff old/o arts/ | ||
} | ||
|
||
pre | ||
[[ ${#} -eq 0 ]] || docker_prune | ||
main | ||
post |