Skip to content

running the template in noninteractive mode #63

running the template in noninteractive mode

running the template in noninteractive mode #63

name: Build Window Packer Image
on:
push:
branches:
- cem/EDODSO-979
jobs:
install-coverity:
runs-on: self-hosted
environment: Sandbox
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Create Temp Directory
run: |
mkdir -p /tmp/temp
- name: Write license to file
run: |
if [ ! -z "${{ secrets.COVERITY_LICENSE }}" ]; then echo "${{ secrets.COVERITY_LICENSE }}" | base64 -d > /tmp/temp/license.dat; else exit 1; fi
- name: Authentication on Azure
run: |
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} -p="${{ secrets.AZURE_CLIENT_SECRET }}" --tenant ${{ secrets.AZURE_TENANT_ID }}
#az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
env:
AZURE_SUBSCRIPTION_ID: 9013acaf-d6cc-4416-a9ed-7075ba759979
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_RESOURCE_GROUP: ${{ env.AZURE_RESOURCE_GROUP }}
VIRTUALNETWORK_RESOURCE_GROUP: ${{ env.VIRTUALNETWORK_RESOURCE_GROUP }}
VIRTUAL_NETWORK_NAME: ${{ env.VIRTUAL_NETWORK_NAME }}
VIRTUAL_SUBNET_NAME: ${{ env.VIRTUAL_SUBNET_NAME }}
AZURE_GALLERY_NAME: ${{ env.AZURE_GALLERY_NAME }}
AZURE_LOCATION: ${{ env.AZURE_LOCATION }}
- name: Run PowerShell Script
shell: pwsh
run: |
Import-Module .\helpers\GenerateResourcesAndImage.ps1 -Force
GenerateResourcesAndImage `
-SubscriptionId 9013acaf-d6cc-4416-a9ed-7075ba759979 `
-ResourceGroupName "ETN-ES-EAS-DEVSECOPS-PACKER" `
-ImageType "Windows2022CoverityBase" `
-AzureLocation "East US" `
-AzureClientId ${{ secrets.AZURE_CLIENT_ID }} `
-AzureClientSecret ${{ secrets.AZURE_CLIENT_SECRET }} `
-AzureTenantId ${{ secrets.AZURE_TENANT_ID }} `
-VirtualNetworkName vnet-yukon-sbx-eus `
-VirtualNetworkResourceGroupName "ETN-ES-Yukon-Infra-Primary" `
-VirtualNetworkSubnetName AppSubnet `
-GalleryName "etn_packer_gallery" `
-ReuseResourceGroup true `
-noninteractive
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}