updated text
This commit is contained in:
Родитель
3fba42b720
Коммит
6d528b887d
|
@ -3,8 +3,6 @@ $playbooksChanged = (Get-Item env:playbooksChanged).value
|
|||
$playbookFilesList = (Get-Item env:playbookFilesList).value
|
||||
$mainTemplateOrCreateUiDefinitionTemplateChanged = (Get-Item env:mainTemplateOrCreateUiDefinitionTemplateChanged).value
|
||||
|
||||
Write-Host "List all playbook files $playbookFilesList"
|
||||
|
||||
$isDataConnectorFolderNameWithSpace = (Get-Item env:isDataConnectorFolderNameWithSpace).value
|
||||
$dataConnectorFileNames = (Get-Item env:dataConnectorFileNames).value
|
||||
$hasDataConnectorFileChanged = (Get-Item env:hasDataConnectorFileChanged).value
|
||||
|
@ -12,10 +10,17 @@ $hasDataConnectorFileChanged = (Get-Item env:hasDataConnectorFileChanged).value
|
|||
Import-Module '/dist/armttk/arm-ttk/arm-ttk.psd1'
|
||||
$MainTemplatePath = './dist/Package'
|
||||
|
||||
ls ./
|
||||
Write-Host "AA"
|
||||
ls ./dist/
|
||||
Write-Host "BB"
|
||||
ls ./dist/Playbooks
|
||||
Write-Host "CC"
|
||||
|
||||
# RUN FOR MAINTEMPLATE.JSON FILE
|
||||
if ($mainTemplateOrCreateUiDefinitionTemplateChanged -eq $true)
|
||||
{
|
||||
Write-Host "Running ARM-TTK on MainTemplate.json and/or CreateUiDefinition.json file as change is identified those files."
|
||||
Write-Host "Running ARM-TTK on MainTemplate.json and/or CreateUiDefinition.json file, as change is identified those files."
|
||||
$MainTemplateTestResults = Test-AzTemplate -TemplatePath $MainTemplatePath
|
||||
$MainTemplateTestPassed = $MainTemplateTestResults | Where-Object { -not $_.Failed }
|
||||
Write-Output $MainTemplateTestPassed
|
||||
|
@ -34,7 +39,7 @@ if ($mainTemplateOrCreateUiDefinitionTemplateChanged -eq $true)
|
|||
# Data Connector file change
|
||||
if ($hasDataConnectorFileChanged -eq $true)
|
||||
{
|
||||
Write-Host "Running ARM-TTK on Data Connectors Folder, '$dataConnectorFileNames' files as change is identified those file"
|
||||
Write-Host "Running ARM-TTK on Data Connectors Folder, '$dataConnectorFileNames' files, as change is identified those file"
|
||||
$dataConnectorFolderName = "Data Connectors"
|
||||
if($isDataConnectorFolderNameWithSpace -ne $true)
|
||||
{
|
||||
|
|
|
@ -89,7 +89,7 @@ jobs:
|
|||
|
||||
if ($hasPlaybooksChanged -eq $true)
|
||||
{
|
||||
$playbooksBasePath = "/home/runner/work/packagingrepo/packagingrepo/Solutions/$sName/Playbooks/"
|
||||
$playbooksBasePath = "/home/runner/work/Azure-Sentinel/Azure-Sentinel/Solutions/$sName/Playbooks/"
|
||||
$filteredPlaybookFiles = $playbookFilesList.Split(" ")
|
||||
Write-Host "Filtered Playbook Files are $filteredPlaybookFiles"
|
||||
$finalizedPlaybookFiles = @()
|
||||
|
@ -106,23 +106,18 @@ jobs:
|
|||
{
|
||||
if ($isDataConnectorFolderNameWithSpace -eq $true)
|
||||
{
|
||||
$dataConnectorBasePath = "/home/runner/work/packagingrepo/packagingrepo/Solutions/$sName/Data Connectors/"
|
||||
$dataConnectorBasePath = "/home/runner/work/Azure-Sentinel/Azure-Sentinel/Solutions/$sName/Data Connectors/"
|
||||
}
|
||||
else
|
||||
{
|
||||
$dataConnectorBasePath = "/home/runner/work/packagingrepo/packagingrepo/Solutions/$sName/DataConnectors/"
|
||||
$dataConnectorBasePath = "/home/runner/work/Azure-Sentinel/Azure-Sentinel/Solutions/$sName/DataConnectors/"
|
||||
}
|
||||
|
||||
Write-Host "DC Path $dataConnectorBasePath"
|
||||
$finalizedDataConnectorFilesList = @()
|
||||
foreach($dataConnectorFileItem in $dataConnectorFileNames)
|
||||
{
|
||||
Write-Host "Inside of DC foreach loop $dataConnectorFileItem"
|
||||
if ($dataConnectorFileItem.Contains(".json"))
|
||||
{
|
||||
Write-Host "Inside of if condition of json"
|
||||
$finalizedDataConnectorFilesList += $dataConnectorFileItem.Replace($dataConnectorBasePath, '')
|
||||
}
|
||||
$finalizedDataConnectorFilesList += $dataConnectorFileItem.Replace($dataConnectorBasePath, '')
|
||||
}
|
||||
|
||||
Write-Host "Data connector finalized file name is $finalizedDataConnectorFilesList"
|
||||
|
@ -141,13 +136,14 @@ jobs:
|
|||
Write-Output "::set-output name=dataConnectorFileNames::$finalizedDataConnectorFilesList"
|
||||
Write-Output "::set-output name=isDataConnectorFolderNameWithSpace::$isDataConnectorFolderNameWithSpace"
|
||||
|
||||
# Keeping this for furture use if required
|
||||
# - uses: actions/download-artifact@v2
|
||||
# id: downloadArtifactsInDocker
|
||||
# if: ${{ success() && steps.step1.outcome == 'success' && steps.step1.outputs.solutionName != '' && (steps.step1.outputs.hasPlaybooksChanged == 'true' || steps.step1.outputs.mainTemplateOrCreateUiDefinitionTemplateChanged == 'true' || steps.step1.outputs.hasDataConnectorFileChanged == 'true' ) }}
|
||||
# with:
|
||||
# path: dist
|
||||
# - run: docker images
|
||||
# - run : cp /home/runner/work/packagingrepo/packagingrepo/.github/actions/entrypoint.ps1 ./dist
|
||||
# - run : cp /home/runner/work/Azure-Sentinel/Azure-Sentinel/.github/actions/entrypoint.ps1 ./dist
|
||||
|
||||
# - uses: docker/login-action@v1
|
||||
# id: dockerRegistry
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"metadata": {
|
||||
|
@ -26,7 +26,7 @@
|
|||
"type": "string",
|
||||
"metadata": {
|
||||
"description": "Workspace name for Log Analytics where Microsoft Sentinel is setup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"workbook1-name": {
|
||||
"type": "string",
|
||||
|
|
Загрузка…
Ссылка в новой задаче