{"id":22477204,"url":"https://github.com/base2services/jenkins-distribution","last_synced_at":"2025-11-10T02:04:32.352Z","repository":{"id":38056082,"uuid":"224164305","full_name":"base2Services/jenkins-distribution","owner":"base2Services","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-29T22:03:31.000Z","size":214,"stargazers_count":0,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T00:38:52.198Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/base2Services.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-26T10:28:04.000Z","updated_at":"2021-12-20T04:59:49.000Z","dependencies_parsed_at":"2023-02-12T18:31:22.791Z","dependency_job_id":"2317273d-37d4-4552-83e2-e6dc792f60ff","html_url":"https://github.com/base2Services/jenkins-distribution","commit_stats":null,"previous_names":[],"tags_count":101,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base2Services%2Fjenkins-distribution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base2Services%2Fjenkins-distribution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base2Services%2Fjenkins-distribution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base2Services%2Fjenkins-distribution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/base2Services","download_url":"https://codeload.github.com/base2Services/jenkins-distribution/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228476046,"owners_count":17926134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T14:09:50.128Z","updated_at":"2025-11-10T02:04:32.308Z","avatar_url":"https://github.com/base2Services.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jenkins Distribution for CI in a Box 2.0\n\nThis project provides a customized Jenkins distribution for CI in a Box 2.0, offering a pre-configured Jenkins environment with essential plugins and configurations.\n\nThe distribution is designed to streamline the setup process for continuous integration and delivery pipelines, particularly for AWS-based infrastructures. It includes a comprehensive set of plugins for source control management, build automation, cloud integration, and security features.\n\nKey features of this Jenkins distribution include:\n- Pre-installed plugins for AWS, Docker, and various SCM systems\n- Configuration as Code (JCasC) for easy setup and maintenance\n- Integration with ciinabox-specific components\n- Customizable job configurations and build strategies\n- Support for cloud-based agent provisioning\n\n## Repository Structure\n\n- `Dockerfile`: Defines the custom Jenkins image build\n- `docker-compose.yaml`: Configures the local development environment\n- `jcasc.yaml`: Jenkins Configuration as Code file\n- `plugins.yaml`: List of plugins to be installed\n- `init.groovy.d/`: Contains initialization scripts\n- `jcasc/`: Directory for JCasC related files\n  - `defaults.yaml`: Default Jenkins configuration\n  - `jcasc-apply.py`: Script to apply JCasC configurations\n  - `plugin-merger.py`: Script to merge plugin configurations\n- `README.md`: This file, containing project documentation\n\n## Usage Instructions\n\n### Installation\n\nPrerequisites:\n- Docker and Docker Compose installed (version 19.03.0+)\n- Git\n\nSteps:\n1. Clone the repository:\n   ```\n   git clone \u003crepository-url\u003e\n   cd \u003crepository-directory\u003e\n   ```\n\n2. Build and start the Jenkins container:\n   ```\n   docker-compose up --build\n   ```\n\n3. Access Jenkins at `http://localhost:8080`\n\n### Configuration\n\nThe Jenkins instance is pre-configured using Jenkins Configuration as Code (JCasC). The main configuration file is `jcasc/defaults.yaml`. To customize the configuration:\n\n1. Modify the `jcasc/defaults.yaml` file\n2. Apply changes using the `jcasc-apply.py` script:\n   ```\n   python3 jcasc/jcasc-apply.py --jcasc-yaml jcasc/defaults.yaml\n   ```\n\n### Adding or Updating Plugins\n\nTo add or update plugins:\n\n1. Edit the `plugins.yaml` file\n2. Rebuild the Docker image:\n   ```\n   docker-compose build\n   ```\n3. Restart the Jenkins container:\n   ```\n   docker-compose up -d\n   ```\n\n### Customizing Job Configurations\n\nJob configurations can be customized using the Job DSL plugin. Add or modify job definitions in the `jcasc/ciinabox-jobs` directory.\n\n### Troubleshooting\n\n1. Jenkins fails to start:\n   - Check Docker logs: `docker-compose logs jenkins`\n   - Verify JCasC configuration in `jcasc/defaults.yaml`\n   - Ensure all required environment variables are set in `docker-compose.yaml`\n\n2. Plugin compatibility issues:\n   - Review `plugins.yaml` for version conflicts\n   - Check Jenkins system logs for plugin-related errors\n   - Try updating problematic plugins to their latest versions\n\n3. Configuration changes not applying:\n   - Ensure you've run the `jcasc-apply.py` script after making changes\n   - Verify the JCASC_RELOAD_TOKEN is correctly set in the environment\n   - Check Jenkins logs for JCasC-related messages\n\n4. AWS integration issues:\n   - Verify AWS credentials are correctly configured in Jenkins\n   - Check EC2 plugin configuration in `jcasc/defaults.yaml`\n   - Ensure proper IAM permissions for the Jenkins instance\n\nFor more detailed debugging:\n- Enable Jenkins debug logging by adding `-Djava.util.logging.config.file=/var/jenkins_home/log.properties` to JAVA_OPTS in `docker-compose.yaml`\n- Inspect logs at `/var/jenkins_home/jenkins.log` inside the container\n\n## Data Flow\n\nThe Jenkins distribution follows this general data flow for job execution:\n\n1. User triggers a job or SCM webhook initiates a build\n2. Jenkins master receives the build request\n3. If using cloud agents, Jenkins provisions an EC2 instance via the EC2 plugin\n4. Job configuration is loaded from JCasC or Job DSL definitions\n5. Build steps are executed on the agent (or master for lightweight jobs)\n6. Build artifacts are stored (locally or in S3, depending on configuration)\n7. Build results are reported back to the Jenkins master\n8. Notifications are sent based on build status (email, Slack, etc.)\n\n```\n[User/SCM] -\u003e [Jenkins Master] -\u003e [EC2 Plugin] -\u003e [EC2 Agent]\n                  |                                  |\n                  v                                  v\n           [Job Configuration] -----------------\u003e [Build Execution]\n                  |                                  |\n                  v                                  v\n           [Artifact Storage] \u003c----------------- [Build Results]\n                  |\n                  v\n         [Notifications/Reporting]\n```\n\n## Infrastructure\n\nThe infrastructure for this Jenkins distribution is primarily defined in the `Dockerfile` and `docker-compose.yaml` files. Key components include:\n\n- Docker:\n  - `Dockerfile`: Defines the custom Jenkins image based on `jenkins/jenkins:2.479.2-jdk17`\n  - `docker-compose.yaml`: Configures the Jenkins service for local development\n\n- Jenkins:\n  - Exposed ports: 8080 (web interface), 50000 (agent communication)\n  - Volume mounts:\n    - `/var/run/docker.sock`: Allows Jenkins to interact with the Docker daemon\n    - `./jcasc.yaml`: Mounts the JCasC configuration file\n\n- Environment variables:\n  - `CASC_JENKINS_CONFIG`: Specifies the location of the JCasC configuration\n  - `TRY_UPGRADE_IF_NO_MARKER`: Enables automatic plugin upgrades\n  - `PLUGINS_FORCE_UPGRADE`: Forces plugin upgrades\n  - `JCASC_RELOAD_TOKEN`: Token for reloading JCasC configuration\n  - `JAVA_OPTS`: Various Java options for Jenkins, including security settings\n\n- AWS (configured in `jcasc/defaults.yaml`):\n  - EC2 plugin configuration for provisioning cloud agents\n  - IAM instance profile (not specified in provided files)\n  - Security groups and subnets for EC2 instances\n\nNote: Specific AWS resource identifiers (e.g., AMI IDs, security group IDs) are placeholders in the provided configuration and should be replaced with actual values for production use.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase2services%2Fjenkins-distribution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbase2services%2Fjenkins-distribution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase2services%2Fjenkins-distribution/lists"}