Skip to content

Commit

Permalink
azure cli gh action
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle committed Oct 24, 2024
1 parent 3128887 commit 67a5e65
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 24 deletions.
14 changes: 14 additions & 0 deletions .github/actions/install-azure-cli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Install azure-cli
description: Installs the azure cli.
runs:
using: composite
steps:
- name: install azure-cli
run: |
sudo apt-get install -y ca-certificates curl apt-transport-https lsb-release gnupg
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update
sudo apt-get install -y azure-cli=2.64.0
shell: bash
46 changes: 46 additions & 0 deletions .github/actions/templatize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Azure CLI, Go, and Make'
description: 'Install Azure CLI, Go, and Make, and run a script'
runs:
using: 'composite'
steps:
- name: 'Prepare workspace'
run: mkdir -p /workspace/bin

- name: 'Copy Azure CLI'
uses: docker://mcr.microsoft.com/azure-cli:2.64.0
with:
args: |
/bin/bash -c "
cp -r /usr/local/bin/az /workspace/bin/ &&
cp -r /usr/local/az /workspace/bin/
"
volumes:
- name: workspace
path: /workspace

- name: 'Build templatize'
uses: docker://golang:1.23
with:
args: |
/bin/bash -c "
go build -o /workspace/templatize ./tooling/templatize
"
env:
GO111MODULE: 'on'
volumes:
- name: workspace
path: /workspace

- name: 'Install Make'
run: |
sudo apt-get update
sudo apt-get install -y make
- name: 'Run script'
run: ${{ inputs.script }}
shell: bash

inputs:
script:
description: 'The script to run'
required: true
24 changes: 12 additions & 12 deletions .github/workflows/aro-hcp-dev-bicep-what-if.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ jobs:
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Install Azure CLI
uses: ./.github/actions/install-azure-cli

- name: 'Deployment What If'
uses: azure/cli@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # v2.1.0
with:
azcliversion: 2.63.0
inlineScript: |
dev-infrastructure/make ${DEPLOY_ENV} acr.what-if
dev-infrastructure/make ${DEPLOY_ENV} acr-svc.what-if
dev-infrastructure/make ${DEPLOY_ENV} acr-ocp.what-if
dev-infrastructure/make ${DEPLOY_ENV} region.what-if
dev-infrastructure/make ${DEPLOY_ENV} svc.what-if
dev-infrastructure/make ${DEPLOY_ENV} mgmt.what-if
dev-infrastructure/make ${DEPLOY_ENV} metrics-infra.what-if
dev-infrastructure/make ${DEPLOY_ENV} image-sync.what-if
run: |
dev-infrastructure/make ${DEPLOY_ENV} acr.what-if
dev-infrastructure/make ${DEPLOY_ENV} acr-svc.what-if
dev-infrastructure/make ${DEPLOY_ENV} acr-ocp.what-if
dev-infrastructure/make ${DEPLOY_ENV} region.what-if
dev-infrastructure/make ${DEPLOY_ENV} svc.what-if
dev-infrastructure/make ${DEPLOY_ENV} mgmt.what-if
dev-infrastructure/make ${DEPLOY_ENV} metrics-infra.what-if
dev-infrastructure/make ${DEPLOY_ENV} image-sync.what-if
24 changes: 12 additions & 12 deletions .github/workflows/cs-pr-bicep-what-if.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ jobs:
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Install Azure CLI
uses: ./.github/actions/install-azure-cli

- name: 'Deployment What If'
uses: azure/cli@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # v2.1.0
with:
azcliversion: 2.63.0
inlineScript: |
dev-infrastructure/make ${DEPLOY_ENV} acr.what-if
dev-infrastructure/make ${DEPLOY_ENV} acr-svc.what-if
dev-infrastructure/make ${DEPLOY_ENV} acr-ocp.what-if
dev-infrastructure/make ${DEPLOY_ENV} region.what-if
dev-infrastructure/make ${DEPLOY_ENV} svc.what-if
dev-infrastructure/make ${DEPLOY_ENV} mgmt.what-if
dev-infrastructure/make ${DEPLOY_ENV} metrics-infra.what-if
dev-infrastructure/make ${DEPLOY_ENV} image-sync.what-if
run: |
dev-infrastructure/make ${DEPLOY_ENV} acr.what-if
dev-infrastructure/make ${DEPLOY_ENV} acr-svc.what-if
dev-infrastructure/make ${DEPLOY_ENV} acr-ocp.what-if
dev-infrastructure/make ${DEPLOY_ENV} region.what-if
dev-infrastructure/make ${DEPLOY_ENV} svc.what-if
dev-infrastructure/make ${DEPLOY_ENV} mgmt.what-if
dev-infrastructure/make ${DEPLOY_ENV} metrics-infra.what-if
dev-infrastructure/make ${DEPLOY_ENV} image-sync.what-if

0 comments on commit 67a5e65

Please sign in to comment.