Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
    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)