{"id":22744136,"url":"https://github.com/mehradi-github/ref-jenkins","last_synced_at":"2025-03-30T04:43:30.090Z","repository":{"id":144808766,"uuid":"552390480","full_name":"mehradi-github/ref-jenkins","owner":"mehradi-github","description":"Using Jenkins in DevOps","archived":false,"fork":false,"pushed_at":"2023-10-21T08:37:42.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-05T07:12:06.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehradi-github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-10-16T13:43:06.000Z","updated_at":"2023-10-21T08:36:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb7ed39d-0af2-4760-a242-5fd0a465451b","html_url":"https://github.com/mehradi-github/ref-jenkins","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/mehradi-github%2Fref-jenkins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehradi-github%2Fref-jenkins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehradi-github%2Fref-jenkins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehradi-github%2Fref-jenkins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehradi-github","download_url":"https://codeload.github.com/mehradi-github/ref-jenkins/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277351,"owners_count":20751548,"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-11T01:40:00.552Z","updated_at":"2025-03-30T04:43:30.074Z","avatar_url":"https://github.com/mehradi-github.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Jenkins in DevOps\n\n[Jenkins](https://www.jenkins.io/doc/book/installing/linux/#red-hat-centos) is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\n## Table of Contents\n\n- [Using Jenkins in DevOps](#using-jenkins-in-devops)\n  - [Table of Contents](#table-of-contents)\n  - [Installing Jenkins(LTS)](#installing-jenkinslts)\n    - [Unlocking Jenkins](#unlocking-jenkins)\n    - [Prepare Agent and Host](#prepare-agent-and-host)\n    - [Pipeline](#pipeline)\n\n## Installing Jenkins(LTS)\n\n```sh\nsudo wget -O /etc/yum.repos.d/jenkins.repo \\\n    https://pkg.jenkins.io/redhat-stable/jenkins.repo\nsudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key\nsudo yum upgrade\n# Add required dependencies for the jenkins package\nsudo amazon-linux-extras install epel -y\nsudo amazon-linux-extras install java-openjdk11 -y\nsudo yum install jenkins -y\nsudo systemctl daemon-reload\n\nsudo systemctl enable --now jenkins\nsudo systemctl status jenkins\n```\n\nYou can see more details [Installing Jenkins on Ubuntu/Debian](https://github.com/mehradi-github/ref-ubuntu#installing-jenkins).\n\n### Unlocking Jenkins\n\n1. Browse to http://localhost:8080\n2. The command: `sudo cat /var/lib/jenkins/secrets/initialAdminPassword` will print the password at console.\n\n### Prepare Agent and Host\n\n```sh\n# Prepare agent\nsudo apt install default-jre net-tools\njava version\nifconfig -a\ngit config --global http.proxy http://192.168.1.34:8889/\n\n# set proxy\nexport all_proxy=socks5://192.168.1.34:1089/ \u0026\u0026 export ALL_PROXY=socks5://192.168.1.34:1089/\nexport http_proxy=http://192.168.1.34:8889/ \u0026\u0026 export HTTP_PROXY=http://192.168.1.34:8889/\nexport https_proxy=http://192.168.1.34:8889/ \u0026\u0026 export HTTPS_PROXY=http://192.168.1.34:8889/\nexport NO_PROXY=localhost,192.168.1.34,172.17.0.1,172.17.0.2 \u0026\u0026 export no_proxy=localhost,192.168.1.34,172.17.0.1,172.17.0.2\n# unset proxy\nunset all_proxy \u0026\u0026 unset ALL_PROXY \u0026\u0026 unset http_proxy \u0026\u0026 unset HTTP_PROXY \u0026\u0026 unset https_proxy \u0026\u0026 unset HTTPS_PROXY \u0026\u0026 unset NO_PROXY \u0026\u0026 unset no_proxy\n\n\n\n# Prepare host\nsudo su -\nssh-keyscan -H agent1 \u003e\u003e /var/lib/jenkins/.ssh/known_hosts\nchown -R jenkins:jenkins /var/lib/jenkins/.ssh\n```\n\n### Pipeline\n\nThe [Snippet Generator](http://localhost:8080/job/first-pipline/pipeline-syntax/) will help you learn the Pipeline Script code which can be used to define various steps.\n\nA Pipeline can be created in one of the following ways:\n\n- [Through Blue Ocean](https://www.jenkins.io/doc/book/pipeline/getting-started/#through-blue-ocean) - after setting up a Pipeline project in Blue Ocean, the Blue Ocean UI helps you write your Pipeline’s Jenkinsfile and commit it to source control.\n\n- [Through the classic UI](https://www.jenkins.io/doc/book/pipeline/getting-started/#through-the-classic-ui) - you can enter a basic Pipeline directly in Jenkins through the classic UI.\n\n- [In SCM](https://www.jenkins.io/doc/book/pipeline/getting-started/#defining-a-pipeline-in-scm) - you can write a Jenkinsfile manually, which you can commit to your project’s source control repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehradi-github%2Fref-jenkins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehradi-github%2Fref-jenkins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehradi-github%2Fref-jenkins/lists"}