当前位置:网站首页>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>
案例
边栏推荐
- Brief introduction to the core functions of automatic penetration testing tool
- A day's work list of an ordinary programmer
- Redis: operation commands for list type data
- SSH连接远程主机等待时间过长的解决方法
- PS screen printing brush 131, many illustrators have followed suit
- Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
- Online assignment 3 of mobile Internet technology in the 20th autumn of electronic technology [standard answer]
- Luogu: p1155 [noip2008 improvement group] double stack sorting (bipartite graph, simulation)
- One brush 148 force deduction hot question-5 longest palindrome substring (m)
- Open vsftpd port under iptables firewall
猜你喜欢

QT学习日记9——对话框

PS screen printing brush 131, many illustrators have followed suit

1146_ SiCp learning notes_ exponentiation

Leetcode Valentine's Day Special - looking for a single dog

How to train mask r-cnn model with your own data

1147_ Makefile learning_ Target files and dependent files in makefile

Test your trained model

Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos

One brush 145 force deduction hot question-2 sum of two numbers (m)

New library online | cnopendata complete data of Chinese insurance institution outlets
随机推荐
网络硬盘NFS的安装与配置
Simple configuration of postfix server
Squid service startup script
国内如何购买Google Colab会员
Unity notes unityxr simple to use
AcWing 4489. 最长子序列
Kotlin学习快速入门(7)——扩展的妙用
New library online | cnopendata China bird watching record data
[RT thread] construction and use of --hwtimer of NXP rt10xx device driver framework
问题随记 —— 在 edge 上看视频会绿屏
Qt调节Win屏幕亮度和声音大小
One brush 147-force deduction hot question-4 find the median of two positive arrays (H)
【RT-Thread】nxp rt10xx 设备驱动框架之--hwtimer搭建和使用
[combinatorics] recursive equation (special solution example 1 Hannover tower complete solution process | special solution example 2 special solution processing when the characteristic root is 1)
HP 阵列卡排障一例
一位普通程序员一天工作清单
c# .net 工具生态
[RT thread] NXP rt10xx device driver framework -- RTC construction and use
Simple use of unity pen XR grab
How do large consumer enterprises make digital transformation?