You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CLOUDP-295785 - add pipeline_main.py extended help (#334)
# Summary
Adding more help information for the `scripts.release.pipeline_main`
python script.
## Proof of Work
```
(venv) ➜ mongodb-kubernetes git:(maciejk/use-ar-related-versions) ✗ python3 -m scripts.release.pipeline_main --help
usage: pipeline_main.py [-h] [-b ] [-p ] [-v ] [-r ] [-s] [--parallel] [--parallel-factor ] image
Builder tool for container images. It allows to push and sign images with multiple architectures using Docker Buildx. By default build information is read from 'build_info.json' file in the project root directory based on the build scenario. It can be inferred from the environment variables or overridden with the '--build-scenario' option.
positional arguments:
image Image name to build. Supported images: meko-tests, operator, mco-tests, readiness-probe, upgrade-hook, database, agent, init-appdb, init-database, init-ops-manager, ops-manager
options:
-h, --help show this help message and exit
-b, --build-scenario
Override the build scenario instead of inferring from environment. Options: release, patch, staging, development. Default is to infer from environment variables. For 'development' the 'patch' scenario is used to read values from 'build_info.json'
-p, --platform Override the platforms instead of resolving from build scenario. Multi-arch builds are comma-separated. Example: linux/amd64,linux/arm64
-v, --version Override the version/tag instead of resolving from build scenario. Default is to infer from environment variables based on the selected scenario.
-r, --registry Override the base registry instead of resolving from build scenario
-s, --sign If set force image signing. Default is to infer from build scenario.
--parallel Build agent images in parallel.
--parallel-factor Number of agent builds to run in parallel, defaults to number of cores
```
## Checklist
- [x] Have you linked a jira ticket and/or is the ticket in the title?
- [x] Have you checked whether your jira ticket required DOCSP changes?
- [x] Have you added changelog file?
- use `skip-changelog` label if not needed
- refer to [Changelog files and Release
Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes)
section in CONTRIBUTING.md for more details
---------
Co-authored-by: Julien Benhaim <[email protected]>
description="""Builder tool for container images. It allows to push and sign images with multiple architectures using Docker Buildx.
185
+
By default build information is read from 'build_info.json' file in the project root directory based on the build scenario.
186
+
It can be inferred from the environment variables or overridden with the '--build-scenario' option.""",
187
+
)
188
+
parser.add_argument(
189
+
"image",
190
+
metavar="image",
191
+
action="store",
192
+
type=str,
193
+
choices=supported_images,
194
+
help=f"Image name to build. Supported images: {", ".join(supported_images)}",
195
+
)
184
196
parser.add_argument(
185
-
"--scenario",
186
-
choices=list(BuildScenario),
187
-
help=f"Override the build scenario instead of inferring from environment. Options: release, patch, master, development",
197
+
"-b",
198
+
"--build-scenario",
199
+
metavar="",
200
+
action="store",
201
+
type=str,
202
+
choices=supported_scenarios,
203
+
help=f"""Override the build scenario instead of inferring from environment. Options: {", ".join(supported_scenarios)}.
204
+
Default is to infer from environment variables. For '{BuildScenario.DEVELOPMENT}' the '{BuildScenario.PATCH}' scenario is used to read values from 'build_info.json'""",
188
205
)
189
-
# Override arguments for build context and configuration
190
206
parser.add_argument(
207
+
"-p",
191
208
"--platform",
209
+
metavar="",
210
+
action="store",
211
+
type=str,
192
212
help="Override the platforms instead of resolving from build scenario. Multi-arch builds are comma-separated. Example: linux/amd64,linux/arm64",
193
213
)
194
214
parser.add_argument(
215
+
"-v",
195
216
"--version",
196
-
help="Override the version/tag instead of resolving from build scenario",
217
+
metavar="",
218
+
action="store",
219
+
type=str,
220
+
help="Override the version/tag instead of resolving from build scenario. Default is to infer from environment variables based on the selected scenario.",
197
221
)
198
222
parser.add_argument(
223
+
"-r",
199
224
"--registry",
225
+
metavar="",
226
+
action="store",
227
+
type=str,
200
228
help="Override the base registry instead of resolving from build scenario",
201
229
)
230
+
parser.add_argument(
231
+
"-s",
232
+
"--sign",
233
+
action="store_true",
234
+
help="If set force image signing. Default is to infer from build scenario.",
235
+
)
202
236
# For agent builds
237
+
parser.add_argument(
238
+
"--parallel",
239
+
action="store_true",
240
+
help="Build agent images in parallel.",
241
+
)
203
242
parser.add_argument(
204
243
"--parallel-factor",
244
+
metavar="",
205
245
default=0,
246
+
action="store",
206
247
type=int,
207
-
help="Number of builds to run in parallel, defaults to number of cores",
248
+
help="Number of agent builds to run in parallel, defaults to number of cores",
0 commit comments