How to use the taskgraph.util.taskcluster.get_artifact_url function in taskgraph

To help you get started, we’ve selected a few taskgraph examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github servo / mozjs / mozjs / python / mozbuild / mozbuild / artifacts.py View on Github external
def find_pushhead_artifacts(self, task_cache, job, tree, pushhead):
        try:
            taskId, artifacts = task_cache.artifacts(tree, job, pushhead)
        except ValueError:
            return None

        urls = []
        for artifact_name in self._artifact_job.find_candidate_artifacts(artifacts):
            # We can easily extract the task ID from the URL.  We can't easily
            # extract the build ID; we use the .ini files embedded in the
            # downloaded artifact for this.
            url = get_artifact_url(taskId, artifact_name)
            urls.append(url)
        if urls:
            self.log(logging.INFO, 'artifact',
                     {'pushhead': pushhead,
                      'tree': tree},
                     'Installing from remote pushhead {pushhead} on {tree}')
            return urls
        return None
github servo / mozjs / mozjs / python / mozbuild / mozbuild / mach_commands.py View on Github external
def __init__(self, task_id, artifact_name):
                cot = cache._download_manager.session.get(
                    get_artifact_url(task_id, 'public/chainOfTrust.json.asc'))
                cot.raise_for_status()
                digest = algorithm = None
                data = {}
                # The file is GPG-signed, but we don't care about validating
                # that. Instead of parsing the PGP signature, we just take
                # the one line we're interested in, which starts with a `{`.
                for l in cot.content.splitlines():
                    if l.startswith('{'):
                        try:
                            data = json.loads(l)
                            break
                        except Exception:
                            pass
                for algorithm, digest in (data.get('artifacts', {})
                                              .get(artifact_name, {}).items()):
                    pass
github servo / mozjs / mozjs / python / mozbuild / mozbuild / artifacts.py View on Github external
def install_from_task(self, taskId, distdir):
        artifacts = list_artifacts(taskId)

        urls = []
        for artifact_name in self._artifact_job.find_candidate_artifacts(artifacts):
            # We can easily extract the task ID from the URL.  We can't easily
            # extract the build ID; we use the .ini files embedded in the
            # downloaded artifact for this.
            url = get_artifact_url(taskId, artifact_name)
            urls.append(url)
        if not urls:
            raise ValueError('Task {taskId} existed, but no artifacts found!'.format(taskId=taskId))
        for url in urls:
            if self.install_from_url(url, distdir):
                return 1
        return 0
github servo / mozjs / mozjs / python / mozbuild / mozbuild / mach_commands.py View on Github external
# The file is GPG-signed, but we don't care about validating
                # that. Instead of parsing the PGP signature, we just take
                # the one line we're interested in, which starts with a `{`.
                for l in cot.content.splitlines():
                    if l.startswith('{'):
                        try:
                            data = json.loads(l)
                            break
                        except Exception:
                            pass
                for algorithm, digest in (data.get('artifacts', {})
                                              .get(artifact_name, {}).items()):
                    pass

                name = os.path.basename(artifact_name)
                artifact_url = get_artifact_url(task_id, artifact_name,
                    use_proxy=not artifact_name.startswith('public/'))
                super(ArtifactRecord, self).__init__(
                    artifact_url, name,
                    None, digest, algorithm, unpack=True)