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.
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.
To get started with Pipelines, follow the Marketplace link and select Set up a Plan.
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.
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.
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.
Jenkinsfile
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.
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 stagesOnce 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!
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!
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!