Skip to content

Commit

Permalink
Fix shellcheck recomendations
Browse files Browse the repository at this point in the history
  • Loading branch information
bonzofenix committed May 28, 2024
1 parent 1936380 commit dfb43f4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ci/scripts/unpause-pipeline.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
#!/usr/bin/env bash

target=$( cat ~/.flyrc | yq ".targets | keys | .[0]")
target=$(yq -r ".targets | keys | .[0]" ~/.flyrc)

function unpause-job(){
pipeline=$1
jobs=$(fly -t $target jobs -p $pipeline --json | jq ".[] | select(.paused==true) | .name" -r )
selected_job=$(gum choose --no-limit $jobs --header "Select jobs to unpause from pipeline $pipeline"
jobs=$(fly -t "$target" jobs -p "$pipeline" --json | jq ".[] | select(.paused==true) | .name" -r )
selected_job=$(gum choose --no-limit "$jobs" --header "Select jobs to unpause from pipeline $pipeline"
)

for j in $selected_job; do
fly -t $target unpause-job -j $pipeline/$j
fly -t "$target" unpause-job -j "$pipeline"/"$j"
done
}

function unpause-pipeline(){
payload=$(fly -t $target pipelines --json)
payload=$(fly -t "$target" pipelines --json)

pipelines=$(echo "$payload" | jq ".[] |.name" -r | sort)
pipeline=$(gum choose $pipelines "all")
pipeline=$(gum choose "$pipelines" "all")

if [[ "$pipeline" == "all" ]]; then
for p in $pipelines; do
fly -t $target unpause-pipeline -p $p
unpause-job $p
fly -t "$target" unpause-pipeline -p "$p"
unpause-job "$p"
done
else
fly -t $target unpause-pipeline -p $pipeline
unpause-job $pipeline
fly -t "$target" unpause-pipeline -p "$pipeline"
unpause-job "$pipeline"
fi

}
Expand Down

0 comments on commit dfb43f4

Please sign in to comment.