def setUp(self, mkdtemp, create_builder): self.config = RawConfigParser() self.releaser_config = RawConfigParser() self.releaser_config.add_section("test") self.releaser_config.set('test', "releaser", "tito.release.Releaser") self.releaser = Releaser("titotestpkg", None, "/tmp/tito/", self.config, {}, "test", self.releaser_config, False, False, False, **{"offline": True})
def setUp(self): TitoGitTestFixture.setUp(self) self.create_project(PKG_NAME) os.chdir(self.repo_dir) self.config = RawConfigParser() self.config.add_section("buildconfig") self.config.set("buildconfig", "builder", "tito.builder.Builder") self.config.set("buildconfig", "offline", "true") self.releaser_config = RawConfigParser() self.releaser_config.add_section('test') self.releaser_config.set('test', 'releaser', 'tito.release.Releaser')
def main(): """The main function allows converting a git repo the is stup for "normal" tito to use classed defined here instead """ options = parse_args() rel_eng_dir = os.path.join(find_git_root(), tito_config_dir()) releasers_filename = os.path.join(rel_eng_dir, RELEASERS_CONF_FILENAME) releasers_config = RawConfigParser() releasers_config.read(releasers_filename) print("Read configuration file: {0}".format(releasers_filename)) for section in releasers_config.sections(): print(" found section: {0}".format(section)) if releasers_config.has_option(section, 'releaser'): old_releaser = releasers_config.get(section, 'releaser') print(" releaser is set to: {0}".format(old_releaser)) if old_releaser.startswith('tito.release.'): new_releaser = old_releaser.replace('tito.release.', 'mocktito.', 1) print(" replaced with: {0}".format(new_releaser)) releasers_config.set(section, 'releaser', new_releaser) elif old_releaser.startswith('mocktito.'): pass else: stderr.write("Found a releaser type I don't know, aborting\n") exit(1) if options.extra_yum_repos: print(" adding extra yum repos") releasers_config.set(section, EXTRA_YUM_REPOS, "\n".join(options.extra_yum_repos)) if options.extra_yum_repos_for: print(" adding extra yum repos for branches") releasers_config.set(section, EXTRA_YUM_REPOS_FOR, json.dumps(options.extra_yum_repos_for)) with open(releasers_filename, 'w') as rfp: releasers_config.write(rfp)
def _read_releaser_config(self): """ Read the releaser targets from .tito/releasers.conf. """ rel_eng_dir = os.path.join(find_git_root(), tito_config_dir()) filename = os.path.join(rel_eng_dir, RELEASERS_CONF_FILENAME) config = RawConfigParser() config.read(filename) return config
def _read_config(self): """ Read global build.py configuration from the .tito dir of the git repository we're being run from. NOTE: We always load the latest config file, not tito.props as it was for the tag being operated on. """ # List of filepaths to config files we'll be loading: rel_eng_dir = os.path.join(find_git_root(), tito_config_dir()) filename = os.path.join(rel_eng_dir, TITO_PROPS) if not os.path.exists(filename): error_out("Unable to locate branch configuration: %s" "\nPlease run 'tito init'" % filename) # Load the global config. Later, when we know what tag/package we're # building, we may also load that and potentially override some global # settings. config = RawConfigParser() config.read(filename) self._check_legacy_globalconfig(config) return config
def setUp(self): TitoGitTestFixture.setUp(self) os.chdir(self.repo_dir) self.config = RawConfigParser() self.output_dir = tempfile.mkdtemp("-titotestoutput")
def setUp(self): self.config = RawConfigParser()