(cls)
| 259 | |
| 260 | @classmethod |
| 261 | def parse(cls): |
| 262 | parser = argparse.ArgumentParser() |
| 263 | parser.add_argument( |
| 264 | "--base", |
| 265 | default=BASE_IMAGE, |
| 266 | help=f"base container image [default: {BASE_IMAGE}]", |
| 267 | ) |
| 268 | parser.add_argument( |
| 269 | "--target", |
| 270 | default=DEST_IMAGE, |
| 271 | help=f"target image to create [default: {DEST_IMAGE}]", |
| 272 | ) |
| 273 | parser.add_argument( |
| 274 | "--push", action="store_true", help="push when done" |
| 275 | ) |
| 276 | parser.add_argument( |
| 277 | "--pull", |
| 278 | action="store_true", |
| 279 | help=( |
| 280 | "pull base image before building (useful to prevent building" |
| 281 | " with a stale base image)" |
| 282 | ), |
| 283 | ) |
| 284 | parser.add_argument( |
| 285 | "--build-dir", |
| 286 | "-b", |
| 287 | help="path to the build dir (defaults to current workding dir)", |
| 288 | ) |
| 289 | parser.add_argument( |
| 290 | "--source-dir", |
| 291 | help="path to the source dir (defaults to parent of build dir)", |
| 292 | ) |
| 293 | parser.add_argument( |
| 294 | "--strip", action="store_true", help="strip binaries" |
| 295 | ) |
| 296 | parser.add_argument( |
| 297 | "--root-build", action="store_true", help="build image as root" |
| 298 | ) |
| 299 | parser.add_argument("--container-engine") |
| 300 | parser.set_defaults(log_level=logging.INFO) |
| 301 | parser.add_argument( |
| 302 | "--debug", |
| 303 | action="store_const", |
| 304 | dest="log_level", |
| 305 | const=logging.DEBUG, |
| 306 | help="Enable debug level logging", |
| 307 | ) |
| 308 | parser.add_argument( |
| 309 | "--quiet", |
| 310 | "-q", |
| 311 | action="store_const", |
| 312 | dest="log_level", |
| 313 | const=logging.WARNING, |
| 314 | help="Only print errors and warnings", |
| 315 | ) |
| 316 | parser.add_argument( |
| 317 | "--cephadm-build-arg", |
| 318 | "-A", |
no test coverage detected