接近学了一个月的Jenkins,docker以及k8s等devops相关的工具,感觉有必要做一个阶段性总结,这次总结大概了解一下各个工具的相关概念,以及这一个月做的一个nodejs+mongodb项目从项目构建直到项目测试的一个Jenkins的pipeline demo。
概念总结:
Jenkins:Jenkins 是一个开源项目,提供了一种易于使用的持续集成系统,使开发者从繁杂的集成中解脱出来,专注于更为重要的业务逻辑实现上。同时 Jenkins 能实施监控集成中存在的错误,提供详细的日志文件和提醒功能,还能用图表的形式形象地展示项目构建的趋势和稳定性。(Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software).
docker:Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。(Docker is a platform for developers and sysadmins to develop, deploy, and run applications with containers. The use of Linux containers to deploy applications is called containerization,containers are flexiable lightweight Interchangeable Portable Portable Portable)
k8s:首先,它是一个全新的基于容器技术的分布式架构领先方案,其次,Kubernetes是一个开放的开发平台;最后,Kubernetes是一个完备的分布式系统支撑平台。(Kubernetes is an open source system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.)
DevOps (a clipped compound of "development" and "operations") is a software development methodology that combines software development (Dev) with information technology operations (Ops). The goal of DevOps is to shorten the systems development life cycle while also delivering features, fixes, and updates frequently in close alignment with business objectives.[1] The DevOps approach is to include automation and event monitoring at all steps of the software build.
devops以及devops相关工具的概念就介绍到这,一般也都可以查到相关概念,下面主要介绍一下在学习期间做的一个Jenkins的pipeline demo。pipeline主要是Jenkins一个工作流框架,他可以将独立运行的task整合编排在一起,实现CI/CD和devops的转变。这个demo主要是将build好的nodejs+mongedb项目实现code>build>test>package>release>monitor的一套流程。(pipeline is a Jenkins workflow framework,it can integrate the tasks that running independently,enable the transformation to CI/CD and Devops,this demo is based on nodejs and mongodb,it realize code>build>test>package>release>monitor.)
首先,要将build完成的项目容器化,所以分别做了mongodb和nodejs的Dockerfile,用来生成docker images,然后再执行docker run 用来生成mongodb和nodejs的containers,这里要注意如果想让两个docker容器相互连接,比如nodejs容器需要连接mongodb容器,需要在docker run的时候使用--link属性。(First,make the project containerized,so make the mongodb and nodejs's Dockerfile to build docker images,then execute docker run command to build mongodb and nodejs's containers,if you want to connect a container with another one when you excute docker run you should add --link)
我们现在可以通过浏览器访问容器化后的项目,下一步就是要将containered的一系列操作通过Jenkinsfile整合在一起,制作pipeline来自动执行容器化操作以及最后的selenium test操作。(Then,we can access our containered project in broswer , next step we should use Jenkinsfile to automate tasks that related to build package release and test.)
代码相关的内容后续贴上。
网友评论