{"id":18445872,"url":"https://github.com/voronenko/devops-jenkins-box-template","last_synced_at":"2025-09-25T11:05:43.740Z","repository":{"id":3619146,"uuid":"46279492","full_name":"Voronenko/devops-jenkins-box-template","owner":"Voronenko","description":"Bootstrap template to provision your agency own Jenkins server","archived":false,"fork":false,"pushed_at":"2022-12-08T04:00:07.000Z","size":292,"stargazers_count":24,"open_issues_count":9,"forks_count":30,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-22T02:53:31.210Z","etag":null,"topics":["devops","jenkins"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/Voronenko.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}},"created_at":"2015-11-16T14:25:08.000Z","updated_at":"2025-06-27T11:32:23.000Z","dependencies_parsed_at":"2023-01-11T16:32:54.256Z","dependency_job_id":null,"html_url":"https://github.com/Voronenko/devops-jenkins-box-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Voronenko/devops-jenkins-box-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Fdevops-jenkins-box-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Fdevops-jenkins-box-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Fdevops-jenkins-box-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Fdevops-jenkins-box-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Voronenko","download_url":"https://codeload.github.com/Voronenko/devops-jenkins-box-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Fdevops-jenkins-box-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276905424,"owners_count":25725559,"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","status":"online","status_checked_at":"2025-09-25T02:00:09.612Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["devops","jenkins"],"created_at":"2024-11-06T07:07:41.736Z","updated_at":"2025-09-25T11:05:43.722Z","avatar_url":"https://github.com/Voronenko.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dive into continious integration with Jenkins.\n=============================================\n\n## Background\nNowadays continious integration is the important part of the agile software development life cycle.\nThere is a number of tools on the market: Atlassian Bamboo, Jenkins, Jetbrains TeamCity.\nIn my opinion Jenkins has the most optimal product community and set of really useful plugins\nthat suits most of your software projects:  you can  build software, deploy software,  \nwebsites, portals to various places, including AWS, DigitalOcean, bare metal servers\nor to run unit tests. It can be integrated with communication tools of your choice, like Slack, HipChat or\nemail.\n\nIf you haven't had a chance to try Jenkins earlier, feel free to use tutorial below to start.\n\n## Manual installation\nIn order to install Jenkins, we will need:\n - Unix system.  I would recommend debian based, like ubuntu server LTS\n - Java runtime environment installed. I usually use Java 8\n - Get base Jenkins setup\n - Install necessary plugins\n - Put behind web server.\n\n ### Install Java\n Easist way to install Java, is using apt-get package manager\n \u003cpre\u003e\nsudo apt-get install python-software-properties\nsudo add-apt-repository ppa:webupd8team/java\nsudo apt-get update\n\u003c/pre\u003e\nOnce you added ppa above, you can install java with the following command:\n\u003cpre\u003e\nsudo apt-get install oracle-java8-installer\n\u003c/pre\u003e\n\n### Get base Jenkins setup\nYou will need to execut series of the commands, namely: add jenkins signing key,\nregister jenkins apt sources, update package lists, and install Jenkins package.\n\u003cpre\u003e\nwget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -\nsudo echo deb http://pkg.jenkins-ci.org/debian binary/ \u003e /etc/apt/sources.list.d/jenkins.list\nsudo apt-get update\nsudo apt-get install jenkins\n\u003c/pre\u003e\n\nBy default, it will install base Jenkins setup, which is insecure. You will\nneed to go to the host were your Jenkins is installed, for example: http://jenkins-host:8080/.\nNavigate to Manage Jenkins (on the left) and choose \"Configure Global Security\" item\non the page loaded.\n![enable security](https://raw.githubusercontent.com/Voronenko/devops-jenkins-box-template/master/docs/enable_security.png)\n\nNow look below on the Matrix based security (select it, if it is not selected previously),\nand make sure Anonymous only has the Read right under the View group.\nClick save at the bottom of the page. After the page load, you'll see a login form, simply ignore that,\ngo to the home page (like, for example, http://jenkins-host:8080/). You'll see this sign up form,\nthe first signed up account will be the administrator.\n\n### Power of plugins.\nJenkins would not be so powerful without plugins. Usually I install next plugins by default:\n\n- bitbucket\n  BitBucket plugin is designed to offer integration between BitBucket and Jenkins. BitBucket offer a Jenkins hook, but this one just trigger a build for a specific job on commit, nothing more. BitBucket plugin, like GitHub plugin already did, use the POST hook payload to check which job has to get triggered based on changed repository/branch.\n  Plugin page:  https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin\n\n- bitbucket-pullrequest-builder\nThis plugin builds pull requests from Bitbucket.org. Must have plugin, if you perfor QA deploy of each pull request submitted.\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/Bitbucket+pullrequest+builder+plugin\n\n- build-pipeline-plugin\nThis plugin provides a Build Pipeline View of upstream and downstream connected jobs that typically form a build pipeline.  In addition, it offers the ability to define manual triggers for jobs that require intervention prior to execution, e.g. an approval process outside of Jenkins. Provides nice visualization of the pathes \u0026 flows.\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin\n\n- copyartifact\nAdds a build step to copy artifacts from another project. The plugin lets you specify which build to copy artifacts from (e.g. the last successful/stable build, by build number, or by a build parameter). You can also control the copying process by filtering the files being copied, specifying a destination directory within the target project, etc\nPlugin page:  https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin\n- credentials\nAdds a build step to copy artifacts from another project. The plugin lets you specify which build to copy artifacts from (e.g. the last successful/stable build, by build number, or by a build parameter). You can also control the copying process by filtering the files being copied, specifying a destination directory within the target project, etc\nPlugin page:  https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Plugin\n- delivery-pipeline-plugin\nVisualisation of Delivery/Build Pipelines, renders pipelines based on upstream/downstream jobs. When using Jenkins as a build server it is now possible with the Delivery Pipeline Plugin to visualise one or more Delivery Pipelines in the same view even in full screen\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/Delivery+Pipeline+Plugin\n- environment-script\nEnvironment Script Plugin allows you to have a script run after SCM checkout, before the build. If the script fails (exit code isn't zero), the build is marked as failed.\nAny output on standard out is parsed as environment variables that are applied to the build. It supports \"override syntax\" to append paths to PATH-like variables\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/Environment+Script+Plugin\n- git\nSupports popular git version control system\n- ghprb\nThis plugin builds pull requests in github. Must have, if your software development life cycle includes deploying pull requests\nto PR environment to test.\nPlugin page:  https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin\n- greenballs The most funny plugin - changes Jenkins to use green balls instead of blue for successful builds\n Plugin page: https://wiki.jenkins-ci.org/display/JENKINS/Green+Balls\n\n- hipchat\nThis plugin allows your team to setup build notifications to be sent to HipChat rooms.To enable notifications add \"HipChat Notifications\" as a post-build step.\nPlugin page:  https://wiki.jenkins-ci.org/display/JENKINS/HipChat+Plugin\n- junit\nAllows JUnit-format test results to be published. Note: number of tools, including Karma, PhpUNIT \u0026 other tools allow to publish test results in a JUnit format. Thus this is must have plugin for unit test flows.\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/JUnit+Plugin\n- matrix-auth\nOffers matrix-based security authorization strategies (global and per-project). Good, if you have shared build server across several teams,\nPlugin page:  https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Authorization+Strategy+Plugin\n- parameterized-trigger\nThis plugin lets you trigger new builds when your build has completed, with various ways of specifying parameters for the new build.\nYou can add multiple configurations: each has a list of projects to trigger, a condition for when to trigger them (based on the result of the current build), and a parameters section.\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin\n- rebuild\nPlays nice the with previous one: this plug-in allows the user to rebuild a parametrized build without entering the parameters again.\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin\n- ssh You can use the SSH Plugin to run shell commands on a remote machine via ssh\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/SSH+plugin\n- s3 allows uploading artifacts to S3 with multiple options.\nPlugin page:  https://wiki.jenkins-ci.org/display/JENKINS/S3+Plugin\n- throttle-concurrents\nThis plugin allows for throttling the number of concurrent builds of a project running per node or globally.\nUnfortunately, this is must have plugin for Node (0.10-0.12) projects with NPM  - two concurrent npm install will fail often.\nPlugin page: https://wiki.jenkins-ci.org/display/JENKINS/Throttle+Concurrent+Builds+Plugin\n\nPlugins are installed using Plugin manager on a Manage Jenkins Section.\n![Plugins manager](https://raw.githubusercontent.com/Voronenko/devops-jenkins-box-template/master/docs/plugins-manager.png)\n\n\n### Put behind web server\nUsually I hide Jenkins behind nginx. Typical configuration looks like the one below\n\u003cpre\u003e\nserver {\n  listen 443 ssl;\n  server_name jenkins.vagrant.dev;\n\n  ssl_certificate /etc/nginx/jenkins_selfsigned.crt;\n  ssl_certificate_key /etc/nginx/jenkins_selfsigned.key;\n\n  location / {\n    proxy_pass http://127.0.0.1:8080;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_redirect off;\n\n    proxy_connect_timeout 150;\n    proxy_send_timeout 100;\n    proxy_read_timeout 100;\n  }\n  ...\n}\n\u003c/pre\u003e\n\n## Automated installation\nDo I install Jenkins manually each time? Of course not, I do it often for my customers.\nWith ansible, and sa-box-jenkins role new Jenkins installation can be deployed while you drink the coffee.\n\nLet's prepare basic bootstrap project, that can be used by you in the future.\nIt includes following files:\n\n- *bootstrap.sh* - installs ansible alongside with dependences.\n- *init.sh* - initializes 3rd party dependencies\n- *.projmodules* - fully compatible with .gitmodules git syntax,  specifies list of the dependencies\nthat will be used by the playbook.\nIn particular, it includes ansible- by default developer_recipes (repository with set of handy deployment recipes)\nand ansible role called  *sa-box-bootstrap* responsible for box securing steps (assuming you plan to put Jenkins on a remote hosts).\n\n\u003cpre\u003e\n[submodule \"public/ansible_developer_recipes\"]\n\tpath = public/ansible_developer_recipes\n\turl = git@github.com:Voronenko/ansible-developer_recipes.git\n[submodule \"roles/sa-box-bootstrap\"]\n        path = roles/sa-box-bootstrap\n        url = git@github.com:softasap/sa-box-bootstrap.git\n[submodule \"roles/sa-box-jenkins\"]\n        path = roles/sa-box-jenkins\n        url = git@github.com:softasap/sa-box-jenkins.git\u003c/pre\u003e\n- *hosts* - list here the initial box credentials, that were provided to you for the server. Note: jenkins-bootstrap assumes, you have the fresh box with the root access only. If your box already secured, adjust credentials appropriately\n\u003cpre\u003e\n[jenkins-bootstrap]\njenkins_bootstrap ansible_ssh_host=192.168.0.17 ansible_ssh_user=yourrootuser ansible_ssh_pass=yourpassword\n[jenkins]\njenkins ansible_ssh_host=192.168.0.17 ansible_ssh_user=jenkins\n\u003c/pre\u003e\n- *jenkins_vars.yml* - set here specific environment overrides, like your preferred deploy user name and keys.\n- *jenkins_bootstrap.yml* - First step - box securing. Creates jenkins user, and secures the box using sa-box-bootstrap role.\n[See more details](https://github.com/softasap/sa-box-bootstrap) about the sa-box-bootstrap role\nIn order, to override params for *sa-box-bootstrap* - pass the parameters like in example below.\n\n\u003cpre\u003e\n- hosts: all\n\n  vars_files:\n    - ./jenkins_vars.yml\n  roles:\n     - {\n         role: \"sa-box-bootstrap\",\n         root_dir: \"{{playbook_dir}}/public/ansible_developer_recipes\",\n         deploy_user: \"{{jenkins_user}}\",\n         deploy_user_keys: \"{{jenkins_authorized_keys}}\"\n       }\u003c/pre\u003e\n- *jenkins.yml* provisioning script that configures jenkins with set of plugins and users.\n- *jenkins_vars.yml* configuration options for jenkins deployment.\n- *setup_jenkins.sh* shell script that invokes deployment in two steps: initial box bootstraping \u0026 jenkins setup\n\u003cpre\u003e\n#!/bin/sh\n\nansible-playbook jenkins_bootstrap.yml --limit jenkins_bootstrap\nansible-playbook jenkins.yml --limit jenkins\n\u003c/pre\u003e\n\n\n## Configuration options for automated installation\nYou need to override:  \n- jenkins_authorized_keys (this is list of the keys, that allow you to login to Jenkins box under jenkins)\n- jenkins_domain - your agency domain\n- jenkins_host - name of the jenkins host (Site will be binded to jenkins_host.jenkins_domain)\n- java_version - your Java choice (6,7,8 supported)\n\n\u003cpre\u003e\njenkins_user: jenkins\njenkins_authorized_keys:\n  - \"{{playbook_dir}}/components/files/ssh/vyacheslav.pub\"\n\njenkins_domain: \"vagrant.dev\"\njenkins_host: \"jenkins\"\n\njava_version: 8\n\u003c/pre\u003e\n\n-jenkins_users list of users with passwords to create. Admin and deploy are required users.\nAdmin is used to manage instance, deploy is used to access the artifacts via deployment scripts.\nIf you won't override passwords, default one will be used (per role), which is not the best, for public deployments.\n\u003cpre\u003e\njenkins_users:\n  - {\n    name: \"Admin\",\n    password: \"AAAdmin\",\n    email: \"no-reply@localhost\"\n    }\n  - {\n    name: \"deploy\",\n    password: \"DeDeDeDeploy\",\n    email: \"no-reply@localhost\"\n    }\n\u003c/pre\u003e\n\n- jenkins_plugins Your choice of plugins to install. By default:\n\n\u003cpre\u003e\njenkins_plugins:\n  - bitbucket # https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin\n  - bitbucket-pullrequest-builder\n  - build-pipeline-plugin\n  - copyartifact # https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin\n  - credentials # https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Plugin\n  - delivery-pipeline-plugin # https://wiki.jenkins-ci.org/display/JENKINS/Delivery+Pipeline+Plugin\n  - environment-script # https://wiki.jenkins-ci.org/display/JENKINS/Environment+Script+Plugin\n  - git\n  - ghprb # https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin\n  - greenballs # https://wiki.jenkins-ci.org/display/JENKINS/Green+Balls\n  - hipchat # https://wiki.jenkins-ci.org/display/JENKINS/HipChat+Plugin\n  - junit # https://wiki.jenkins-ci.org/display/JENKINS/JUnit+Plugin\n  - matrix-auth # https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Authorization+Strategy+Plugin\n  - matrix-project #https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Project+Plugin\n  - parameterized-trigger #https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin\n  - rebuild # https://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin\n  - ssh\n  - s3 # https://wiki.jenkins-ci.org/display/JENKINS/S3+Plugin\n  - throttle-concurrents #https://wiki.jenkins-ci.org/display/JENKINS/Throttle+Concurrent+Builds+Plugin\n\u003c/pre\u003e\n\n## Code in action\n\nCode can be downloaded from repository [https://github.com/Voronenko/devops-jenkins-box-template](https://github.com/Voronenko/devops-jenkins-box-template)\nIn order to use it - fork it, adjust parameters to your needs, and use.\n\nRunning is as simple as\n\u003cpre\u003e\n./setup_jenkins.sh\n\u003c/pre\u003e\n\nWelcome to the world of continious integration \u0026 deployment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronenko%2Fdevops-jenkins-box-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoronenko%2Fdevops-jenkins-box-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronenko%2Fdevops-jenkins-box-template/lists"}