Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install missing dependency (jq) on Azure Pipeline Agents #3013

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests_e2e/pipeline/pipeline-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ steps:

rest_endpoint=$(az cloud show --query "endpoints.resourceManager" -o tsv)

pattern="${{ parameters.name_pattern }}"

az rest --method GET \
--url "${rest_endpoint}/subscriptions/${subscription_id}/resourcegroups" \
--url-parameters api-version=2021-04-01 \$expand=createdTime \
--output json \
--query value \
| jq --arg date "$date" '.[] | select (.createdTime < $date).name' \
| grep -i '${{ parameters.name_pattern }}' \
| xargs -l -t -r az group delete --no-wait -y -n \
|| echo "No resource groups found to delete"
| jq --arg date "$date" '.[] | select (.createdTime < $date).name | match("'${pattern}'"; "g").string' \
| xargs -l -t -r az group delete --subscription "${subscription_id}" --no-wait -y -n
6 changes: 5 additions & 1 deletion tests_e2e/pipeline/scripts/setup-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#

#
# Script to setup the agent VM for the Azure Pipelines agent pool; it simply installs the Azure CLI and the Docker Engine.
# Script to setup the agent VM for the Azure Pipelines agent pool; it simply installs the Azure CLI, the Docker Engine and jq.
#

set -euox pipefail
Expand Down Expand Up @@ -48,3 +48,7 @@ sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plug

# Verify that Docker Engine is installed correctly by running the hello-world image.
sudo docker run hello-world

# Install jq; it is used by the cleanup pipeline to parse the JSON output of the Azure CLI
sudo apt-get install -y jq

Loading