Latest Build Status Badge

        Checks the status of the latest build of a given branch
        and returns corresponding badge svg.

        This method is ``experimental``
189089
def badge(self, *args, **kwargs):
        

        return self._makeApiCall(self.funcinfo["badge"], *args, **kwargs)
1356493
def status(ctx, client, revision, no_output, path):
    """"""
    graph = Graph(client)
    # TODO filter only paths = {graph.normalize_path(p) for p in path}
    status = graph.build_status(revision=revision, can_be_cwl=no_output)

    click.echo('On branch {0}'.format(client.repo.active_branch))
    if status['outdated']:
        click.echo(
            'Files generated from newer inputs:\n'
            '  (use "renku log [<file>...]" to see the full lineage)\n'
            '  (use "renku update [<file>...]" to '
            'generate the file from its latest inputs)\n'
        )

        for filepath, stts in sorted(status['outdated'].items()):
            outdated = (
                ', '.join(
                    '{0}#{1}'.format(
                        click.style(
                            graph._format_path(n.path), fg='blue', bold=True
                        ),
                        _format_sha1(graph, n),
                    ) for n in stts
                    if n.path and n.path not in status['outdated']
                )
            )

            click.echo(
                '\t{0}: {1}'.format(
                    click.style(
                        graph._format_path(filepath), fg='red', bold=True
                    ), outdated
                )
            )

        click.echo()

    else:
        click.secho(
            'All files were generated from the latest inputs.', fg='green'
        )

    if status['multiple-versions']:
        click.echo(
            'Input files used in different versions:\n'
            '  (use "renku log --revision <sha1> <file>" to see a lineage '
            'for the given revision)\n'
        )

        for filepath, files in sorted(status['multiple-versions'].items()):
            # Do not show duplicated commits!  (see #387)
            commits = {_format_sha1(graph, key) for key in files}
            click.echo(
                '\t{0}: {1}'.format(
                    click.style(
                        graph._format_path(filepath), fg='blue', bold=True
                    ), ', '.join(commits)
                )
            )

        click.echo()

    if status['deleted']:
        click.echo(
            'Deleted files used to generate outputs:\n'
            '  (use "git show <sha1>:<file>" to see the file content '
            'for the given revision)\n'
        )

        for filepath, node in status['deleted'].items():
            click.echo(
                '\t{0}: {1}'.format(
                    click.style(
                        graph._format_path(filepath), fg='blue', bold=True
                    ), _format_sha1(graph, node)
                )
            )

        click.echo()

    ctx.exit(1 if status['outdated'] else 0)
461389
def check(branch: str = 'master'):
    
    if os.environ.get('TRAVIS') == 'true':
        travis(branch)
    elif os.environ.get('SEMAPHORE') == 'true':
        semaphore(branch)
    elif os.environ.get('FRIGG') == 'true':
        frigg(branch)
    elif os.environ.get('CIRCLECI') == 'true':
        circle(branch)
    elif os.environ.get('GITLAB_CI') == 'true':
        gitlab(branch)
    elif 'BITBUCKET_BUILD_NUMBER' in os.environ:
        bitbucket(branch)
273906
def status_bar(self):
        
        print("")
        self.msg.template(78)
        print("| Repository         Status")
        self.msg.template(78)
318425
def check_link_status():
    ''''''
    tnow = time.time()
    if mpstate.status.last_message != 0 and tnow > mpstate.status.last_message + 5:
        say("no link")
        mpstate.status.heartbeat_error = True
    for master in mpstate.mav_master:
        if not master.linkerror and (tnow > master.last_message + 5 or master.portdead):
            say("link %s down" % (mp_module.MPModule.link_label(master)))
            master.linkerror = True
402946
def status(self, key, value):
        """"""
        value = value.lower()
        if value not in valid_statuses:
            raise ValueError("Build Status must have a value from:\n{}".format(", ".join(valid_statuses)))

        self.obj['status'][key] = value
        self.changes.append("Updating build:{}.status.{}={}"
                            .format(self.obj['name'], key, value))
        return self
1153971
def generate_git_version_info():
    
    info = GitInfo()
    git_path = call(('which', 'git'))

    # get build info
    info.builder = get_build_name()
    info.build_date = get_build_date()

    # parse git ID
    info.hash, info.date, info.author, info.committer = (
        get_last_commit(git_path))

    # determine branch
    info.branch = get_git_branch(git_path)

    # determine tag
    info.tag = get_git_tag(info.hash, git_path)

    # determine version
    if info.tag:
        info.version = info.tag.strip('v')
        info.release = not re.search('[a-z]', info.version.lower())
    else:
        info.version = info.hash[:6]
        info.release = False

    # Determine *last* stable release
    info.last_release = determine_latest_release_version()

    # refresh index
    call((git_path, 'update-index', '-q', '--refresh'))

    # check working copy for changes
    info.status = get_git_status(git_path)

    return info
1083402
function checkIfVersionUpdated() {

        var latestBuildNumber = updateJsonHandler.get("latestBuildNumber"),
            currentBuildNumber = Number(/-([0-9]+)/.exec(brackets.metadata.version)[1]);

        return latestBuildNumber === currentBuildNumber;
    }
