Skip to content

update workflow#6

update workflow#6 #55

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: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
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
run: |
pwsh -Command `
./helpers/GenerateResourcesAndImage.ps1 `
-subscription-id ${{ secrets.AZURE_SUBSCRIPTION_ID }} `
-resource-group-name "ETN-ES-EAS-DEVSECOPS-PACKER" `
-image-type "Windows2022CoverityBase" `
-azure-location "East US" `
-azure-client-id ${{ secrets.AZURE_CLIENT_ID }} `
-azure-client-secret ${{ secrets.AZURE_CLIENT_SECRET }} `
-azure-tenant-id ${{ secrets.AZURE_TENANT_ID }} `
-virtual-network-name "vnet-yukon-sbx-eus" `
-virtual-network-resource-group-name "ETN-ES-Yukon-Infra-Primary" `
-virtual-network-subnet-name "AppSubnet" `
-gallery-name "etn_packer_gallery" `
-ReuseResourceGroup
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}