Skip to content

Instantly share code, notes, and snippets.

View Mishco's full-sized avatar
🎯
Focusing

Michal Slovík Mishco

🎯
Focusing
View GitHub Profile
securityContext:
privileged: true
allowPrivilegeEscalation: true
restartPolicy: Always
trigger:
paths:
include:
- '/helm/first-app'
jobs:
- job:
displayName: Install first-app via helm 3
pool:
vmImage: 'ubuntu-latest'
from collections import Counter
def get_count_of_unique_words(lines):
selected_words = []
for word in lines:
if word.isalpha():
selected_words.append(word)
unique_count = 0
for letter, count in Counter(selected_words).items():
unique_word_count = len(input_lines)
import re
WORD_PATTERN = "[a-z-A-Z]*"
selected_words = []
for word in input_lines
if len(word) > 1 and re.match(WORD_PATTERN, word).endpos > 0:
selected_words.append(word)
unique_count = len(selected_words.items())
from collections import Counter
unique_count = len(Counter(selected_words).items())
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
"variables": {},
"resources": [],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {}
}
- task: AzurePowerShell@5
displayName: Validate ARM templates
inputs:
azureSubscription: "$(dev-environment-subscription)" # ideally it should be validate in same subscription as dev, nonproduction or production
ScriptType: "FilePath"
ScriptPath: "$(System.DefaultWorkingDirectory)/validate_templates.ps1" # script basically run Test-AzResourceGroupDeployment for all templates and their parameters
ScriptArguments: '-resourceGroupName $(validation-sandbox) -location $(location) -templateDirectoryPath $(System.DefaultWorkingDirectory)\arm_templates'
azurePowerShellVersion: "LatestVersion"
FailOnStandardError: true
Test-AzResourceGroupDeployment `
-ResourceGroupName $resourceGroupName `
-TemplateFile $templateFilePath `
-TemplateParameterFile $parameterFilePath