This purpose of this Jenkins plugin is to make it possible to use a single Jenkinsfile, stored and maintained using an SCM tool such as GitHub, for an entire organization. This simplifies the governance of the organization's CI/CD pipelines while improving scalability and maintainability.
- Maven (
mvn
) is installed on your machine - Git has been installed and configured on your machine
git clone https://github.com/boozallen/common-workflow-plugin.git
cd common-workflow-plugin
mvn clean install -DskipTests
Unlike other Jenkins plugins, this one needs to be installed manually. After
building the plugin (see above), you should see a number of binary files in
a folder called "target." Take the common-workflow.hpi file in that folder and
copy it into the $JENKINS_HOME/plugins
directory on your Jenkins Master server,
then restart the server.
- If your project source code is in a private repository, create a Jenkins credential
that can, at minimum, read from those repositories. - If the repository containing the entrypoint script you wish to use is in a private
repository, you will need a Jenkins credential to read from that repository as well.
You can configure an existing "GitHub Organization" job or create a new one. To create a new job, click on either of these two links.
Enter an "item name" as prompted - this is typically the name of your GitHub Organization - then select the "GitHub Organization" job and click OK.
You will then be taken to a screen to configure your new job. Scroll down to Projects and, if your source code is not in a public repository, select the appropriate credentials from the drop down. Otherwise select "none." Then delete the default Project Recognizer.
Click Add to add a new project recognizer and select "Common Pipeline Script From SCM"
You should see a section pop up like the one below. Do the following
- Select the source code management tool you will be using (likely Git)
- Enter the Repository URL in the corresponding field for the repository
containing the entrypoint script you plan to use.
You can git this by clicking the "clone" button on the repository's page and copying the https URL - If the repository containing your entrypoint script is private, select the appropriate
credentials from the dropdown in the Credentials field. Otherwise select "none." - Enter the path of your entrypoint script in the Script Path field. The path is relative to the root
of the repository - Optionally uncheck "Use Groovy Sandbox"
Once that's done, select Save and a Multibranch Pipeline job will be automatically set up for each repository in the Github organization.