/papio-pipelines

A GitHub configured Jenkins instance. Contains all the plugins needed for a GitHub optimized Jenkins server.

Primary LanguageJava

Papio Cloud GitHub Jenkins

This repo generates the base image used for the Papio Pipelines GitHub App. The image uses the LTS Jenkins Alpine Image and installs the plugins defined in ./resources/plugins.txt Along with the papio-pipelines plugin that is created from the source in this repo. These plugins are the core of what makes up the Piplines App Instance.

A custom entry script is used that extracts the plugins and creates timestamp files for them. This is faster than having the Jenkins code itself do it but runs the risk of breaking in the future.

The image is published to DockerHub

Permissions and Access

When installing Pipelines it will request access for the following

Access Level Purpose
code read/write Allows Pipelines to do builds from source as well as push back tags/release commits
checks read/write #21 allows for Jenkins to publish status checks that can be used for branch rules
commit status read/write Each commit that triggers a build will get a success/failure status tied to it
deployments read/write #22/#23 allow for running from deployment events/triggering events
environments read #27 allow for interfacing with GitHub Environments same as GitHub Workflows
issues read/write #24 allows for posting comments to issues associated with the build
metadata read Required - Grants the app access to read plan metadata for installation
(organization) packages read/write #25 allows for publishing/resolving GitHub packages (public/private)
pull requsets read/write Allows for interfacing with Pull Requests (comments/merging/declining)

Custom Steps

As time permits, I will try my best to contribute some of these steps back to the plugins they are relevant for or publish this plugin as an official Jenkins Plugin. But for now, they will be documented here.

Function Name Description Implementation
gitPush Pushes any local commits (or optionally tags) to the remote git source PushToRemoteStep
withGitHubToken Injects an API token to be used for interacting with GitHub WithGitHubTokenStep
gitHubLibrary Loads a Jenkins Shared Library from GitHub into the build GitHubLibraryStep
mergePullRequest Attempts to merge if the build was triggered from a pull request MergePullRequestStep
commentPullRequest Makes a comment on the PR if the build was triggered from a pull request CommentPullRequestStep

Contributing

To contribute, fork the repository and create an issue. Try to be as specific as possible with the request for functionality along with Jenkinsfile snippets if you can. All Java code must include spock unit tests.