Skip to content

Instantly share code, notes, and snippets.

@naesheim
naesheim / update_expiry_policy.go
Last active August 29, 2023 13:38
When you create a cloud build and select pubsub as a trigger, there will be created a subscription on the assigned topic. (Usually the topic of an artifact registry) The problem is that this subscription has an expiry ttl of 31 days. After 31 days of inactivity, it will be deleted. This script iterates over projects in a given folder. It then it…
package main
import (
"context"
"log/slog"
"os"
"strings"
"sync"
pubsub "cloud.google.com/go/pubsub/apiv1"
@naesheim
naesheim / buildWhenAffected.sh
Last active November 28, 2022 20:20
CircleCi - only build features that has changed
##################
### config.yml ###
##################
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
steps: