当前位置:网站首页>Deops入门
Deops入门
2022-07-03 17:30:00 【yolo2016】
Deops入门
DevOps 是什么?
DevOps,字面意思是Development &Operations的缩写,也就是开发&运维。
软件开发流程
整体的软件开发流程包括:
- PLAN:开发团队根据客户的目标制定开发计划
- CODE:根据PLAN开始编码过程,需要将不同版本的代码存储在一个库中。
- BUILD:编码完成后,需要将代码构建并且运行。
- TEST:成功构建项目后,需要测试代码是否存在BUG或错误。
- DEPLOY:代码经过手动测试和自动化测试后,认定代码已经准备好部署并且交给运维团队。
- OPERATE:运维团队将代码部署到生产环境中。
- MONITOR:项目部署上线后,需要持续的监控产品。
- INTEGRATE:然后将监控阶段收到的反馈发送回PLAN阶段,整体反复的流程就是DevOps的核心,即持续集成、持续部署。
CI/CD
CI/CD可以理解为:
- CI过程即是通过Jenkins将代码拉取、构建、制作镜像交给测试人员测试。
- 持续集成:让软件代码可以持续的集成到主干上,并自动构建和测试。
- CD过程即是通过Jenkins将打好标签的发行版本代码拉取、构建、制作镜像交给运维人员部署。
- 持续交付:让经过持续集成的代码可以进行手动部署。
- 持续部署:让可以持续交付的代码随时随地的自动化部署。
1) coder将代码push到gitlab仓库
2)jenkins将gitlab仓库代码拉去过来,插件maven用来构建,代码打包成应用程序
3)jenkis将程序push到服务器环境中,以docker的方式运行。
工具介绍以及环境部署
docker环境准备
yum -y install yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl start docker
systemctl enable docker
docker version
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF' { "exec-opts": ["native.cgroupdriver=systemd"], "registry-mirrors": ["https://du3ia00u.mirror.aliyuncs.com"], "live-restore": true, "log-driver":"json-file", "log-opts": {"max-size":"500m", "max-file":"3"}, "max-concurrent-downloads": 10, "max-concurrent-uploads": 5, "storage-driver": "overlay2" } EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod 777 /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose -version
chmod a+x docker-compos
Code阶段
gitlab安装
docker search gitlab
docker pull gitlab/gitlab-ce
[[email protected] gitlab]# cat docker-compose.yml
version: '3.7'
services:
gitlab:
image: gitlab/gitlab-ce
container_name: gitlab
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://192.168.3.80:8929'
gitlab_rails['gitlab_shell_ssh_port'] = 2224
ports:
- '8929:8929'
- '2224:2224'
volumes:
- './config:/etc/gitlab'
- './logs:/var/log/gitlab'
- './data:/var/opt/gitlab'
docker-compose up -d
docker exec -it gitlab cat /etc/gitlab/initial_root_password
git使用
git add .
git commit -m 'update'
git push -u origin --all
Integrate 工具
jenkins 安装
[[email protected]_host81 docker-jenkis]# cat docker-compose.yml
version: "3"
services:
jenkins:
image: jenkins/jenkins:lts-jdk11
container_name: jenkins
ports:
- 8080:8080
- 50000:50000
volumes:
- ./data/:/var/jenkins_home/
docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword
Maven环境准备
https://maven.apache.org/download.cgi
jdk下载地址 http://www.codebaoku.com/jdk/jdk-oracle-jdk11.html
将jdk以及maven放到jekins的目录下,以便jenkins能访问到。
Maven中设置私地址以及jdk版本
[[email protected]_host81 conf]# ll -d settings.xml
-rw-r–r–. 1 root root 11088 7月 2 17:27 settings.xml
<!-- 阿里云镜像地址 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- JDK1.8编译插件 -->
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
案例
边栏推荐
- How to train mask r-cnn model with your own data
- 新库上线 | CnOpenData中国保险机构网点全集数据
- Is AI too slow to design pictures and draw illustrations? 3 sets of practical brushes to save you
- QT learning diary 9 - dialog box
- Vs code plug-in korofileheader
- Where is the monitoring page of RDS database?
- 数仓任务里面 跑SQL任务的时候用的数据库账号是在哪里配置的
- An example of HP array card troubleshooting
- i++与++i的区别:通俗易懂的讲述他们的区别
- When absolutely positioned, the element is horizontally and vertically centered
猜你喜欢
Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
Luogu: p2685 [tjoi2012] Bridge
Introduction to SolidWorks gear design software tool geartrax
1146_ SiCp learning notes_ exponentiation
设计电商秒杀
Leetcode 108 converts an ordered array into a binary search tree -- recursive method
[error reporting] omp: error 15: initializing libiomp5md dll, but found libiomp5md. dll already initialized.
互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
【RT-Thread】nxp rt10xx 设备驱动框架之--Pin搭建和使用
大变局!全国房价,跌破万元大关
随机推荐
Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
Qt调节Win屏幕亮度和声音大小
Introduction to SolidWorks gear design software tool geartrax
PR second time
毕业总结
September, 19, "cam principle and application" online assignment [Full Score answer]
1146_ SiCp learning notes_ exponentiation
Golang单元测试、Mock测试以及基准测试
[combinatorics] recursive equation (example of solving recursive equation without multiple roots | complete process of solving recursive equation without multiple roots)
Unity notes unityxr simple to use
How to purchase Google colab members in China
【RT-Thread】nxp rt10xx 设备驱动框架之--hwtimer搭建和使用
[UE4] brush Arctic pack high quality Arctic terrain pack
[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th
One brush 149 force deduction hot question-10 regular expression matching (H)
Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)
[combinatorics] recursive equation (four cases where the non-homogeneous part of a linear non-homogeneous recursive equation with constant coefficients is the general solution of the combination of po
Great changes! National housing prices fell below the 10000 yuan mark
互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
New library online | cnopendata complete data of Chinese insurance institution outlets