Skip to content

Instantly share code, notes, and snippets.

@Pyrrha
Pyrrha / circleci-blink1-watcher.py
Last active November 15, 2023 23:34
Watcher CircleCI using blink(1) appliance
# Usage: CIRCLE_TOKEN=x CIRCLE_WATCHER_ORG=y CIRCLE_WATCHER_PROJECT=z python main.py
from blink1.blink1 import Blink1
from pycircleci.api import Api, CIRCLE_TOKEN
import os
import time
ORG = os.environ["CIRCLE_WATCHER_ORG"]
PROJECT = os.environ["CIRCLE_WATCHER_PROJECT"]
@Pyrrha
Pyrrha / version_updater.py
Created January 3, 2024 16:09
Version updater in Python
#!/usr/bin/env python
import argparse
import re
pattern = "^(.*)(\d+).(\d+).(\d+)(.*)$"
def isVersion(arg, pattern=pattern):
if not re.match(pattern, arg):
raise argparse.ArgumentTypeError("invalid version pattern. Should match: [prefix]x.y.z[suffix]")