apexcodexpy 0.4.4__tar.gz → 0.5.3__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.
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/PKG-INFO +1 -1
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/service.py +57 -1
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/tools.py +1 -1
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/typer/root.py +53 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/pyproject.toml +1 -1
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/LICENSE +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/README.md +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/__init__.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/__init__.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/program.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/pyproject.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/reporters.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/result.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/typer/__init__.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/typer/device.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/typer/testing.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/infra/workflows.py +0 -0
- {apexcodexpy-0.4.4 → apexcodexpy-0.5.3}/codex/runner.py +0 -0
|
@@ -68,6 +68,22 @@ class Codex:
|
|
|
68
68
|
def build(self, tag: str) -> TaskResult:
|
|
69
69
|
return self.tools.build(tag).execute()
|
|
70
70
|
|
|
71
|
+
def push(
|
|
72
|
+
self,
|
|
73
|
+
tag: str,
|
|
74
|
+
registry: str,
|
|
75
|
+
organization: str,
|
|
76
|
+
token: str,
|
|
77
|
+
actor: str,
|
|
78
|
+
) -> TaskResult:
|
|
79
|
+
return self.tools.push(
|
|
80
|
+
tag=tag,
|
|
81
|
+
registry=registry,
|
|
82
|
+
organization=organization,
|
|
83
|
+
token=token,
|
|
84
|
+
actor=actor,
|
|
85
|
+
).execute()
|
|
86
|
+
|
|
71
87
|
|
|
72
88
|
@dataclass(frozen=True)
|
|
73
89
|
class CiCodex:
|
|
@@ -248,7 +264,7 @@ class CodexTools:
|
|
|
248
264
|
command=(
|
|
249
265
|
Command("docker build")
|
|
250
266
|
.flag(tag=True)
|
|
251
|
-
.append(tag)
|
|
267
|
+
.append(tag.lower())
|
|
252
268
|
.flag(build_arg=True)
|
|
253
269
|
.with_a(RELEASE=Git().revision() or str(int(time())))
|
|
254
270
|
.append(self.target)
|
|
@@ -257,6 +273,46 @@ class CodexTools:
|
|
|
257
273
|
)
|
|
258
274
|
)
|
|
259
275
|
|
|
276
|
+
def push(
|
|
277
|
+
self,
|
|
278
|
+
tag: str,
|
|
279
|
+
registry: str,
|
|
280
|
+
organization: str,
|
|
281
|
+
token: str,
|
|
282
|
+
actor: str,
|
|
283
|
+
) -> Executable:
|
|
284
|
+
local_tag = tag.lower()
|
|
285
|
+
remote_tag = f"{registry}/{organization.lower()}/{local_tag}"
|
|
286
|
+
|
|
287
|
+
return (
|
|
288
|
+
MultiProgram()
|
|
289
|
+
.attach(
|
|
290
|
+
Program(
|
|
291
|
+
name="tag",
|
|
292
|
+
command=Command("docker tag").append(local_tag).append(remote_tag),
|
|
293
|
+
)
|
|
294
|
+
)
|
|
295
|
+
.attach(
|
|
296
|
+
Program(
|
|
297
|
+
name="login",
|
|
298
|
+
command=(
|
|
299
|
+
Command("docker login")
|
|
300
|
+
.append(registry)
|
|
301
|
+
.flag(username=True)
|
|
302
|
+
.append(actor)
|
|
303
|
+
.flag(password=True)
|
|
304
|
+
.append(token)
|
|
305
|
+
),
|
|
306
|
+
)
|
|
307
|
+
)
|
|
308
|
+
.attach(
|
|
309
|
+
Program(
|
|
310
|
+
name="push",
|
|
311
|
+
command=Command("docker push").append(remote_tag),
|
|
312
|
+
)
|
|
313
|
+
)
|
|
314
|
+
)
|
|
315
|
+
|
|
260
316
|
|
|
261
317
|
@dataclass(frozen=True)
|
|
262
318
|
class Git:
|
|
@@ -122,6 +122,59 @@ def _(
|
|
|
122
122
|
)
|
|
123
123
|
|
|
124
124
|
|
|
125
|
+
@cli.command(
|
|
126
|
+
name="push",
|
|
127
|
+
help="Tag and push a Docker image to GitHub Container Registry.",
|
|
128
|
+
)
|
|
129
|
+
def _(
|
|
130
|
+
tag: str = typer.Option(
|
|
131
|
+
...,
|
|
132
|
+
"--tag",
|
|
133
|
+
"-t",
|
|
134
|
+
help="Image tag, e.g. latest.",
|
|
135
|
+
),
|
|
136
|
+
registry: str = typer.Option(
|
|
137
|
+
"ghcr.io",
|
|
138
|
+
"--registry",
|
|
139
|
+
help="Container registry host.",
|
|
140
|
+
),
|
|
141
|
+
organization: str = typer.Option(
|
|
142
|
+
...,
|
|
143
|
+
"--organization",
|
|
144
|
+
"-o",
|
|
145
|
+
help="GHCR organization or namespace.",
|
|
146
|
+
),
|
|
147
|
+
token: str = typer.Option(
|
|
148
|
+
...,
|
|
149
|
+
"--token",
|
|
150
|
+
help="GitHub token for registry login.",
|
|
151
|
+
),
|
|
152
|
+
actor: str = typer.Option(
|
|
153
|
+
...,
|
|
154
|
+
"--actor",
|
|
155
|
+
help="GitHub username for registry login.",
|
|
156
|
+
),
|
|
157
|
+
path: str = typer.Option(
|
|
158
|
+
".",
|
|
159
|
+
"--path",
|
|
160
|
+
"-p",
|
|
161
|
+
help="Target directory.",
|
|
162
|
+
),
|
|
163
|
+
) -> None:
|
|
164
|
+
(
|
|
165
|
+
Codex.target(Path(path))
|
|
166
|
+
.push(
|
|
167
|
+
tag=tag,
|
|
168
|
+
registry=registry,
|
|
169
|
+
organization=organization,
|
|
170
|
+
token=token,
|
|
171
|
+
actor=actor,
|
|
172
|
+
)
|
|
173
|
+
.report(using=DefaultReporter())
|
|
174
|
+
.exit(using=typer.Exit)
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
|
|
125
178
|
@cli.command(
|
|
126
179
|
name="lint",
|
|
127
180
|
help="Run linting (Ruff) and type checking (MyPy).",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|