1
1
#! /usr/bin/env bash
2
2
3
- function cancelSiteDeploy() # sideId
3
+ function cancelSiteDeploy() # siteId
4
4
{
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 ' .[]' )
7
7
for build in " ${builds[@]} "
8
8
do
9
9
local name=$( jq -r .name <<< $build )
10
10
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
12
12
continue ;
13
13
fi
14
14
echo " Cancelling build for $name $branch "
@@ -17,14 +17,21 @@ function cancelSiteDeploy() #sideId
17
17
}
18
18
19
19
# 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
+ )
25
34
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