bat-cli 0.1.2__tar.gz → 2026.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bat_cli-0.1.2 → bat_cli-2026.6}/PKG-INFO +11 -9
- {bat_cli-0.1.2 → bat_cli-2026.6}/README.md +8 -6
- {bat_cli-0.1.2 → bat_cli-2026.6}/pyproject.toml +4 -4
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/bat_cli.egg-info/PKG-INFO +11 -9
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/bat_cli.egg-info/requires.txt +2 -2
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/build/build.py +4 -10
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/cli.py +18 -1
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/agent.py +12 -5
- bat_cli-2026.6/src/create/templates/agent/.python-version +1 -0
- bat_cli-2026.6/src/create/templates/agent/Makefile +28 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/push/push.py +4 -4
- bat_cli-2026.6/tests/test_create_new_agent.py +547 -0
- bat_cli-2026.6/tests/test_eval_commands.py +516 -0
- bat_cli-0.1.2/src/create/templates/agent/.python-version +0 -1
- bat_cli-0.1.2/src/create/templates/agent/Makefile +0 -34
- bat_cli-0.1.2/tests/test_create_new_agent.py +0 -514
- bat_cli-0.1.2/tests/test_eval_commands.py +0 -514
- {bat_cli-0.1.2 → bat_cli-2026.6}/setup.cfg +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/add/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/add/client.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/bat_cli.egg-info/SOURCES.txt +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/bat_cli.egg-info/dependency_links.txt +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/bat_cli.egg-info/entry_points.txt +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/bat_cli.egg-info/top_level.txt +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/build/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/.dockerignore +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/.env.template +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/Dockerfile +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/README.md +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/__main__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/agent.json.template +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/agent.spec +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/config.yaml +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/llm_client.py.template +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/pyproject.toml.template +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/src/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/src/graph.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/src/llm_clients/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/create/templates/agent/tests/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/commands.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/adapter.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/bench_runner.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/contracts.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/eval_config.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/evaluator.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/metrics/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/metrics/llm_evaluators.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/metrics/metrics.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/metrics/qualitative_helpers.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/orchestrator.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/eval/engine/plotter.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/image_defaults.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/push/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/set/__init__.py +0 -0
- {bat_cli-0.1.2 → bat_cli-2026.6}/src/set/env.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bat-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2026.6
|
|
4
4
|
Summary: CLI tool to interact with BAT agents
|
|
5
5
|
Author-email: Enrico SBUTTONI <enrico.sbuttoni@bubbleran.com>
|
|
6
6
|
Project-URL: Homepage, https://bubbleran.com/
|
|
@@ -10,8 +10,8 @@ Classifier: Operating System :: OS Independent
|
|
|
10
10
|
Requires-Python: >=3.12
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: typer>=0.12.3
|
|
13
|
-
Requires-Dist: bat-adk>=2026.
|
|
14
|
-
Requires-Dist: bat-adk[
|
|
13
|
+
Requires-Dist: bat-adk>=2026.06
|
|
14
|
+
Requires-Dist: bat-adk[all]
|
|
15
15
|
Requires-Dist: a2a-sdk>=1.0.0
|
|
16
16
|
Requires-Dist: python-dotenv>=1.0.1
|
|
17
17
|
Requires-Dist: typing-extensions>=4.12.0
|
|
@@ -132,14 +132,13 @@ bat
|
|
|
132
132
|
│ ├── --context, -C
|
|
133
133
|
│ ├── --docker-registry
|
|
134
134
|
│ ├── --repo
|
|
135
|
-
│ ├── --tag
|
|
136
135
|
│ ├── --version
|
|
137
136
|
│ └── --no-cache
|
|
138
137
|
└── push
|
|
139
138
|
├── --context, -C
|
|
140
139
|
├── --docker-registry
|
|
141
140
|
├── --repo
|
|
142
|
-
└── --
|
|
141
|
+
└── --version
|
|
143
142
|
```
|
|
144
143
|
|
|
145
144
|
Built-in help is available at every level:
|
|
@@ -195,14 +194,17 @@ bat set env --docker-registry hub.bubbleran.com --repo orama/labs/my-agent
|
|
|
195
194
|
### 4. Build and push a Docker image
|
|
196
195
|
|
|
197
196
|
```bash
|
|
198
|
-
|
|
197
|
+
# --version is used both as the image tag and as the VERSION build arg (default: latest)
|
|
198
|
+
bat build --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
199
199
|
|
|
200
|
-
# no-cache build with version
|
|
201
|
-
bat build --context ./my_agent --repo orama/labs/my-agent --
|
|
200
|
+
# no-cache build with a specific version
|
|
201
|
+
bat build --context ./my_agent --repo orama/labs/my-agent --version 1.0.0 --no-cache
|
|
202
202
|
|
|
203
|
-
bat push --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --
|
|
203
|
+
bat push --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
204
204
|
```
|
|
205
205
|
|
|
206
|
+
The image reference is always `{registry}/{repo}:{version}`.
|
|
207
|
+
|
|
206
208
|
If `BAT_DOCKER_REGISTRY` and `BAT_DOCKER_REPO` are already set in `.env` or the shell, `--docker-registry` and `--repo` can be omitted.
|
|
207
209
|
|
|
208
210
|
**Precedence** (both `--docker-registry` / `--repo`):
|
|
@@ -113,14 +113,13 @@ bat
|
|
|
113
113
|
│ ├── --context, -C
|
|
114
114
|
│ ├── --docker-registry
|
|
115
115
|
│ ├── --repo
|
|
116
|
-
│ ├── --tag
|
|
117
116
|
│ ├── --version
|
|
118
117
|
│ └── --no-cache
|
|
119
118
|
└── push
|
|
120
119
|
├── --context, -C
|
|
121
120
|
├── --docker-registry
|
|
122
121
|
├── --repo
|
|
123
|
-
└── --
|
|
122
|
+
└── --version
|
|
124
123
|
```
|
|
125
124
|
|
|
126
125
|
Built-in help is available at every level:
|
|
@@ -176,14 +175,17 @@ bat set env --docker-registry hub.bubbleran.com --repo orama/labs/my-agent
|
|
|
176
175
|
### 4. Build and push a Docker image
|
|
177
176
|
|
|
178
177
|
```bash
|
|
179
|
-
|
|
178
|
+
# --version is used both as the image tag and as the VERSION build arg (default: latest)
|
|
179
|
+
bat build --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
180
180
|
|
|
181
|
-
# no-cache build with version
|
|
182
|
-
bat build --context ./my_agent --repo orama/labs/my-agent --
|
|
181
|
+
# no-cache build with a specific version
|
|
182
|
+
bat build --context ./my_agent --repo orama/labs/my-agent --version 1.0.0 --no-cache
|
|
183
183
|
|
|
184
|
-
bat push --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --
|
|
184
|
+
bat push --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
+
The image reference is always `{registry}/{repo}:{version}`.
|
|
188
|
+
|
|
187
189
|
If `BAT_DOCKER_REGISTRY` and `BAT_DOCKER_REPO` are already set in `.env` or the shell, `--docker-registry` and `--repo` can be omitted.
|
|
188
190
|
|
|
189
191
|
**Precedence** (both `--docker-registry` / `--repo`):
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bat-cli"
|
|
7
|
-
version = "
|
|
7
|
+
version = "2026.06"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Enrico SBUTTONI", email="enrico.sbuttoni@bubbleran.com" },
|
|
10
10
|
]
|
|
@@ -18,8 +18,8 @@ classifiers = [
|
|
|
18
18
|
|
|
19
19
|
dependencies = [
|
|
20
20
|
"typer>=0.12.3",
|
|
21
|
-
"bat-adk>=2026.
|
|
22
|
-
"bat-adk[
|
|
21
|
+
"bat-adk>=2026.06",
|
|
22
|
+
"bat-adk[all]",
|
|
23
23
|
"a2a-sdk>=1.0.0",
|
|
24
24
|
"python-dotenv>=1.0.1",
|
|
25
25
|
"typing-extensions>=4.12.0",
|
|
@@ -92,4 +92,4 @@ ignore = [
|
|
|
92
92
|
"tests/*" = ["S101"] # Allow 'assert' statements in tests without warning
|
|
93
93
|
|
|
94
94
|
[tool.ruff.format]
|
|
95
|
-
indent-style = "space"
|
|
95
|
+
indent-style = "space"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bat-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2026.6
|
|
4
4
|
Summary: CLI tool to interact with BAT agents
|
|
5
5
|
Author-email: Enrico SBUTTONI <enrico.sbuttoni@bubbleran.com>
|
|
6
6
|
Project-URL: Homepage, https://bubbleran.com/
|
|
@@ -10,8 +10,8 @@ Classifier: Operating System :: OS Independent
|
|
|
10
10
|
Requires-Python: >=3.12
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: typer>=0.12.3
|
|
13
|
-
Requires-Dist: bat-adk>=2026.
|
|
14
|
-
Requires-Dist: bat-adk[
|
|
13
|
+
Requires-Dist: bat-adk>=2026.06
|
|
14
|
+
Requires-Dist: bat-adk[all]
|
|
15
15
|
Requires-Dist: a2a-sdk>=1.0.0
|
|
16
16
|
Requires-Dist: python-dotenv>=1.0.1
|
|
17
17
|
Requires-Dist: typing-extensions>=4.12.0
|
|
@@ -132,14 +132,13 @@ bat
|
|
|
132
132
|
│ ├── --context, -C
|
|
133
133
|
│ ├── --docker-registry
|
|
134
134
|
│ ├── --repo
|
|
135
|
-
│ ├── --tag
|
|
136
135
|
│ ├── --version
|
|
137
136
|
│ └── --no-cache
|
|
138
137
|
└── push
|
|
139
138
|
├── --context, -C
|
|
140
139
|
├── --docker-registry
|
|
141
140
|
├── --repo
|
|
142
|
-
└── --
|
|
141
|
+
└── --version
|
|
143
142
|
```
|
|
144
143
|
|
|
145
144
|
Built-in help is available at every level:
|
|
@@ -195,14 +194,17 @@ bat set env --docker-registry hub.bubbleran.com --repo orama/labs/my-agent
|
|
|
195
194
|
### 4. Build and push a Docker image
|
|
196
195
|
|
|
197
196
|
```bash
|
|
198
|
-
|
|
197
|
+
# --version is used both as the image tag and as the VERSION build arg (default: latest)
|
|
198
|
+
bat build --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
199
199
|
|
|
200
|
-
# no-cache build with version
|
|
201
|
-
bat build --context ./my_agent --repo orama/labs/my-agent --
|
|
200
|
+
# no-cache build with a specific version
|
|
201
|
+
bat build --context ./my_agent --repo orama/labs/my-agent --version 1.0.0 --no-cache
|
|
202
202
|
|
|
203
|
-
bat push --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --
|
|
203
|
+
bat push --context ./my_agent --docker-registry hub.bubbleran.com --repo orama/labs/my-agent --version latest
|
|
204
204
|
```
|
|
205
205
|
|
|
206
|
+
The image reference is always `{registry}/{repo}:{version}`.
|
|
207
|
+
|
|
206
208
|
If `BAT_DOCKER_REGISTRY` and `BAT_DOCKER_REPO` are already set in `.env` or the shell, `--docker-registry` and `--repo` can be omitted.
|
|
207
209
|
|
|
208
210
|
**Precedence** (both `--docker-registry` / `--repo`):
|
|
@@ -29,15 +29,10 @@ def build_image(
|
|
|
29
29
|
"(or .env in current directory) > default-repository/<project-name>."
|
|
30
30
|
),
|
|
31
31
|
),
|
|
32
|
-
|
|
32
|
+
version: str = typer.Option(
|
|
33
33
|
"latest",
|
|
34
|
-
"--tag",
|
|
35
|
-
help="Image tag.",
|
|
36
|
-
),
|
|
37
|
-
version: str | None = typer.Option(
|
|
38
|
-
None,
|
|
39
34
|
"--version",
|
|
40
|
-
help="
|
|
35
|
+
help="Image version, used as the image tag and VERSION build arg.",
|
|
41
36
|
),
|
|
42
37
|
no_cache: bool = typer.Option(
|
|
43
38
|
False,
|
|
@@ -57,13 +52,12 @@ def build_image(
|
|
|
57
52
|
|
|
58
53
|
resolved_registry = resolve_registry(context_dir, docker_registry)
|
|
59
54
|
resolved_repo = resolve_repo_name(context_dir, repo)
|
|
60
|
-
image = f"{resolved_registry}/{resolved_repo}:{
|
|
55
|
+
image = f"{resolved_registry}/{resolved_repo}:{version}"
|
|
61
56
|
|
|
62
57
|
command = ["docker", "build"]
|
|
63
58
|
if no_cache:
|
|
64
59
|
command.append("--no-cache")
|
|
65
|
-
|
|
66
|
-
command.extend(["--build-arg", f"VERSION={version}"])
|
|
60
|
+
command.extend(["--build-arg", f"VERSION={version}"])
|
|
67
61
|
command.extend(["--tag", image, "."])
|
|
68
62
|
|
|
69
63
|
typer.echo(f"Building Docker image: {image}")
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import shutil
|
|
2
2
|
import subprocess
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
|
|
5
6
|
import click
|
|
@@ -95,6 +96,21 @@ eval_app.command(
|
|
|
95
96
|
)(eval_plot)
|
|
96
97
|
|
|
97
98
|
|
|
99
|
+
@app.command("version", help="Show the installed bat-cli version.")
|
|
100
|
+
def show_version() -> None:
|
|
101
|
+
try:
|
|
102
|
+
installed_version = version("bat-cli")
|
|
103
|
+
except PackageNotFoundError:
|
|
104
|
+
typer.secho(
|
|
105
|
+
"bat-cli is not installed as a package; version unavailable.",
|
|
106
|
+
fg=typer.colors.YELLOW,
|
|
107
|
+
err=True,
|
|
108
|
+
)
|
|
109
|
+
raise typer.Exit(code=1) from None
|
|
110
|
+
|
|
111
|
+
typer.echo(f"bat-cli {installed_version}")
|
|
112
|
+
|
|
113
|
+
|
|
98
114
|
def _parse_clients_option(raw_clients: str | None) -> list[str] | None:
|
|
99
115
|
if raw_clients is None:
|
|
100
116
|
return None
|
|
@@ -146,7 +162,7 @@ def create_new_agent(
|
|
|
146
162
|
help="Model provider value written to .env.",
|
|
147
163
|
),
|
|
148
164
|
) -> None:
|
|
149
|
-
target_dir = output_dir / name
|
|
165
|
+
target_dir = output_dir / name.lower()
|
|
150
166
|
parsed_clients = _parse_clients_option(clients)
|
|
151
167
|
|
|
152
168
|
try:
|
|
@@ -157,6 +173,7 @@ def create_new_agent(
|
|
|
157
173
|
port=port,
|
|
158
174
|
model=model,
|
|
159
175
|
model_provider=model_provider,
|
|
176
|
+
class_name_source=name,
|
|
160
177
|
)
|
|
161
178
|
except FileExistsError as exc:
|
|
162
179
|
typer.secho(str(exc), fg=typer.colors.RED, err=True)
|
|
@@ -2,7 +2,7 @@ import re
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
from typing import Literal
|
|
4
4
|
|
|
5
|
-
BAT_ADK_VERSION = "2026.
|
|
5
|
+
BAT_ADK_VERSION = "2026.06"
|
|
6
6
|
|
|
7
7
|
TEMPLATES_DIR = Path(__file__).resolve().parent / "templates" / "agent"
|
|
8
8
|
_DYNAMIC_TEMPLATE_FILES = {
|
|
@@ -114,7 +114,7 @@ def _build_makefile_content(agent_dir_name: str) -> str:
|
|
|
114
114
|
return _render_template(
|
|
115
115
|
"Makefile",
|
|
116
116
|
{
|
|
117
|
-
"
|
|
117
|
+
"AGENT_NAME": agent_dir_name,
|
|
118
118
|
},
|
|
119
119
|
)
|
|
120
120
|
|
|
@@ -315,7 +315,14 @@ def create_agent_scaffold(
|
|
|
315
315
|
port: int = 9900,
|
|
316
316
|
model: str = "gpt-4o-mini",
|
|
317
317
|
model_provider: str = "openai",
|
|
318
|
+
class_name_source: str | None = None,
|
|
318
319
|
) -> list[Path]:
|
|
320
|
+
# The State/Graph class names keep the original (pre-lowercasing) casing,
|
|
321
|
+
# while every directory-derived name follows the lowercase folder name.
|
|
322
|
+
class_source = (
|
|
323
|
+
class_name_source if class_name_source is not None else target_dir.name
|
|
324
|
+
)
|
|
325
|
+
|
|
319
326
|
if target_dir.exists() and any(target_dir.iterdir()) and not force:
|
|
320
327
|
raise FileExistsError(
|
|
321
328
|
f"Target directory '{target_dir}' already exists and is not empty. "
|
|
@@ -386,7 +393,7 @@ def create_agent_scaffold(
|
|
|
386
393
|
graph_path = target_dir / "src" / "graph.py"
|
|
387
394
|
if force or not graph_path.exists():
|
|
388
395
|
graph_path.write_text(
|
|
389
|
-
_build_graph_content(
|
|
396
|
+
_build_graph_content(class_source, clients), encoding="utf-8"
|
|
390
397
|
)
|
|
391
398
|
created.append(graph_path)
|
|
392
399
|
|
|
@@ -398,14 +405,14 @@ def create_agent_scaffold(
|
|
|
398
405
|
):
|
|
399
406
|
src_init_path.parent.mkdir(parents=True, exist_ok=True)
|
|
400
407
|
src_init_path.write_text(
|
|
401
|
-
_build_src_init_content(
|
|
408
|
+
_build_src_init_content(class_source), encoding="utf-8"
|
|
402
409
|
)
|
|
403
410
|
created.append(src_init_path)
|
|
404
411
|
|
|
405
412
|
main_path = target_dir / "__main__.py"
|
|
406
413
|
if force or not main_path.exists():
|
|
407
414
|
main_path.write_text(
|
|
408
|
-
_build_main_content(
|
|
415
|
+
_build_main_content(class_source), encoding="utf-8"
|
|
409
416
|
)
|
|
410
417
|
created.append(main_path)
|
|
411
418
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
DOCKER_REGISTRY ?= INSERT_YOUR_DOCKER_REGISTRY_HERE
|
|
2
|
+
REPO ?= YOUR_REPOSITORY/__AGENT_NAME__
|
|
3
|
+
VERSION ?= $(shell git describe --tags --always --abbrev --dirty)
|
|
4
|
+
IMAGE_TAG := $(DOCKER_REGISTRY)/$(REPO):$(VERSION)
|
|
5
|
+
|
|
6
|
+
.PHONY: build run push clean
|
|
7
|
+
|
|
8
|
+
build:
|
|
9
|
+
@echo "Building __AGENT_NAME__ Docker image with tag: $(IMAGE_TAG) - Version: $(VERSION)"
|
|
10
|
+
docker build $(if $(NO_CACHE),--no-cache) \
|
|
11
|
+
--build-arg VERSION=$(VERSION) \
|
|
12
|
+
--tag $(IMAGE_TAG) .
|
|
13
|
+
@echo "__AGENT_NAME__ Docker image built successfully."
|
|
14
|
+
|
|
15
|
+
run:
|
|
16
|
+
docker run --rm \
|
|
17
|
+
-it \
|
|
18
|
+
--env-file .env \
|
|
19
|
+
--network host \
|
|
20
|
+
$(IMAGE_TAG)
|
|
21
|
+
|
|
22
|
+
push:
|
|
23
|
+
@echo "Pushing __AGENT_NAME__ Docker image with tag: $(IMAGE_TAG)"
|
|
24
|
+
docker push $(IMAGE_TAG)
|
|
25
|
+
@echo "__AGENT_NAME__ Docker image pushed successfully."
|
|
26
|
+
|
|
27
|
+
clean:
|
|
28
|
+
docker rmi $(IMAGE_TAG) || true
|
|
@@ -29,10 +29,10 @@ def push_image(
|
|
|
29
29
|
"(or .env in current directory) > default-repository/<project-name>."
|
|
30
30
|
),
|
|
31
31
|
),
|
|
32
|
-
|
|
32
|
+
version: str = typer.Option(
|
|
33
33
|
"latest",
|
|
34
|
-
"--
|
|
35
|
-
help="Image tag.",
|
|
34
|
+
"--version",
|
|
35
|
+
help="Image version used as the tag.",
|
|
36
36
|
),
|
|
37
37
|
) -> None:
|
|
38
38
|
context_dir = context.resolve()
|
|
@@ -46,7 +46,7 @@ def push_image(
|
|
|
46
46
|
|
|
47
47
|
resolved_registry = resolve_registry(context_dir, docker_registry)
|
|
48
48
|
resolved_repo = resolve_repo_name(context_dir, repo)
|
|
49
|
-
image = f"{resolved_registry}/{resolved_repo}:{
|
|
49
|
+
image = f"{resolved_registry}/{resolved_repo}:{version}"
|
|
50
50
|
command = ["docker", "push", image]
|
|
51
51
|
|
|
52
52
|
typer.echo(f"Pushing Docker image: {image}")
|