Skip to content

Commit

Permalink
final touches
Browse files Browse the repository at this point in the history
  • Loading branch information
shabanzd committed Dec 26, 2023
1 parent f1a1aa6 commit a12e9d3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: bazel run //src:debian_dependency_bazelizer -- -if ./tests/ci_inputs/deb_packages.in -cf ./tests/ci_inputs/storage_config.json -if ./tests/ci_inputs/deb_packages_2.in
- run: bazel run //src:debian_dependency_bazelizer -- -if ./tests/ci_inputs/deb_packages.in -cf ./tests/ci_inputs/unknown_storage_config.json
- run: bazel run //src:debian_dependency_bazelizer -- -i ./tests/ci_inputs/deb_packages.in -c ./tests/ci_inputs/storage_config.json -i ./tests/ci_inputs/deb_packages_2.in
- run: bazel run //src:debian_dependency_bazelizer -- -i ./tests/ci_inputs/deb_packages.in -c ./tests/ci_inputs/unknown_storage_config.json
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cd example && bazel run //:debian_dependency_bazelizer -- -if ../tests/ci_inputs/deb_packages.in -cf ../tests/ci_inputs/storage_config.json -if ../tests/ci_inputs/deb_packages_2.in
- run: cd example && bazel run //:debian_dependency_bazelizer -- -i ../tests/ci_inputs/deb_packages.in -c ../tests/ci_inputs/storage_config.json -i ../tests/ci_inputs/deb_packages_2.in
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ In order to use the `debian_dependency_bazelizer`, please apply the following st
# This should be nicer once the debian dependency bazelizer is uploaded to the BCR.
bazel_dep(name = "debian_dependency_bazelizer", version = "0.0.1")
```
where deb_packages_input_file and the storage_config_file of the config tag class expect an [input file](#input-file) and a [config file](#config-file) respectively.

* Add the following to the `BUILD` file:
```
Expand Down
2 changes: 0 additions & 2 deletions src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ load("@dep_bazelizer_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//visibility:public"])

exports_files(["main_module.py"])

py_binary(
name = "debian_dependency_bazelizer",
srcs = ["main.py"],
Expand Down
16 changes: 8 additions & 8 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@click.command(context_settings={"ignore_unknown_options": True})
@click.option(
"--registry_path",
"-rp",
"-r",
type=click.Path(path_type=Path, file_okay=False),
required=False,
default=Path().joinpath(BAZEL_WORKSPACE_DIR_STR, "registry"),
Expand All @@ -28,7 +28,7 @@
)
@click.option(
"--input_file",
"-if",
"-i",
type=click.Path(path_type=Path, dir_okay=False),
required=True,
multiple=True,
Expand All @@ -37,20 +37,20 @@
If there are more than one input file, simply do -if path_to_file for each file.""",
)
@click.option(
"--storage_config_file",
"-cf",
"--config_file",
"-c",
type=click.Path(path_type=Path, dir_okay=False),
required=True,
help="""The path to the s3 config file containing the configs like bucket, url, etc.
If path is relative, it is assumed to be relative to the workspace dir""",
)
def main(registry_path: Path, input_file: List[Path], storage_config_file: Path):
def main(registry_path: Path, input_file: List[Path], config_file: Path):
"""Turns input deb packages into modules referenced by a local registry."""
if not registry_path.is_absolute():
registry_path = Path(BAZEL_WORKSPACE_DIR_STR) / registry_path

if not storage_config_file.is_absolute():
storage_config_file = Path(BAZEL_WORKSPACE_DIR_STR) / storage_config_file
if not config_file.is_absolute():
config_file = Path(BAZEL_WORKSPACE_DIR_STR) / config_file

input_files = [
file if file.is_absolute() else Path(BAZEL_WORKSPACE_DIR_STR) / file
Expand All @@ -64,7 +64,7 @@ def main(registry_path: Path, input_file: List[Path], storage_config_file: Path)

bazelize_deps(
registry_path=registry_path,
storage=create_storage(storage_config_file),
storage=create_storage(config_file),
input_package_metadatas=read_input_files(
registry_path=registry_path, input_files=input_files
),
Expand Down
34 changes: 0 additions & 34 deletions src/main_module.py

This file was deleted.

0 comments on commit a12e9d3

Please sign in to comment.