Skip to content

Commit f00f73d

Browse files
committed
chore: netlify script
1 parent e9ba8b3 commit f00f73d

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

scripts/cancel-all-netlify-builds.sh

+21-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env bash
22

3-
function cancelSiteDeploy() #sideId
3+
function cancelSiteDeploy() #siteId
44
{
5-
local sideId=$1
6-
readarray -t builds < <(netlify api listSiteDeploys -d '{ "site_id": "'$sideId'", "state": "new"}' | jq --compact-output '.[]')
5+
local siteId=$1
6+
readarray -t builds < <(netlify api listSiteDeploys -d '{ "site_id": "'$siteId'", "state": "new"}' | jq --compact-output '.[]')
77
for build in "${builds[@]}"
88
do
99
local name=$(jq -r .name <<< $build)
1010
local branch=$(jq -r .branch <<< $build)
11-
if [[ "$branch" == "dev" || "$branch" == "master" || "$branch" == "feat/lang-direction" || "$branch" == "feat/devtools-neo" ]]; then
11+
if ! [[ "$branch" =~ ^dependabot/ || "$branch" =~ ^renovate/ ]]; then
1212
continue;
1313
fi
1414
echo "Cancelling build for $name $branch"
@@ -17,14 +17,21 @@ function cancelSiteDeploy() #sideId
1717
}
1818

1919
# netlify api listSites | jq '. | map([.name, .id])'
20-
v2Site="86d94ae8-f655-46a4-a859-d68696173f3a"
21-
v2Uni="085e1305-e434-4d36-91a4-88e8cbc3aa46"
22-
v2DevtoolsTestnet="7b25b1a8-5fd4-41f7-8fd0-7fe4202229fb"
23-
v2Neo="46f40014-ff00-4a9a-a1a2-4fefeeb1606a"
24-
v2ContractsSite="dd8bc215-e054-407f-92ef-d61511720928"
20+
sites=(
21+
# v2Testnet
22+
"86d94ae8-f655-46a4-a859-d68696173f3a"
23+
# v2DevtoolsTestnet
24+
"7b25b1a8-5fd4-41f7-8fd0-7fe4202229fb"
25+
# v2Uni
26+
"085e1305-e434-4d36-91a4-88e8cbc3aa46"
27+
# v2Neo
28+
"46f40014-ff00-4a9a-a1a2-4fefeeb1606a"
29+
# v2DevtoolsNeo
30+
"45cc81df-58a8-46cb-902f-1ccd3314ec70"
31+
# v2ContractsSite
32+
"dd8bc215-e054-407f-92ef-d61511720928"
33+
)
2534

26-
cancelSiteDeploy $v2Site
27-
cancelSiteDeploy $v2DevtoolsTestnet
28-
cancelSiteDeploy $v2Uni
29-
cancelSiteDeploy $v2Neo
30-
cancelSiteDeploy $v2ContractsSite
35+
for site in "${sites[@]}"; do
36+
cancelSiteDeploy $site
37+
done

0 commit comments

Comments
 (0)