Skip to content

Commit ba0ab6b

Browse files
committed
move docstring
1 parent e1c7c13 commit ba0ab6b

File tree

2 files changed

+47
-45
lines changed

2 files changed

+47
-45
lines changed

airbyte_cdk/cli/build/__init__.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +0,0 @@
1-
"""Airbyte CDK Build Command.
2-
3-
The `airbyte-cdk-build` command provides a simplified way to build connector Docker images without requiring the full Airbyte CI pipeline.
4-
5-
6-
```bash
7-
pip install airbyte-cdk
8-
9-
pipx run airbyte-cdk-build [arguments]
10-
```
11-
12-
13-
```bash
14-
airbyte-cdk-build /path/to/connector
15-
16-
airbyte-cdk image build /path/to/connector
17-
18-
airbyte-cdk image build /path/to/connector --tag custom_tag
19-
20-
airbyte-cdk image build /path/to/connector --no-verify
21-
22-
airbyte-cdk image build /path/to/connector --verbose
23-
```
24-
25-
26-
- `connector_dir`: Path to the connector directory (required)
27-
- `--tag`: Tag to apply to the built image (default: "dev")
28-
- `--no-verify`: Skip verification of the built image
29-
- `--verbose`, `-v`: Enable verbose logging
30-
31-
32-
The command reads the connector's metadata from the `metadata.yaml` file, builds a Docker image using the connector's Dockerfile, and verifies the image by running the `spec` command. The image is tagged according to the repository name specified in the metadata and the provided tag.
33-
34-
This command is designed to be a simpler alternative to the `airbyte-ci build` command, using Docker directly on the host machine instead of Dagger.
35-
"""
36-
37-
from airbyte_cdk.cli.build._run import run
38-
39-
__all__ = [
40-
"run",
41-
]

airbyte_cdk/cli/commands/image.py

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,41 @@
1-
"""Image-related commands for the Airbyte CDK CLI."""
1+
"""Airbyte CDK 'image' commands.
2+
3+
The `airbyte-cdk` command provides a simplified way to build connector Docker images without requiring the full Airbyte CI pipeline.
4+
5+
```bash
6+
pip install airbyte-cdk
7+
8+
pipx run airbyte-cdk image [arguments]
9+
```
10+
11+
12+
```bash
13+
airbyte-cdk image build /path/to/connector
14+
15+
airbyte-cdk image build /path/to/connector --tag custom_tag
16+
17+
airbyte-cdk image build /path/to/connector --no-verify
18+
19+
airbyte-cdk image build /path/to/connector --verbose
20+
```
21+
22+
23+
- `connector_dir`: Path to the connector directory (required)
24+
- `--tag`: Tag to apply to the built image (default: "dev")
25+
- `--no-verify`: Skip verification of the built image
26+
- `--verbose`, `-v`: Enable verbose logging
27+
28+
29+
The command reads the connector's metadata from the `metadata.yaml` file, builds a Docker image using the connector's Dockerfile, and verifies the image by running the `spec` command. The image is tagged according to the repository name specified in the metadata and the provided tag.
30+
31+
This command is designed to be a simpler alternative to the `airbyte-ci build` command, using Docker directly on the host machine instead of Dagger.
32+
"""
33+
34+
from airbyte_cdk.cli.build._run import run
35+
36+
__all__ = [
37+
"run",
38+
]
239

340
import sys
441
from pathlib import Path
@@ -23,12 +60,18 @@ def image() -> None:
2360

2461
@image.command()
2562
@click.argument(
26-
"connector_dir", type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=Path)
63+
"connector_directory",
64+
type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=Path),
2765
)
2866
@click.option("--tag", default="dev", help="Tag to apply to the built image (default: dev)")
2967
@click.option("--no-verify", is_flag=True, help="Skip verification of the built image")
3068
@click.option("--verbose", "-v", is_flag=True, help="Enable verbose logging")
31-
def build(connector_dir: Path, tag: str, no_verify: bool, verbose: bool) -> None:
69+
def build(
70+
connector_directory: Path,
71+
tag: str = "dev",
72+
no_verify: bool = False,
73+
verbose: bool = False,
74+
) -> None:
3275
"""Build a connector Docker image.
3376
3477
This command builds a Docker image for a connector, using either
@@ -44,7 +87,7 @@ def build(connector_dir: Path, tag: str, no_verify: bool, verbose: bool) -> None
4487
sys.exit(1)
4588

4689
try:
47-
metadata = read_metadata(connector_dir)
90+
metadata = read_metadata(connector_directory)
4891
click.echo(f"Connector: {metadata.dockerRepository}")
4992
click.echo(f"Version: {metadata.dockerImageTag}")
5093

0 commit comments

Comments
 (0)