Public logs and status badges

Embedding Status Images and viewing public logs

Badges are simple images that show you the last build status. They support both the pipeline and branch service status. The badges can be embedded into your repository’s file or any other website.

Here is an example:

Build badge example

Build badge example

Clicking the badge takes you into the build view of the pipeline.

Finding the build badge of your project

In the pipeline view of a project, select the Settings tab and then click General. Next to the badges section you will find a link to the build badge.

Build badge setup

Build badge setup

Click on it and you will get a new dialog where you can select

  • The graphical style of the badge (two styles are offered)
  • The syntax for the badge

Codefresh badges syntax

Codefresh badges syntax

The following embedding options are available:

  • Markdown for usage in text files (e.g. README.MD)
  • Plain HTML for normal websites
  • AsciiDoc for documentation pages
  • Image for any other document type

Copy the snippet in your clipboard.

Using the build badge

Paste the snippet in the file/document where you want the badge to be visible (e.g. in a Readme file in GitHub).

For example, the markdown syntax is

[![Codefresh build status]( BADGE_LINK )]( URL_TO_PIPELINE )

You can also manually change the parameters of the link by using*param1*=xxx&*param2*=yyy
when param1, param2, etc… are the parameters from the table below.

Query parameter Description
branch - optional Name of the branch
If not supplied, default is master
repoName Name of the repository
pipelineName Name of the pipeline
accountName Name of the account
repoOwner The name of the repository owner
key - optional Token related to the account
type - optional Badge types
cf-1: Codefresh build status - also the default badge.
cf-2: Codefresh build status

Everybody who looks at your readme file will also see the current build status of the associated Codefresh pipeline.

Public build logs

By default, even though the badge shows the build status for everybody, clicking the badge allows only Codefresh registered users that also have access to the pipeline to view the actual builds.

If you are working on an open-source project and wish for greater visibility, you can enable public logs (and associated badge) for your project so that any user can see the pipeline results (even if they are not logged into Codefresh).

Public logs are disabled by default and you need to explicitly enable them.

This happens for security reasons. Make sure that the logs you are exposing to the Internet do not have any sensitive information. If you are unsure, you can still use the private badge that shows project status only as explained in the previous section.

To enable the public logs, toggle the respective switch in the pipeline settings:

Enabling public logs

Enabling public logs

Then click the Save button to apply changes for your pipeline. Once that is done you will also get a second badge (public) as well as the public URL to your project.

Getting the public URL log view

Getting the public URL log view

Now you can use this badge and/or public URL anywhere and all users can view your logs without being logged into Codefresh at all (or having access to your pipeline).

Public logs

Public logs

Your visitors can also click on each individual pipeline step and see the logs for that step only.

If you are using Codefresh to manage a public project, you should also use the capability to trigger builds from external forks.

Introduction to Codefresh pipelines
Creating pipelines
Monitoring pipelines