Skip to content

Instantly share code, notes, and snippets.

@rick-roche
rick-roche / purge_acr.sh
Created July 27, 2021 16:30
Purge images from all repositories in an Azure Container Registry
#!/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 July 11, 2021 12:25
Azure - Lint, validate, create infra in Azure from Bicep templates
#!/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 13:15
Azure Pipelines and Dependabot
schedules:
- cron: "0 4 * * 1"
displayName: 'Weekly Run'
always: true
branches:
include:
- main
trigger: none
@rick-roche
rick-roche / template-README.md
Last active March 21, 2018 09:06
A template to start a README with, stolen liberally from https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

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