This article contains how Jenkins makes the project automate for the developer from writing the code to deployment just by assigning the jobs.
本文包含Jenkins如何使开发人员从分配代码到部署仅通过分配作业就使开发人员自动化。
Task :-
任务:-
- Use the docker file to build the container with the customized image having Jenkins installed . 使用docker文件构建安装有Jenkins的自定义映像的容器。
- Jenkins should automatically Start as soon as the image is successfully launched. 映像成功启动后,Jenkins应该自动启动。
- Now we have assign the jobs to the Jenkins and create a chain of the jobs using pipeline plugins. 现在,我们已将作业分配给Jenkins,并使用管道插件创建了一系列作业。
Now, we are going to create the file with name DOCKERFILE having the following commands:
现在,我们将使用以下命令创建名称为DOCKERFILE的文件:
Now we will use our VM and run the command :
现在,我们将使用我们的VM并运行以下命令:
Jenkins project performs a full test flow with the following JDK/JREs:
Jenkins项目使用以下JDK / JRE执行完整的测试流程:
OpenJDK JDK / JRE 8 - 64 bits
OpenJDK JDK / JRE 8-64位
OpenJDK JDK / JRE 11 - 64 bits
OpenJDK JDK / JRE 11-64位
Using the cmd : docker image
使用cmd:docker映像
To check the status that the image is active or not
检查图像是否处于活动状态
Now , logging in Jenkins in browser
现在,在浏览器中登录Jenkins
JOB 1:- Automatically pulling the repo from GitHub whenever the developer push the repo using ssh plugins.
工作1 :-每当开发人员使用ssh插件推送仓库时,都会自动从GitHub中提取仓库。
> After successfully logging in to jenkins we have to install GitHub plugin .
>成功登录jenkins之后,我们必须安装GitHub插件。
> Then we have to provide the GitHub URL to fetch data.
>然后,我们必须提供GitHub URL来获取数据。
JOB2:- By looking at the code or program file , jenkins should automatically start the respective language interpreter install image container to deploy code.
JOB2 :-通过查看代码或程序文件,jenkins应该自动启动相应的语言解释器安装映像容器以部署代码。
JOB3:- Testing the app if it is working or not .
JOB3 :-测试应用程序是否正常运行。
JOB4:- Check if the app is not working , then send email to developer with error messages.We created a python file and if this site wont work or face any error ,it will run and developer will receive any email.
JOB4 :-检查应用程序是否无法正常运行,然后将错误消息发送给开发人员。我们创建了一个python文件,如果此网站无法正常工作或遇到任何错误,它将运行,开发人员将收到任何电子邮件。
>import smtplib
>进口smtplib
>server = smtplib.SMTP_SSL(“smtp.gmail.com”,465)
>服务器= smtplib.SMTP_SSL(“ smtp.gmail.com”,465)
>server.login = (mltask2@gmail.com,******)
> server.login =(mltask2@gmail.com,******)
>server.sendmail(“rohitkumawat1968@gmail.com”,
> server.sendmail(“ rohitkumawat1968@gmail.com”,
your site is not working)
您的网站无法正常工作)
>server.quit()
> server.quit()
This is the full automation of the php server using GitHub, Jenkins, and Docker.
这是使用GitHub,Jenkins和Docker的php服务器的完全自动化。
Thank u…!!
感谢你…!!