118835
def get_git_status(self):
        
        ## get git branch
        self._get_git_branch()

        ## get tag in the init file
        self._get_init_release_tag()

        ## get log commits since <tag>
        try:
            self._get_log_commits()
        except Exception as inst:
            raise Exception(
        """
        Error: the version in __init__.py is {}, so 'git log' is 
        looking for commits that have happened since that version, but
        it appears there is not existing tag for that version. You may
        need to roll back the version in __init__.py to what is actually
        commited. Check with `git tag`.
        --------
        {}
        """.format(self.init_version, inst))

        ## where are we at?
        print("__init__.__version__ == '{}':".format(self.init_version))
        print("'{}' is {} commits ahead of origin/{}"
              .format(self.tag, len(self.commits), self.init_version))
574532
def status(self):
        

        rd = self.repo_dir

        logger.debug("pkg path %s", rd)
        if not rd:
            print(
                "unable to find pkg '%s'. %s" % (self.name, did_u_mean(self.name))
            )

        cwd = os.getcwd()
        os.chdir(self.repo_dir)
        logger.debug("cwd: %s, getting status %s ", cwd, self.repo_dir)
        try:
            p = git.status(_out=self._sh_stdout('blue'),
                           _err=self._sh_stderr('red'))
            p.wait()
        except Exception:
            pass
            # logger.warn(e)
        os.chdir(cwd)
580336
def build_branch(self):
        
        # pylint: disable=len-as-condition
        if len(self.dutinformation) > 0 and (self.dutinformation.get(0).build is not None):
            return self.dutinformation.get(0).build.branch
        return None
674519
def version(**kwargs):
    
    retry = kwargs.get("retry")
    if retry:
        click.echo('Retrying publication of the same version...')
    else:
        click.echo('Creating new version..')

    try:
        current_version = get_current_version()
    except GitError as e:
        click.echo(click.style(str(e), 'red'), err=True)
        return False

    click.echo('Current version: {0}'.format(current_version))
    level_bump = evaluate_version_bump(current_version, kwargs['force_level'])
    new_version = get_new_version(current_version, level_bump)

    if new_version == current_version and not retry:
        click.echo(click.style('No release will be made.', fg='yellow'))
        return False

    if kwargs['noop'] is True:
        click.echo('{0} Should have bumped from {1} to {2}.'.format(
            click.style('No operation mode.', fg='yellow'),
            current_version,
            new_version
        ))
        return False

    if config.getboolean('semantic_release', 'check_build_status'):
        click.echo('Checking build status..')
        owner, name = get_repository_owner_and_name()
        if not check_build_status(owner, name, get_current_head_hash()):
            click.echo(click.style('The build has failed', 'red'))
            return False
        click.echo(click.style('The build was a success, continuing the release', 'green'))

    if retry:
        # No need to make changes to the repo, we're just retrying.
        return True

    if config.get('semantic_release', 'version_source') == 'commit':
        set_new_version(new_version)
        commit_new_version(new_version)
    tag_new_version(new_version)
    click.echo('Bumping with a {0} version to {1}.'.format(level_bump, new_version))
    return True
1246813
def release_docs_index_verify():
    
    version = "{version}"
    _index_verify(
        RELEASE_INDEX_FILE,
        side_effect=release_docs_side_effect,
        pypi="",
        pypi_img="",
        versions="\n\n",
        versions_img="",
        rtd_version=version,
        revision=version,
        circleci_badge=CIRCLECI_BADGE_RELEASE,
        circleci_path="/{circleci_build}",
        travis_badge=TRAVIS_BADGE_RELEASE,
        travis_path="/builds/{travis_build}",
        appveyor_badge=APPVEYOR_BADGE_RELEASE,
        appveyor_path="/build/{appveyor_build}",
        coveralls_badge=COVERALLS_BADGE_RELEASE,
        coveralls_path="builds/{coveralls_build}",
    )
655517
def frigg(branch: str):
    
    assert os.environ.get('FRIGG_BUILD_BRANCH') == branch
    assert not os.environ.get('FRIGG_PULL_REQUEST')
757962
def show_updates(self):
        
        dists = Distributions()
        if self.project_name:
            #Check for a single package
            pkg_list = [self.project_name]
        else:
            #Check for every installed package
            pkg_list = get_pkglist()
        found = None
        for pkg in pkg_list:
            for (dist, active) in dists.get_distributions("all", pkg,
                    dists.get_highest_installed(pkg)):
                (project_name, versions) = \
                        self.pypi.query_versions_pypi(dist.project_name)
                if versions:

                    #PyPI returns them in chronological order,
                    #but who knows if its guaranteed in the API?
                    #Make sure we grab the highest version:

                    newest = get_highest_version(versions)
                    if newest != dist.version:

                        #We may have newer than what PyPI knows about

                        if pkg_resources.parse_version(dist.version) < \
                            pkg_resources.parse_version(newest):
                            found = True
                            print(" %s %s (%s)" % (project_name, dist.version,
                                    newest))
        if not found and self.project_name:
            self.logger.info("You have the latest version installed.")
        elif not found:
            self.logger.info("No newer packages found at The Cheese Shop")
        return 0
138446
def get_required_status_checks(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.protection_url + "/required_status_checks"
        )
        return github.RequiredStatusChecks.RequiredStatusChecks(self._requester, headers, data, completed=True)
737763
def check_status(self, **kwargs):
        
        for work in self:
            work.check_status()

        if kwargs.pop("show", False):
            self.show_status(**kwargs)