Jenkins Freestyle Project for DevOps Engineers. The Community is absolutely
create a agent for your app. ( which you deployed from docker in earlier task)
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.
Log in to your Jenkins instance and click on the “New Item” button.
Give your project a name “Django-todo-delivery” , select “Freestyle project” as the type, and click on the “OK” button.
Add your GitHub project URL.
In the “Build” section, click on the “Add build step” button and select “Execute shell” option.
In the “Command” field, enter the following command
echo "hello"
docker build . -t node:12.2.0-alpine
docker run -d --name todo-docker -p 8000:8000 node:12.2.0-alpine
To view the console output of a Jenkins build, follow these steps:
Go to the Jenkins dashboard and select the project that you want to view the console output for.
Click on the build number of the build that you want to view the console output for.
In the build details page, you will see a button named “Console Output”. Click on the button to view the console output.
The console output will show you the output of the build steps, including the output of any shell commands that were run as part of the build.
Set the inbound rule on AWS and access the app at “public-ip:8000”/
Open the particular IP on which it is hosted. It will be up and running.
Task-02
Create Jenkins project to run “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 “docker-compose down” command to stop and remove the containers defined in the compose file.
Log in to your Jenkins instance and click on the “New Item” button.
Give your project a name “Django-todo-delivery” , select “Freestyle project” as the type, and click on the “OK” button.
Add your GitHub project URL.
In the “Build” section, click on the “Add build step” button and select “Execute shell” option.
In the “Command” field, enter the following command
echo "Building"
docker-compose down
docker-compose up -d
To view the console output of a Jenkins build, follow these steps:
Go to the Jenkins dashboard and select the project that you want to view the console output for.
Click on the build number of the build that you want to view the console output for.
In the build details page, you will see a button named “Console Output”. Click on the button to view the console output.
The console output will show you the output of the build steps, including the output of any shell commands that were run as part of the build.
- Create Jenkins project to run “docker-compose up -d” command to start the multiple containers defined in the compose file.
Open the particular IP on which it is hosted. It will be up and running.
- Set up a cleanup step in the Jenkins project to run “docker-compose down” command to stop and remove the containers defined in the compose file.
Thank you for reading this blog. Hope it helps.
Happy Learning:)