def _build_context(collection_path=None, output_path=None): collection_path = collection_path or os.path.join(os.path.dirname(__file__), 'collection_examples/hello') log.debug('collection_path: %s', collection_path) log.debug('output_path: %s', output_path) return BuildContext(collection_path=collection_path, output_path=output_path)
def test_build(galaxy_context, tmpdir): output_path = tmpdir.mkdir('mazer_test_build_action_test_build') collection_path = os.path.join(os.path.dirname(__file__), '../', 'collection_examples/hello') build_context = BuildContext(collection_path, output_path=output_path.strpath) ret = build.build(galaxy_context, build_context, display_callback) log.debug('ret: %s', ret) assert ret == 0, 'build action return code was not 0 but was %s' % ret
def build_repo_artifact(galaxy_context_, tmp_dir): output_path = tmp_dir.mkdir('mazer_test_repository_archive_test_build') collection_path = os.path.join(os.path.dirname(__file__), 'collection_examples/hello') build_context = BuildContext(collection_path, output_path=output_path.strpath) ret = build._build(galaxy_context_, build_context, display_callback) log.debug('ret: %s', ret) return ret
def execute_build(self): """ Create a collection artifact from a collection src repository. """ log.debug('options: %s', self.options) log.debug('args: %s', self.args) galaxy_context = self._get_galaxy_context(self.options, self.config) # default to looking for collection in cwd if not specified cwd = os.getcwd() collection_path = self.options.collection_path or cwd # write the output archive to output_path, which will default to collection # relative releases/ output_path = self.options.output_path or os.path.join(collection_path, 'releases') build_context = BuildContext(collection_path=collection_path, output_path=output_path) return build.build(galaxy_context, build_context, display_callback=self.display)