Welcome to billiondollarapp
- the next big thing in the tech world. This README will guide you through setting up a Continuous Integration and Continuous Deployment (CI/CD) pipeline using Jenkins. We'll also give you a primer on Docker, Jenkins, and the basics of CI/CD.
- A basic understanding of Git & GitHub.
- Docker installed on your machine. If not, follow Docker's official guide.
- Jenkins installed on your machine. Refer to the Jenkins installation guide.
Docker is a platform that allows you to develop, ship, and run applications inside containers. Think of containers as lightweight, standalone executable software packages that encompass everything an app needs to run, ensuring consistent behavior across environments.
Key Terms:
- Image: A snapshot of a container. It’s a lightweight, stand-alone, executable software package.
- Container: A running instance of an image.
Basic Docker Commands:
# Pull an image from DockerHub
docker pull <image_name>
# List all running containers
docker ps
# Run a container
docker run <image_name>
# Stop a container
docker stop <container_id>
Jenkins is an open-source automation tool to facilitate CI/CD. With Jenkins, teams can automate various stages of the development process.
- Pipeline: A series of automated processes to get code from version control straight to your users.
- Executor: A computational resource where builds can be run.
- Node: A machine on which Jenkins runs.
-
Continuous Integration (CI): A software development practice where developers integrate code into a shared repository frequently. Automated tests validate these integrations.
-
Continuous Deployment (CD): The process of automatically deploying the integrated code to production after passing CI tests.
- Setup Jenkins Using the provided docker commands
docker build -t jenkins-server -f ./Dockerfile_jenkins_server .
- To run our Jenkins Docker image, use the following command:
docker run --name jenkins -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 --restart=on-failure jenkins-server
- Open your browser and navigate to http://localhost:8080/ to access the Jenkins dashboard.
- Complete the initial setup.
- On the Jenkins dashboard, click on
New Item
. - Enter a name for your job, select
Freestyle project
, and clickOK
.
- Under
Source Code Management
, selectGit
. - Enter your GitHub repository URL.
- Check
Poll SCM
and set a schedule. For instance,H/5 * * * *
will poll the repository every 5 minutes.
- Click on
Add build step
and selectExecute shell
. - Add commands to build your project (e.g.,
docker build -t billiondollarapp .
).
- Click on
Add post-build action
. - Configure according to your deployment environment.
- Click on
Save
. - Click on
Build Now
to start the CI/CD process.
Congratulations! You've now set up a basic Jenkins CI/CD pipeline for your billiondollarapp
.
Feel free to raise issues or submit Pull Requests on GitHub. All contributions are welcome.