{"id":23282174,"url":"https://github.com/alilotfi23/jenkins-docker-ansible","last_synced_at":"2025-09-12T03:22:13.650Z","repository":{"id":194523134,"uuid":"691016547","full_name":"alilotfi23/jenkins-docker-ansible","owner":"alilotfi23","description":"Simple devops project","archived":false,"fork":false,"pushed_at":"2024-12-05T09:45:51.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-05T10:30:37.803Z","etag":null,"topics":["ansible","apache","cd","ci","ci-cd","docker","dockerfile","jenkins","pipeline"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/alilotfi23.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":"2023-09-13T10:38:29.000Z","updated_at":"2024-12-05T09:45:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"a67d809a-5c36-47cb-95f7-1b9c8fc7accc","html_url":"https://github.com/alilotfi23/jenkins-docker-ansible","commit_stats":null,"previous_names":["alilotfi23/jenkins-docker-ansible"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alilotfi23%2Fjenkins-docker-ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alilotfi23%2Fjenkins-docker-ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alilotfi23%2Fjenkins-docker-ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alilotfi23%2Fjenkins-docker-ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alilotfi23","download_url":"https://codeload.github.com/alilotfi23/jenkins-docker-ansible/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230516165,"owners_count":18238353,"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":["ansible","apache","cd","ci","ci-cd","docker","dockerfile","jenkins","pipeline"],"created_at":"2024-12-20T00:14:53.784Z","updated_at":"2024-12-20T00:14:54.505Z","avatar_url":"https://github.com/alilotfi23.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jenkins-Docker-Ansible\n\nA simple DevOps Project (CI/CD) with Jenkins, Docker, and Ansible.\n\n## BluePrint\n![blueprint](https://github.com/alilotfi23/jenkins-docker-ansible/assets/91953142/8d1eb684-2ac9-46ba-8b9e-cae8a822f23f)\n\n### Workflow Description\n\n1. **Developer Pushes Code**:\n    - Developers push their code changes to a Git repository.\n\n2. **Jenkins Pulls Code**:\n    - Jenkins is configured to pull the latest code from the Git repository whenever a change is detected.\n\n3. **Jenkins Builds Docker Image**:\n    - Jenkins builds a Docker image from the pulled code.\n\n4. **Push Docker Image**:\n    - The Docker image is pushed to a Docker registry for storage and further use.\n\n5. **Ansible Deployment**:\n    - Ansible pulls the Docker image from the registry and deploys it to the development environment.\n    - Ansible can also push the image to other environments (e.g., staging, production).\n\n## Prerequisites\n\n- **Jenkins**: Ensure Jenkins is installed and running.\n- **Docker**: Ensure Docker is installed and running.\n- **Ansible**: Ensure Ansible is installed and configured.\n- **Git**: Ensure Git is installed and your repository is set up.\n\n## Setup Instructions\n\n### Jenkins Setup\n\n1. **Install Required Plugins**:\n    - Docker Pipeline Plugin\n    - Git Plugin\n    - Ansible Plugin\n\n2. **Configure Jenkins Pipeline**:\n    - Create a new pipeline job in Jenkins.\n    - Add your Git repository URL.\n    - Write a Jenkinsfile in your repository to define the build, push, and deployment steps.\n\n### Docker Setup\n\n1. **Dockerfile**:\n    - Please ensure you have a Dockerfile in your repository that Jenkins will use to build the image.\n\n### Ansible Setup\n\n1. **Inventory and Playbook**:\n    - Create an inventory file listing your target servers.\n    - Write an Ansible playbook to handle the deployment of the Docker image.\n\n## Example Jenkinsfile\n\n```groovy\npipeline {\n  agent any\n\n  stages {\n    stage('building image') {\n      steps {\n        sh 'docker image build -t $JOB_NAME:v1.$BUILD_ID .'\n        sh 'docker image tag $JOB_NAME:v1.$BUILD_ID alilotfi/$JOB_NAME:latest'\n      }\n    }\n\n    stage('Ansible version') {\n      steps {\n        script {\n          \n          sh 'ansible --version'\n\n        }\n      }\n    }\n\n    stage('Ansible Deploy') {\n\n      steps {\n\n        sh 'ansible-playbook -i /etc/ansible/hosts -u ubuntu /var/lib/jenkins/workspace/jenkins-docker-ansible/ansible/play.yml'\n\n      }\n    }\n  }\n}\n```\n\n## Running the Pipeline\n\n1. **Trigger the Pipeline**:\n    - Push code changes to your Git repository.\n    - Jenkins will automatically trigger the pipeline.\n\n2. **Monitor the Pipeline**:\n    - Monitor the pipeline's progress in the Jenkins dashboard.\n    - Ensure each stage is completed successfully.\n\n## Conclusion\n\nThis setup provides a straightforward CI/CD pipeline leveraging Jenkins, Docker, and Ansible to automate code integration, build, and deployment processes. Customize the provided examples to fit your specific project needs.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falilotfi23%2Fjenkins-docker-ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falilotfi23%2Fjenkins-docker-ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falilotfi23%2Fjenkins-docker-ansible/lists"}