Welcome!

Welcome to the Papio blog! We'll be showcasing all the great things Papio Cloud Software has to offer as well as tutorials, examples, and best practices. We'll also be using this platform to post notifications about changes/updates to our products, new features, and general communication. In this post, we'll be talking about Papio Pipelines, our flagship Jenkins as a Service App available in the GitHub Marketplace.

Papio Pipelines

Pipelines is a Jenkins-as-a-Service offering for GitHub Marketplace that brings the Jenkinsfile build format to GitHub as an alternative to static, yaml, configuration offered by others. Jenkinsfiles provide a dynamic configuration that supports full scripting (using Groovy run in the Jenkins Groovy Sandbox) using Scripted Pipelines or partial scripting with Declarative Pipelines. Configuration as code is important for consistent, repeatable builds and having the power to write code within your configuration file reduces the headaches of static configuration that tries to mimic code.

Installation

To get started with Pipelines, follow the Marketplace link and select Set up a Plan.

Select a plan to get startedSelect a plan to get started

Once selected, you will be prompted to review and authorize the App for your repositories. For a list of permissions and their uses, see the README.md in the Pipelines repository.

Review and completeReview and complete
Authorize the AppAuthorize the App

After authorization, you will be redirected to https://pipelines.papiocloud.com where you should see a folder with the name of the account that app was installed for and a folder for any organizations you are a member of that have installed the app.

Pipelines homepage viewPipelines homepage view

If there are any branches of any repositories that have a Jenkinsfile in the root, the repository will show up as a sub folder under the installation folder. If no Jenkinsfiles are found, adding one to a repository will trigger it to show up under the folder.

View when no repositories contain a JenkinsfileView when no repositories contain a Jenkinsfile
View when Jenkinsfiles are presentView when Jenkinsfiles are present

In the installation folder view, select the "Open Blue Ocean" link to view the folders using the Blue Ocean UI. This is a more modern interface for Jenkins that specifically provides a better experience visualizing a Jenkinsfile pipelines.

Blue Ocean view of available pipelinesBlue Ocean view of available pipelines

Creating a Jenkinsfile

If you're new to Jenkinsfiles, it's time to create one. Select an existing repository of yours or create a new one. Once the repository is ready, create a new branch, jenkinsfile-test and add a file named Jenkinsfile to the root of the repository with the following contents:

pipeline {
  agent any
  stages {
    stage("Hello") {
      steps {
        echo "Hello,"
      }
    }
    stage("World!") {
      steps {
        sh "echo 'World!'"
      }
    }
  }
}
Two Stage Pipeline that prints Hello, World! across the stages

Once the Jenkinsfile has been pushed to the repository, a folder for the repository should show up in the installation folder in the app. From there, we can select the repository and then see the jenkinsfile-test branch. Next, manually trigger the jenkinsfile-test branch by selecting the "Play" button so we can see our Jenkinsfile in action!

Click play button to trigger the buildClick play button to trigger the build

NOTE: The initial commit of a Jenkinsfile will not trigger a build in a repository unknown to Jenkins, but instead will just cause the repository to show up. Subsequent commits will automatically trigger a build.

After triggering the build, select the "Open Blue Ocean" link on the left and then select the jenkinsfile-test branch in the list of builds and you'll be taken to the build execution for the build we just triggered!

Build list for repositoryBuild list for repository
Execution for the Hello, World! buildExecution for the Hello, World! build

From here, any updates to the Jenkinsfile will automatically trigger a new build execution. Next steps are to customize your stages and get to building your software projects!

Feel free to reach out for any feature requests or issues!