Skip to content

Instantly share code, notes, and snippets.

@excavador
Created October 15, 2017 16:46
Show Gist options
  • Save excavador/4ad9899345f7dec3ec4a47ef8b23b056 to your computer and use it in GitHub Desktop.
Save excavador/4ad9899345f7dec3ec4a47ef8b23b056 to your computer and use it in GitHub Desktop.
def _clickhouse_export_impl(ctx):
print(ctx.file.server, dir(ctx.attr.server), type(ctx.attr.server))
server_source = ctx.attr.server.files.to_list()[0]
client_source = ctx.attr.client.files.to_list()[0]
server_result = ctx.outputs.server
client_result = ctx.outputs.client
...
_clickhouse_export = rule(
implementation = _clickhouse_export_impl,
attrs = {
"server": attr.label(mandatory=True),
"client": attr.label(mandatory=True),
"version": attr.string(mandatory=True),
},
outputs = {
"server": "%{name}-server",
"client": "%{name}-client",
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment