From 7fa34bc749ff31008680f5d113ad958a73d84e07 Mon Sep 17 00:00:00 2001 From: jpoole Date: Mon, 7 Dec 2020 11:51:20 +0000 Subject: [PATCH] Label k8s and docker targets to easily find them --- docker/docker.build_defs | 10 +++++----- k8s/k8s.build_defs | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docker/docker.build_defs b/docker/docker.build_defs index 58eaa26..6db30ae 100644 --- a/docker/docker.build_defs +++ b/docker/docker.build_defs @@ -51,7 +51,7 @@ def docker_image(name:str, srcs:list=[], image:str=None, version:str='', cmd = f'echo -n "{repo}/{image}:{version}" >> $OUT', outs = [f'{name}_fqn'], deps = [f'{base_image}_fqn' if base_image else None], - labels = labels, + labels = labels + ["docker-fqn"], stamp = True, visibility = visibility, test_only = test_only, @@ -93,7 +93,7 @@ def docker_image(name:str, srcs:list=[], image:str=None, version:str='', deps = [docker_build], visibility = visibility, test_only = test_only, - labels = labels, + labels = labels + ["docker-run"], ) # docker push @@ -104,7 +104,7 @@ def docker_image(name:str, srcs:list=[], image:str=None, version:str='', deps = [docker_build], visibility = visibility, test_only = test_only, - labels = labels, + labels = labels + ["docker-push"], ) # The TAR rule defines an output file for _save so it can be retrivable later @@ -114,7 +114,7 @@ def docker_image(name:str, srcs:list=[], image:str=None, version:str='', cmd = f'echo -n "" >> $OUT', outs = [f'{name}.tar'], deps = [f'{base_image}_fqn' if base_image else None], - labels = labels, + labels = labels + ["docker-tar"], stamp = True, visibility = visibility, test_only = test_only, @@ -128,7 +128,7 @@ def docker_image(name:str, srcs:list=[], image:str=None, version:str='', deps = [docker_build, tar], visibility = visibility, test_only = test_only, - labels = labels, + labels = labels + ["docker-save"], ) return docker_build diff --git a/k8s/k8s.build_defs b/k8s/k8s.build_defs index 651e503..34348e9 100644 --- a/k8s/k8s.build_defs +++ b/k8s/k8s.build_defs @@ -94,6 +94,7 @@ def k8s_config(name:str, srcs:list, containers:list=[], params:dict=None, visibi name = name + '_push', cmd = ' && '.join([f'kubectl apply -f $(out_location {x})' for x in rules]), deps = rules, + labels = ["k8s-push"], ) # Generate a rule to cleanup the configs. @@ -101,5 +102,6 @@ def k8s_config(name:str, srcs:list, containers:list=[], params:dict=None, visibi name = name + '_cleanup', cmd = ' && '.join([f'kubectl delete --ignore-not-found -f $(out_location {x})' for x in rules]), deps = rules, + labels = ["k8s-cleanup"], ) return files