{"id":21971288,"url":"https://github.com/eldada/jenkins-pipelines-examples","last_synced_at":"2026-03-16T22:32:04.532Z","repository":{"id":114564348,"uuid":"96286152","full_name":"eldada/jenkins-pipelines-examples","owner":"eldada","description":"Keep a few examples of Jenkins Pipelines","archived":false,"fork":false,"pushed_at":"2017-07-23T07:01:54.000Z","size":19,"stargazers_count":16,"open_issues_count":0,"forks_count":45,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T09:21:25.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","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/eldada.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":"2017-07-05T06:47:34.000Z","updated_at":"2024-02-26T08:28:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"0fbcef10-a64c-4d03-a73f-120b8f953701","html_url":"https://github.com/eldada/jenkins-pipelines-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fjenkins-pipelines-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fjenkins-pipelines-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fjenkins-pipelines-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fjenkins-pipelines-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldada","download_url":"https://codeload.github.com/eldada/jenkins-pipelines-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251309007,"owners_count":21568728,"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-11-29T14:49:52.880Z","updated_at":"2026-03-16T22:32:04.500Z","avatar_url":"https://github.com/eldada.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jenkins Pipelines Examples\nKeep a few examples of Jenkins Pipelines. Mostly used for demo and training.\n\nLook in each directory and find the `Jenkinsfile` with the example. See more details are in the `Jenkinsfile` comments.\n\n**You are more than welcome to contribute, share and ask.**\n\n## Setup Local Jenkins\nThese examples assume a simple setup of a single Jenkins master and two agents.\n\nThe setup is installed and run in a [Vagrant](https://www.vagrantup.com/) image.\n\n### Spin up the Vagrant VM\nRun the following in the root of the repository\n```bash\n# Spin up the Vagrant VM\n$ vagrant up\n\n# Once finished, ssh into VM\n$ vagrant ssh\n```\n\n### Start a local Jenkins master\n- Build the custom Jenkins Docker image\n```bash\n# Go into the directory that has the repository files\n$ cd /opt/provisioning/\n\n# Build the Jenkins Docker image\n$ docker build -t jenkinsx:1 -f jenkins/Dockerfile .\n```\n\n- Prepare directories and permissions\n```bash\n# Permissions on /var/run/docker.sock\n$ sudo chmod 666 /var/run/docker.sock\n\n# Directory for Jenkins home\n$ mkdir -p ~/jenkins_home\n$ chmod -R 777 ~/jenkins_home\n```\n\n- Start the Jenkins master\n```bash\n$ docker run -d --name jenkins -p 8080:8080 -p 50000:50000 -v /var/run/docker.sock:/var/run/docker.sock -v ~/jenkins_home:/var/jenkins_home jenkinsx:1\n```\n- Browse to http://192.168.17.17:8080 and complete the initial setup wizard\n  - Get initial admin password from `docker logs jenkins` output\n  - Install suggested plugins\n  - Install the **Docker Slaves Plugin** (for dynamic Docker agent provisioning per build)\n  - Install the **Blue Ocean plugin** (recommended)\n- Define two Jenkins agents (slaves)\n  - Create two nodes from the `Manage Jenkins` -\u003e `Manage Nodes`\n  - Call the nodes `agent1` and `agent2`\n  - Set remote root directory to `/home/jenkins`\n  - Configure them to `Launch method` -\u003e `Launch agent via Java Web Start`\n  - Get the secret token for each node (**AGENT1_TOKEN** and **AGENT2_TOKEN**)\n\n### Start two Jenkins agents (slaves)\nOnce you have the tokens for the agents, start the two agents\n```bash\n# Start agent 1\n$ docker run -d --link jenkins:jenkins-server --name agent1 jenkinsci/jnlp-slave:3.7-1 -url http://jenkins-server:8080 ${AGENT1_TOKEN} agent1\n\n# Start agent 2\n$ docker run -d --link jenkins:jenkins-server --name agent2 jenkinsci/jnlp-slave:3.7-1 -url http://jenkins-server:8080 ${AGENT2_TOKEN} agent2\n\n```\n\n### Create Pipeline jobs\nYou can create a Pipeline type job using any of the provided examples in the different directories\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fjenkins-pipelines-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldada%2Fjenkins-pipelines-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fjenkins-pipelines-examples/lists"}