#!/usr/bin/env python3
import subprocess
subprocess.getoutput("git remote update")
deployed_branches = subprocess.getoutput("helm list -a -A 2>&1 | grep feature-deploy | awk '{print $2}'").split("\n")
active_branches = subprocess.getoutput("git branch -r | grep feature_deploy | sed -e 's|^ origin/||g' | sed -e 's/[^A-Za-z0-9]/-/g'").split("\n")
APP = "appname"
for branch in deployed_branches:
if branch not in active_branches:
subprocess.run(f"KUBECONFIG=./kubeconfig helm delete --wait -n {branch} {APP}", shell=True)
subprocess.run(f"KUBECONFIG=./kubeconfig kubectl delete namespace -n {branch}", shell=True)
-
-
Notifications
You must be signed in to change notification settings - Fork 0
License
opszero/actions-deploytag-cleanup
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Sponsor this project
Packages 0
No packages published