From f77c049b7c522a064ae95edab5e94e6702bee5aa Mon Sep 17 00:00:00 2001 From: otherview Date: Mon, 16 Oct 2023 16:40:11 +0100 Subject: [PATCH 1/2] Fixes Upgrade list query --- .github/workflows/manual-upgrade-testnet-l2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-upgrade-testnet-l2.yml b/.github/workflows/manual-upgrade-testnet-l2.yml index 780c7b0b80..9f62f28c57 100644 --- a/.github/workflows/manual-upgrade-testnet-l2.yml +++ b/.github/workflows/manual-upgrade-testnet-l2.yml @@ -77,7 +77,7 @@ jobs: - name: 'Fetch latest VM hostnames by env tag and extract build number' id: fetch_hostnames run: | - VM_HOSTNAME=$(az vm list --query "[?tags.${{vars.RESOURCE_TAG_NAME}}=='true'].{Name:name}[0]" -g Testnet -o tsv) + VM_HOSTNAME=$(az vm list --query "[?tags.\"${{vars.RESOURCE_TAG_NAME}}\"=='true'].{Name:name}[0]" -g Testnet -o tsv) VM_BUILD_NUMBER=$(echo $VM_HOSTNAME | perl -ne 'if (/(-[0-9]{1}-)(\d+)/) { print $2 }') # Extract build number from VM hostname, e.g. D-0-321 -> 321 echo "VM_BUILD_NUMBER=${VM_BUILD_NUMBER}" >> $GITHUB_ENV echo "VM_HOSTNAME: ${VM_HOSTNAME}" From 3f91f0825178b6e6fd8504527e4adb585fb767b2 Mon Sep 17 00:00:00 2001 From: otherview Date: Mon, 16 Oct 2023 17:00:17 +0100 Subject: [PATCH 2/2] Wraps all tag listing --- .../workflows/manual-deploy-obscuro-gateway-database.yml | 4 ++-- .github/workflows/manual-deploy-obscuro-gateway.yml | 4 ++-- .github/workflows/manual-deploy-testnet-l1.yml | 6 +++--- .github/workflows/manual-deploy-testnet-l2.yml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/manual-deploy-obscuro-gateway-database.yml b/.github/workflows/manual-deploy-obscuro-gateway-database.yml index f8dff0b827..5ae8e4f05e 100644 --- a/.github/workflows/manual-deploy-obscuro-gateway-database.yml +++ b/.github/workflows/manual-deploy-obscuro-gateway-database.yml @@ -60,14 +60,14 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{env.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag \"${{env.RESOURCE_TAG_NAME}}\"=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true # This will clean up any lingering dependencies - might fail if there are no resources to cleanup - name: 'Delete VMs dependencies' uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{env.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag \"${{env.RESOURCE_TAG_NAME}}\"=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true - name: 'Create VM for Gateway database node on Azure' diff --git a/.github/workflows/manual-deploy-obscuro-gateway.yml b/.github/workflows/manual-deploy-obscuro-gateway.yml index d94ee70296..4054a18c68 100644 --- a/.github/workflows/manual-deploy-obscuro-gateway.yml +++ b/.github/workflows/manual-deploy-obscuro-gateway.yml @@ -77,14 +77,14 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{env.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag \"${{env.RESOURCE_TAG_NAME}}\"=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true # This will clean up any lingering dependencies - might fail if there are no resources to cleanup - name: 'Delete VMs dependencies' uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{env.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag \"${{env.RESOURCE_TAG_NAME}}\"=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true - name: 'Create VM for Gateway node on Azure' diff --git a/.github/workflows/manual-deploy-testnet-l1.yml b/.github/workflows/manual-deploy-testnet-l1.yml index b7ca94b874..ee5d85ea1c 100644 --- a/.github/workflows/manual-deploy-testnet-l1.yml +++ b/.github/workflows/manual-deploy-testnet-l1.yml @@ -85,14 +85,14 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{env.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag \"${{env.RESOURCE_TAG_NAME}}\"=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true # This will clean up any lingering dependencies - might fail if there are no resources to cleanup - name: 'Delete VMs dependencies' uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{env.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag \"${{env.RESOURCE_TAG_NAME}}\"=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true - name: 'Create VM for "${{env.RESOURCE_NAME}}-${{ GITHUB.RUN_NUMBER }}" on Azure' @@ -102,7 +102,7 @@ jobs: az vm create -g Testnet -n "${{env.RESOURCE_NAME}}-${{ GITHUB.RUN_NUMBER }}" \ --admin-username obscurouser --admin-password "${{ secrets.OBSCURO_NODE_VM_PWD }}" \ --public-ip-address-dns-name "${{ env.RESOURCE_NAME }}" \ - --tags ${{env.RESOURCE_TAG_NAME}}=true \ + --tags \"${{env.RESOURCE_TAG_NAME}}\"=true \ --vnet-name ${{env.RESOURCE_NAME}}-01VNET --subnet ${{env.RESOURCE_NAME}}-01Subnet \ --size Standard_D3_v2 --image Canonical:0001-com-ubuntu-server-jammy:22_04-lts:latest \ --public-ip-sku Basic --authentication-type password diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 4ea71928b7..69e9d0a385 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -119,14 +119,14 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{vars.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag \"${{vars.RESOURCE_TAG_NAME}}\"=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true # This will clean up any lingering dependencies - might fail if there are no resources to cleanup - name: 'Delete VMs dependencies' uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{vars.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag \"${{vars.RESOURCE_TAG_NAME}}\"=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true - name: 'Upload L1 deployer container logs' uses: actions/upload-artifact@v3