Skip to content

Commit

Permalink
shellcheck fixes and disable
Browse files Browse the repository at this point in the history
  • Loading branch information
aerickson committed Nov 4, 2024
1 parent 1d15803 commit 84ae865
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 30 deletions.
4 changes: 3 additions & 1 deletion terraform/telegraf/docker/etc/check_vcs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

echo "["

Expand All @@ -24,7 +26,7 @@ else
#cat $tmpfile
#echo "now try that if message not found"
grep message $tmpfile 2>&1 >/dev/null || grep -A4 object $tmpfile|grep url|sed 's/^.*url.*"\(.*\)".*$/\1/'|xargs -I {} curl ${github_auth} -s -X GET {} >$tmpfile

#ls -la $tmpfile
#cat $tmpfile
#echo "now get the information from that"
Expand Down
13 changes: 8 additions & 5 deletions terraform/telegraf/docker/etc/quarantined.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

show_workers=false

prov_filter=("$@")
Expand Down Expand Up @@ -51,10 +54,10 @@ for provisioner in $provisioners; do
$show_workers && (echo $data | grep -o "workers\": \[\]" >/dev/null || echo "$comma")
# add provisioner and workerType to each worker on print
# { "provisioner":"releng-hardware",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "latestTask": { "taskId": "HDbBAeGjSVKN0Dwai4QaOA", "runId": 0 },
# "quarantineUntil": "3017-10-19T14:19:34.168Z"
# }
Expand All @@ -65,7 +68,7 @@ for provisioner in $provisioners; do
-e "s/workerGroup/provisioner\":\"${provisioner}\", \"workerType\":\"${type}\", \"workerGroup/g"
fi
count=$(echo "$data" | grep -o "workerId" | wc -l)

qcount=$(echo "$data" | sed -e 's/}, *{/},\n{/g' | grep -v scl3 | grep -o "quarantineUntil" | wc -l)
n=$(( n + count ))
quarantined=$(( quarantined + qcount ))
Expand Down
13 changes: 8 additions & 5 deletions terraform/telegraf/docker/etc/queue.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

# do not show the workers. only by provisioner
show_workers=false

Expand Down Expand Up @@ -52,10 +55,10 @@ for provisioner in $provisioners; do
$show_workers && (echo $data | grep -o "workers\": \[\]" >/dev/null || echo "$comma")
# add provisioner and workerType to each worker on print
# { "provisioner":"releng-hardware",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "latestTask": { "taskId": "HDbBAeGjSVKN0Dwai4QaOA", "runId": 0 },
# "quarantineUntil": "3017-10-19T14:19:34.168Z"
# }
Expand All @@ -66,7 +69,7 @@ for provisioner in $provisioners; do
-e "s/workerGroup/provisioner\":\"${provisioner}\", \"workerType\":\"${type}\", \"workerGroup/g"
fi
count=$(echo "$data" | grep -o "workerId" | wc -l)

qcount=$(echo "$data" | sed -e 's/}, *{/},\n{/g' | grep -v scl3 | grep -o "quarantineUntil" | wc -l)
n=$(( n + count ))
quarantined=$(( quarantined + qcount ))
Expand Down
13 changes: 8 additions & 5 deletions terraform/telegraf/docker/etc/queue2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

PATH="$PATH:$(dirname ${BASH_SOURCE[0]})"

# do not show the workers. only by provisioner
Expand Down Expand Up @@ -55,10 +58,10 @@ for provisioner in $provisioners; do
$show_workers && (echo $data | grep -o "workers\": \[\]" >/dev/null || echo "$comma")
# add provisioner and workerType to each worker on print
# { "provisioner":"releng-hardware",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "latestTask": { "taskId": "HDbBAeGjSVKN0Dwai4QaOA", "runId": 0 },
# "quarantineUntil": "3017-10-19T14:19:34.168Z"
# }
Expand All @@ -69,7 +72,7 @@ for provisioner in $provisioners; do
-e "s/workerGroup/provisioner\":\"${provisioner}\", \"workerType\":\"${type}\", \"workerGroup/g"
fi
count=$(echo "$data" | grep -o "workerId" | wc -l)

qcount=$(echo "$data" | sed -e 's/}, *{/},\n{/g' | grep -v scl3 | grep -o "quarantineUntil" | wc -l)
n=$(( n + count ))
quarantined=$(( quarantined + qcount ))
Expand Down
2 changes: 2 additions & 0 deletions terraform/telegraf/docker/etc/queue_old.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

prov_filter=("$@")
queryparams="limit=1000&quarantined=true"
Expand Down
7 changes: 5 additions & 2 deletions terraform/telegraf/docker/etc/release_cal.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

ics=$(curl -L -s -o - "https://www.google.com/calendar/ical/mozilla.com_2d37383433353432352d3939%40resource.calendar.google.com/public/basic.ics" | tee ics)

