Skip to content

Commit

Permalink
feat(cc_image): allow setting env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
sxlijin authored Feb 25, 2022
1 parent 26e5dbb commit 3e8e206
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cc/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ DEFAULT_BASE = select({
"//conditions:default": "@cc_image_base//image",
})

def cc_image(name, base = None, deps = [], layers = [], binary = None, **kwargs):
def cc_image(name, base = None, deps = [], layers = [], env = {}, binary = None, **kwargs):
"""Constructs a container image wrapping a cc_binary target.
Args:
name: Name of the cc_image target.
base: Base image to use for the cc_image.
deps: Dependencies of the cc_image.
env: Environment variables for the cc_image.
binary: An alternative binary target to use instead of generating one.
layers: Augments "deps" with dependencies that should be put into
their own layers.
Expand Down Expand Up @@ -97,6 +98,7 @@ def cc_image(name, base = None, deps = [], layers = [], binary = None, **kwargs)
binary = binary,
visibility = visibility,
tags = tags,
env = env,
args = kwargs.get("args"),
data = kwargs.get("data"),
testonly = kwargs.get("testonly"),
Expand Down

0 comments on commit 3e8e206

Please sign in to comment.