Skip to content

Instantly share code, notes, and snippets.

@cognifloyd
Last active September 12, 2024 17:58
Show Gist options
  • Save cognifloyd/ff9a43fc54971233384acff50c262088 to your computer and use it in GitHub Desktop.
Save cognifloyd/ff9a43fc54971233384acff50c262088 to your computer and use it in GitHub Desktop.
capturing .git/modules
experimental_workspace_environment(
name="in_repo_workspace",
)
files(
name="gitmodules",
sources=[
".gitmodules",
"st2tests/st2tests/fixtures/packs/test_content_version/.git",
],
)
shell_command(
name="capture_git_modules",
environment="in_repo_workspace",
command="cp -r .git/modules {chroot}/.git",
execution_dependencies=[":gitmodules"],
output_dependencies=[":gitmodules"],
output_directories=[".git/modules"],
workdir="/",
)
#############################################################################################
# This would be in path/to/tests/unit/BUILD
python_tests(
name="tests",
dependencies=[
"//:capture_git_modules",
],
)
# ...
[environments-preview.names]
in_repo_workspace = "//:in_repo_workspace"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment