task 2
GITHUB + JENKINS+ DOCKER
- Create container image that’s has Jenkins installed using dockerfile
- When we launch this image, it should automatically starts Jenkins service in the container.
- Create a job chain of job1, job2, job3 and job4 using build pipeline plugin in Jenkins
- Job1 : Pull the Github repo automatically when some developers push repo to Github.
- Job2 : By looking at the code or program file, Jenkins should automatically start the respective language interpreter install image container to deploy code ( eg. If code is of PHP, then Jenkins should start the container that has PHP already installed ).
- Job3 : Test your app if it is working or not.
- Job4 : if app is not working , then send email to developer with error messages.
- Create One extra job job5 for monitor : If container where app is running. fails due to any reson then this job should automatically start the container again
Pre-required
- linix os (redhat ,centos, ubuntu, debian)
- Github account
- docker engine
- email account
step 1
docker file entry
step 2
run build cmd
step 3
run docker container
step 4
enter password setup jenkins
job 1
Pull the Github repo automatically when some developers push repo to Github.
step 1
step 2
step 3
step 4
build job 1 and check console output
job 2
create job 2
By looking at the code or program file, Jenkins should automatically start the respective language interpreter install image container to deploy code ( eg. If code is of PHP, then Jenkins should start the container that has PHP already installed ).
build job 2 and check console output
Job 3
create job 3
test your app if it is working or not.
job 4
Job4 : if app is not working , then send email to developer with error messages.
job 5
Create One extra job job5 for monitor : If container where app is running. fails due to any reson then this job should automatically start the container again
check in browser