Photo by Andrik Langfield on Unsplash
Hands on with Jenkins
Freestyle and Pipeline project using Jenkins and Docker
We would be checking the options when to rebuild our project using
Build Triggers
We can either set up a buildthrough scripts or after some other project
after a specific time
through commits in a particular branch
when a pull request is made
through GitHub hooks (on w In
Build Steps
we would also type certain commands so that docker-compose run creates and runs a container throughYAML
file
If we want to receive mail for failed builds we can also set up notifications.
We can also check the
Build history
in the left sidebar to see the console output for debugging.Also for commits, we can Click on
#Build number
to check the status of our build and for debugging purposes.
On port 8001 mentioned in yaml
file our web application would be built.
Building the project in jenkin through pipeline
In the pipeline, we would be defining
stages
(Code, Build, Test, Deploy) andsteps
in pipeline script once we have created the project. Theconfig
menu would be having this optionpipeline
is always written at top of the pipeline script fileagent
defines on which Operating system this code would be executed.stages
defines SDLC stages andscript
are the commands that get executed on the host machine
Then through
Full Stage View
we can see all the stagesOur app would be built using the Jenkins pipeline and would be accessible according to the port defined in
Dockerfile
orYAML
file.
References
- Train with Shubham Zero To Hero DevOps Bootcamp