Skip to content

Commit

Permalink
chore: netlify script
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Dec 20, 2024
1 parent e9ba8b3 commit f00f73d
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions scripts/cancel-all-netlify-builds.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash

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

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

cancelSiteDeploy $v2Site
cancelSiteDeploy $v2DevtoolsTestnet
cancelSiteDeploy $v2Uni
cancelSiteDeploy $v2Neo
cancelSiteDeploy $v2ContractsSite
for site in "${sites[@]}"; do
cancelSiteDeploy $site
done

0 comments on commit f00f73d

Please sign in to comment.