adobe / rules_gitops

This repository contains rules for continuous, GitOps driven Kubernetes deployments.
Apache License 2.0
174 stars 43 forks source link

Add support of bazel tags to rules_gitops #148

Closed bhmiller closed 1 year ago

bhmiller commented 1 year ago

Description

Add ability to use bazel tags on k8s_deploy targets so can use bazel tag filters on these targets to include or exclude from building.

Related Issue

https://github.com/adobe/rules_gitops/issues/144

Motivation and Context

This enables including or excluding k8s_deploy targets based on build tag filters as well as other common tag based bazel operations like bazel query.

In particular, containers can be expensive to build. I can tag my container_images and then use build tag filters to ignore building those, but if they are used in a k8s_deploy, they cannot be excluded through a tag filter.

How Has This Been Tested?

I've tested this in my own project via

Also, I added usage of tags to the helloworld example for basic smoke test of functionality

Without this change, it would fail building (bazel build --build_tag_filter=-excluded //...), while with this change, it would pass with the same command.

Types of changes

Checklist: