Skip to content

Instantly share code, notes, and snippets.

@rick-roche
rick-roche / purge_acr.sh
Created Jul 27, 2021
Purge images from all repositories in an Azure Container Registry
View purge_acr.sh
#!/bin/bash
#
# Params
# $1 - the name of the Azure Container Registry
# $2 - the name of the subscription housing the ACR
# $3 - specifies that the latest x number of to-be-deleted tags are retained. E.g. 10
# See https://docs.microsoft.com/en-za/azure/container-registry/container-registry-auto-purge
# $4 - a Go-style duration string to indicate a duration beyond which images are deleted. E.g 90d
# See https://docs.microsoft.com/en-za/azure/container-registry/container-registry-auto-purge
#
@rick-roche
rick-roche / infra.sh
Created Jul 11, 2021
Azure - Lint, validate, create infra in Azure from Bicep templates
View infra.sh
#!/bin/bash
RG=replace-with-your-rg
SUB=replace-with-your-sub
op=$1 # lint, validate, create
main_shared=$2
if [ "$main_shared" == 'main' ]; then path='./infra' && filename='main.bicep'; fi
if [ "$main_shared" == 'shared' ]; then path='./shared-infra' && filename='*.bicep'; fi
lint () {
@rick-roche
rick-roche / azure-pipelines.yml
Created May 31, 2021
Azure Pipelines and Dependabot
View azure-pipelines.yml
schedules:
- cron: "0 4 * * 1"
displayName: 'Weekly Run'
always: true
branches:
include:
- main
trigger: none
@rick-roche
rick-roche / template-README.md
Last active Mar 21, 2018
A template to start a README with, stolen liberally from https://gist.github.com/PurpleBooth/109311bb0361f32d87a2
View template-README.md

Project Title

project description

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites