❄️CI/CD
Continuous integration and continuous delivery help in automating the software development lifecycle stages, doing bug fixes and hotfixes, faster release cycles, and isolating different environments like development, testing, staging, and production.
In CI, different developers commit new changes to the source code repo and the pipeline checks out the source code from the repository. It installs all the required dependencies, then the build stage builds the executable artifact, and required testing is performed for the application and archives it.
The CD deploys the artifact to different stages and that is how the CI-CD pipeline runs continuously.
❄️Task-01
- create an agent for your app.
Create a new node -
Provide a path to configure the Jenkins node in the Host machine -
Now click on the created agent, and it will give the commands required to download the agent.jar file and connect the agent to Jenkins -
Now run the above commands on the machine where you are configuring the agent.
And My agent is now online -
- Create a new Jenkins freestyle project for your app.
In the “Build” section of the project, add a build step to run the “docker build” command to build the image for the container.
Add a second step to run the “docker run” command to start a container using the image created in step 3.
Add the repo where the application code is saved and restrict the job to run on our new agent1 -
Now add the steps to build the image and run the container -
Build the job. The job was successful -
The image is ready, and the container is running -
And my App is also running -
❄️Task-02
- Create Jenkins project to run the “docker-compose up -d” command to start the multiple containers defined in the compose file (Hint- use day-19 Application & Database docker-compose file)
- Set up a cleanup step in the Jenkins project to run the “docker-compose down” command to stop and remove the containers defined in the compose file.
Thank you for reading! 📘