else: LOG.info("Patch applied.") else: LOG.info("No patches for mesos-deb-packaging {}.".format( MesosConfig.deb_packaging_sha() )) # ensure branch / tag Utils.exit_if_git_release_not_set( LOG, build_dir_mesos, MesosConfig.mesos_version(), MesosConfig.mesos_master_branch(), MesosConfig.mesos_git_repository() ) # We have the right sources now: if MesosConfig.operating_system() == "osx": build_with_osx( build_dir_mesos, build_dir_packaging, packages_dir ) else: build_with_docker( build_dir_mesos, build_dir_packaging, packages_dir ) if __name__ == "__main__": if "build" == MesosConfig.command(): op_build() if "docker" == MesosConfig.command(): op_docker_image() if "show-releases" == MesosConfig.command(): op_show_releases() if "show-builds" == MesosConfig.command(): Utils.list_builds( LOG, MesosConfig.packages_dir() ) if "remove-build" == MesosConfig.command(): op_remove_build() if "show-mesos-sources" == MesosConfig.command(): Utils.list_sources(MesosConfig.source_dir(), 'mesos') if "show-packaging-sources" == MesosConfig.command(): Utils.list_sources(MesosConfig.source_dir(), 'mesos-packaging') if "remove-mesos-sources" == MesosConfig.command(): op_remove_mesos_sources() if "remove-packaging-sources" == MesosConfig.command(): op_remove_packaging_sources() if "check-this-system" == MesosConfig.command(): op_check_this_system()
LOG.error( "Marathon build failed. Leaving build log and temp directory for inspection. marathon={}".format( build_dir ) ) exit(107) def op_show_releases(): if Utils.ensure_sources(LOG, MarathonConfig.marathon_repository_dir(), MarathonConfig.marathon_git_repository()): LOG.info("Releases:") for line in list_releases(): if line != "": print line def op_remove_build(): validate_input() if not Utils.confirm("You are about to remove Marathon build for {}.".format( MarathonConfig.marathon_version() )): exit(0) Utils.cmd("rm -rf {}/{}".format( MarathonConfig.packages_dir(), MarathonConfig.marathon_version())) def op_remove_sources(): if not Utils.confirm("You are about to remove Marathon sources for {}.".format( MarathonConfig.marathon_git_repository() )): exit(0) Utils.cmd("rm -rf {}".format( MarathonConfig.marathon_repository_dir() )) if __name__ == "__main__": if "build" == MarathonConfig.command(): op_build() if "show-releases" == MarathonConfig.command(): op_show_releases() if "show-builds" == MarathonConfig.command(): Utils.list_builds( LOG, MarathonConfig.packages_dir() ) if "remove-build" == MarathonConfig.command(): op_remove_build() if "show-sources" == MarathonConfig.command(): Utils.list_sources(MarathonConfig.source_dir(), 'marathon') if "remove-sources" == MarathonConfig.command(): op_remove_sources()
print line def op_remove_build(): validate_input() if not Utils.confirm("You are about to remove Chronos build for {}.".format( ChronosConfig.chronos_version() )): LOG.info("You have cancelled the action.") exit(0) Utils.cmd("rm -rf {}/{}".format( ChronosConfig.packages_dir(), ChronosConfig.chronos_version())) def op_remove_sources(): if not Utils.confirm("You are about to remove Chronos sources for {}.".format( ChronosConfig.chronos_git_repository() )): LOG.info("You have cancelled the action.") exit(0) Utils.cmd("rm -rf {}".format( ChronosConfig.chronos_repository_dir() )) def op_check_this_system(): LOG.info("Checking dependencies:") LOG.info(" -> Docker? : {}".format( "Yes" if Utils.is_docker_available() else "No" )) LOG.info(" -> Git? : {}".format( "Yes" if Utils.is_git_available() else "No" )) if __name__ == "__main__": if "build" == ChronosConfig.command(): op_build() if "show-releases" == ChronosConfig.command(): op_show_releases() if "show-builds" == ChronosConfig.command(): Utils.print_builds( LOG, ChronosConfig.packages_dir() ) if "remove-build" == ChronosConfig.command(): op_remove_build() if "show-sources" == ChronosConfig.command(): Utils.list_sources(ChronosConfig.source_dir(), 'chronos') if "remove-sources" == ChronosConfig.command(): op_remove_sources() if "check-this-system" == ChronosConfig.command(): op_check_this_system()