Skip to content

maximized MBG

maximized MBG #47

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: |
if (-Not (Test-Path -Path "C:\temp")) {
New-Item -ItemType Directory -Path "C:\temp" -Force
}
- name: Write license to file
run: |
Set-Content -Path 'C:\temp\license.dat' -Value $env:COVERITY_LICENSE -Force
cd 'C:\temp'
Get-ChildItem -Force | Select-Object -Property Mode, LastWriteTime, Length, Name
env:
COVERITY_LICENSE: ${{ secrets.COVERITY_LICENSE }}
- name: Install Coverity Client
env:
#DEVOPS_ST_SAS_TOKEN: ${{ secrets.DEVOPS_ST_SAS_TOKEN }}
COV_LICENSE: ${{ secrets.COVERITY_LICENSE }}
#AZURE_SAS_TOKEN: ${{ secrets.AZURE_SAS_TOKEN }}
AZURE_SUBSCRIPTION_ID: ${{ env.AZURE_SUBSCRIPTION_ID }}
AZURE_RESOURCE_GROUP: ${{ env.AZURE_RESOURCE_GROUP }}
AZURE_LOCATION: ${{ env.AZURE_LOCATION }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
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 }}
run: |
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} -p="${{ secrets.AZURE_CLIENT_SECRET }}" --tenant ${{ secrets.AZURE_TENANT_ID }}
Import-Module .\helpers\GenerateResourcesAndImage.ps1 -Force
#$Env:PACKER_LOG = 1
- name: Initialise Packer template
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