(args)
| 289 | |
| 290 | |
| 291 | def build(args): |
| 292 | |
| 293 | # Disable standard logging for stdout when the following modes are |
| 294 | # executed: |
| 295 | if args.export_params or args.export_directives or args.fetch_docker_tags: |
| 296 | logger.setLevel(logging.ERROR) |
| 297 | |
| 298 | if args.recipe_list_short: |
| 299 | list_recipes() |
| 300 | |
| 301 | if args.recipe_list: |
| 302 | list_recipes(full=True) |
| 303 | |
| 304 | welcome = [ |
| 305 | "========= F L O W C R A F T =========", |
| 306 | "Build mode\n" |
| 307 | "version: {}".format(__version__), |
| 308 | "build: {}".format(__build__), |
| 309 | "=====================================" |
| 310 | ] |
| 311 | |
| 312 | parsed_output_nf = validate_build_arguments(args) |
| 313 | |
| 314 | logger.info(colored_print("\n".join(welcome), "green_bold")) |
| 315 | |
| 316 | # If a recipe is specified, build pipeline based on the |
| 317 | # appropriate recipe |
| 318 | if args.recipe: |
| 319 | if args.recipe == "innuendo": |
| 320 | pipeline_string = brew_innuendo(args) |
| 321 | else: |
| 322 | # pipeline_string = available_recipes[args.recipe] |
| 323 | pipeline_string = brew_recipe(args.recipe) |
| 324 | if args.tasks: |
| 325 | logger.warning(colored_print( |
| 326 | "-t parameter will be ignored for recipe: {}\n".format( |
| 327 | args.recipe), "yellow_bold") |
| 328 | ) |
| 329 | |
| 330 | if args.check_recipe: |
| 331 | logger.info(colored_print("Pipeline string for recipe: {}" |
| 332 | .format(args.recipe), "purple_bold")) |
| 333 | logger.info(pipeline_string) |
| 334 | sys.exit(0) |
| 335 | else: |
| 336 | pipeline_string = args.tasks |
| 337 | |
| 338 | process_map = collect_process_map() |
| 339 | |
| 340 | # used for lists print |
| 341 | proc_collector(process_map, args, pipeline_string) |
| 342 | |
| 343 | try: |
| 344 | logger.info(colored_print("Checking pipeline for errors...")) |
| 345 | pipeline_list = parse_pipeline(pipeline_string) |
| 346 | except SanityError as e: |
| 347 | logger.error(colored_print(e.value, "red_bold")) |
| 348 | sys.exit(1) |
no test coverage detected