# Code from StackOverflow user Charles Duffy:
Expand Down Expand Up @@ -31,7 +34,7 @@ handle_event() {
# echo "Modified Event"
#fi
#printf '%s\t' "$(local_date DTSTART)" "$(local_date DTEND)" "${content[SUMMARY]}" "${content[LOCATION]}"; echo

version="\"$(echo "${content[SUMMARY]}" | grep -o '[0-9\.]\+ Release' | cut -d' ' -f1)\""
rel_type=""
case "${content[SUMMARY]}" in
Expand All @@ -49,7 +52,7 @@ handle_event() {
# 1543796160
# firefox_release,type=Merge,version=\"\" title=\"MERGE: B40\\, A41\\, N42\" 1543796160000000000
summary=$(echo ${content[SUMMARY]} | cut -d' ' -f1)
printf 'firefox_release,type="%s",version=%s title="%s" %s000000000\n' "$rel_type" "$version" "$summary" "$(local_date DTSTART +%s)"
printf 'firefox_release,type="%s",version=%s title="%s" %s000000000\n' "$rel_type" "$version" "$summary" "$(local_date DTSTART +%s)"
}

declare -A content=( ) # define an associative array (aka map, aka hash)
Expand Down
13 changes: 8 additions & 5 deletions terraform/telegraf/docker/etc/tc-web.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

PATH="$PATH:$(dirname ${BASH_SOURCE[0]})"

batch_limit=1000
Expand Down Expand Up @@ -98,10 +101,10 @@ exit 0
$show_workers && (echo $data | grep -o "workers\": \[\]" >/dev/null || echo "$comma")
# add provisioner and workerType to each worker on print
# { "provisioner":"releng-hardware",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "latestTask": { "taskId": "HDbBAeGjSVKN0Dwai4QaOA", "runId": 0 },
# "quarantineUntil": "3017-10-19T14:19:34.168Z"
# }
Expand All @@ -112,7 +115,7 @@ exit 0
-e "s/workerGroup/provisioner\":\"${provisioner}\", \"workerType\":\"${type}\", \"workerGroup/g"
fi
count=$(echo "$data" | grep -o "workerId" | wc -l)

qcount=$(echo "$data" | sed -e 's/}, *{/},\n{/g' | grep -v scl3 | grep -o "quarantineUntil" | wc -l)
n=$(( n + count ))
quarantined=$(( quarantined + qcount ))
Expand Down
13 changes: 8 additions & 5 deletions terraform/telegraf/docker/etc/tc-web2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

PATH="$PATH:$(dirname ${BASH_SOURCE[0]})"

batch_limit=1000
Expand Down Expand Up @@ -100,10 +103,10 @@ exit 0
$show_workers && (echo $data | grep -o "workers\": \[\]" >/dev/null || echo "$comma")
# add provisioner and workerType to each worker on print
# { "provisioner":"releng-hardware",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "workerType":"gecko-t-osx-1010",
# "workerGroup": "scl3",
# "workerId": "t-yosemite-r7-0065",
# "firstClaim": "2018-06-18T13:51:55.466Z",
# "latestTask": { "taskId": "HDbBAeGjSVKN0Dwai4QaOA", "runId": 0 },
# "quarantineUntil": "3017-10-19T14:19:34.168Z"
# }
Expand All @@ -114,7 +117,7 @@ exit 0
-e "s/workerGroup/provisioner\":\"${provisioner}\", \"workerType\":\"${type}\", \"workerGroup/g"
fi
count=$(echo "$data" | grep -o "workerId" | wc -l)

qcount=$(echo "$data" | sed -e 's/}, *{/},\n{/g' | grep -v scl3 | grep -o "quarantineUntil" | wc -l)
n=$(( n + count ))
quarantined=$(( quarantined + qcount ))
Expand Down
4 changes: 2 additions & 2 deletions terraform/telegraf/docker/etc/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
name_prefix = "proj-autophone"
json_string_fields = ["workerType"]
json_query = "workerTypes"


[[inputs.http]]
urls = [
"https://queue.taskcluster.net/v1/pending/releng-hardware/gecko-t-linux-talos",
Expand Down
3 changes: 3 additions & 0 deletions terraform/telegraf/docker/etc/treestatus.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

tmpfile=$0.tmpfile

curl -s -o - "https://treestatus.mozilla-releng.net/stack" > $tmpfile
Expand Down
3 changes: 3 additions & 0 deletions terraform/telegraf/docker/etc/workers.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# TODO: hack to get this green. don't do this.
# shellcheck disable=all

PATH="$PATH:$(dirname ${BASH_SOURCE[0]})"

prov_filter=("$@")
Expand Down

0 comments on commit 84ae865

Please sign in to comment.