Jenkins

Automated management and configuration of Jenkins servers.

Jenkins Command Group

The newly introduced jenkins command group provides a comprehensive set of commands for managing Jenkins servers, jobs, credentials, pipelines, nodes, and system configurations directly from the CLI. This feature significantly enhances DevOps teams' ability to automate Jenkins operations efficiently.

Key Commands and Features:

  1. Credentials Management
    • dob create Credential: dob jenkins create-credential
      • Supports various types of credentials: SSH, username-password, secret text, and secret file.
    • Update Credential: dob jenkins update-credential
      • Allows updating existing credentials with new details.
    • Delete Credential: dob jenkins delete-credential
      • Deletes specified Jenkins credentials.
  2. Job Management
    • Create Job: dob jenkins create-job
      • Creates a new Jenkins job using a specified Jenkinsfile.
    • Trigger Job: dob jenkins trigger-job
      • Triggers a specified Jenkins job.
    • Replay Pipeline: dob jenkins replay-pipeline
      • Replays a previous Jenkins pipeline build with optional modifications.
    • Update Pipeline: dob jenkins update-pipeline
      • Updates the pipeline script for an existing job.
    • Visualize Pipeline: dob jenkins visualize-pipeline
      • Retrieves and displays detailed pipeline stages and steps for a specific build.
    • Add Job to Folder: dob jenkins add-job-to-folder
      • Moves an existing Jenkins job into a specified folder.
    • Create Multibranch Pipeline: dob jenkins create-multibranch-pipeline
      • Creates a new multi-branch pipeline job with Git repository integration.
  3. Node Management
    • Create Node: dob jenkins create-node
      • Sets up a new Jenkins worker node with SSH credentials and remote FS configuration.
    • Delete Node: dob jenkins delete-node
      • Deletes an existing Jenkins worker node.
  4. System and Configuration Management
    • Backup System: dob jenkins backup-system
      • Backs up the Jenkins system configuration and optionally all job configurations.
    • Restore System: dob jenkins restore-system
      • Restores Jenkins configuration from a backup file.
    • Restart Jenkins: dob jenkins restart
      • Safely restarts the Jenkins server.
    • Set Environment Variables: dob jenkins set-env-variables
      • Configures global environment variables in Jenkins.
    • Update System Config: dob jenkins update-system-config
      • Updates Jenkins system settings by uploading a new config.xml.
    • Check System Health: dob jenkins check-health
      • Retrieves Jenkins and plugin health statuses.
    • Get System Info: dob jenkins get-system-info
      • Displays detailed system information including node load and executor status.
    • Set Quiet Mode: dob jenkins set-quiet-mode
      • Enables or disables quiet mode to prevent new builds from starting.
  5. User Management
    • Create User: dob jenkins create-user
      • Registers a new Jenkins user with specified credentials.
    • Delete User: dob jenkins delete-user
      • Deletes a specified Jenkins user.
  6. Plugin Management
    • List Installed Plugins: dob jenkins list-installed-plugins
      • Lists all installed Jenkins plugins along with their versions and statuses.
    • Check Plugin Status: dob jenkins check-plugin-status
      • Retrieves the health status of installed plugins.
    • Uninstall Plugin: dob jenkins uninstall-plugin
      • Uninstalls a specified plugin from Jenkins.
  7. Webhooks Management
    • List Webhooks: dob jenkins list-webhooks
      • Lists all configured webhooks for a specified job.
    • Create Webhook: dob jenkins create-webhook
      • Creates or updates a webhook for a Jenkins job.
    • Delete Webhook: dob jenkins delete-webhook
      • Removes a webhook from a job trigger.

Example Usage:


# Create a new Jenkins credential
dob jenkins create-credential --credential_id my-ssh-key --credential_type ssh --username devops --private_key /path/to/private_key

# Trigger a Jenkins job
dob jenkins trigger-job --job_name build-project

# Backup Jenkins system with job configurations
dob jenkins backup-system --backup_path /backups/jenkins --include_jobs
      

Configuration and Exicution Steps PDF Reference for Jenkins

For detailed installation steps, please refer to the PDF documentation:


Your browser does not support PDFs. Download the PDF.