As of May 2021, this project has been deprecated and is now archived in favor of using vela
jenkins-docker-api
Endpoints
A list of endpoints this API supports
GET /api/v1/health # Is the API up
GET /api/v1/jenkins # List of running Jenkins masters
PUT /api/v1/jenkins/restart/:name # Restarts a single Jenkins master
PUT /api/v1/jenkins/update/:name # Update a single Jenkins master to the latest release
PUT /api/v1/jenkins/shutdown/:name # Shutdown a single Jenkins master
PUT /api/v1/jenkins/admin/update_all # Update all Jenkins masters to the latest release (admins only)
Relevant Header
-H "Authorization: token <github token>"
Contributing / Development
Dependencies:
Ensure that Docker is installed and running.
Ensure that Docker swarm is initialized: docker swarm init.
# Make sure your go paths are set if they aren't already
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# Clone the project
cd $GOPATH/src/github.com/target/
git clone git@github.com:Jenkins/jenkins-docker-api.git
cd jenkins-docker-api
Add/update golang vendor packages:
govendor fetch +outside
Set environment variables:
GITHUB_API_URL - your GitHub API URL
GITHUB_ADMIN_ORG - name of your GitHub admin organization, e.g. Jenkins
GITHUB_ADMIN_TEAM - name of your GitHub admin team, e.g. Admins
JENKINS_ENV - your Jenkins environment, e.g. test, prod, etc.
JENKINS_IMAGE - full path to your Jenkins Docker image, e.g. target/jenkins-docker-master:1.0.0
JENKINS_USER_CONFIG_PATH - default path is /jenkins/user-configs/
JENKINS_ADMIN_CONFIG_PATH - default path is /jenkins/secret-configs/
Make your code changes and ensure all tests pass
# Checkout a branch for your work
git checkout -b name_of_your_branch
# Code away!
Package classification Jenkins API Self Service API built by Target to manage Jenkins master Terms Of Service: http://swagger.io/terms/ Version: 1.0.0 Host: yourhost.com Schemes: https Consumes: - application/json Produces: - application/json swagger:meta
Package classification Jenkins API Self Service API built by Target to manage Jenkins master Terms Of Service: http://swagger.io/terms/ Version: 1.0.0 Host: yourhost.com Schemes: https Consumes: - application/json Produces: - application/json swagger:meta