Skip to content

GitHub-JenkinsDay/jenkins-deployment-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins - GitHub Deployment API

This repo demonstrates how to post back to the GitHub Deployment API from a Jenkins Pipeline. See the Jenkinsfile for the exact Pipeline.

Requirements

  1. Create a Multibranch Pipeline (or use GitHub Organization Folders) within Jenkins that references this repository.
  2. Install the HTTP Request Plugin and the Pipeline Utility Steps on Jenkins.
  3. Add a branch, make a modification, and create a Pull Request in GitHub.
  4. Run the pipeline jobs again and you should see the deployment recorded in the Pull Request

How it Works

The Jenkins pipeline has 2 stages: build and deploy.

  • Build Stage:
    • Maven command is run to build the project.
  • Deploy Stage
    • Creates a GitHub Deployment via API using the HTTP Request Plugin
    • Saves the deployment id of the deployment just created
    • Executes the deployment
    • Creates a GitHub Deployment Status based on the outcome of the deployment via API using the HTTP Request Plugin

License

The project is available as open source under the terms of the MIT License.

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%