当前位置:网站首页>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>
案例
边栏推荐
- Kotlin学习快速入门(7)——扩展的妙用
- Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
- Applet setting multi account debugging
- Unity notes unityxr simple to use
- vs2013已阻止安装程序,需安装IE10
- How to purchase Google colab members in China
- Vs code plug-in korofileheader
- Squid 服务启动脚本
- RDS数据库的监测页面在哪看?
- [RT thread] NXP rt10xx device driver framework -- pin construction and use
猜你喜欢
Leetcode 538 converts binary search tree into cumulative tree -- recursive method and iterative method
Unity notes unityxr simple to use
Great changes! National housing prices fell below the 10000 yuan mark
How to purchase Google colab members in China
互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
[UE4] brush Arctic pack high quality Arctic terrain pack
PHP online confusion encryption tutorial sharing + basically no solution
Golang单元测试、Mock测试以及基准测试
POM in idea XML graying solution
1164 Good in C
随机推荐
How to purchase Google colab members in China
SWM32系列教程4-端口映射及串口应用
Great changes! National housing prices fell below the 10000 yuan mark
The largest matrix (H) in a brush 143 monotone stack 84 histogram
PS screen printing brush 131, many illustrators have followed suit
Cross border e-commerce: advantages of foreign trade enterprises in overseas social media marketing
数仓任务里面 跑SQL任务的时候用的数据库账号是在哪里配置的
Online assignment 3 of mobile Internet technology in the 20th autumn of electronic technology [standard answer]
[error reporting] omp: error 15: initializing libiomp5md dll, but found libiomp5md. dll already initialized.
[mathematical logic] equivalent calculus and reasoning calculus of predicate logic (individual word | predicate | quantifier | predicate logic formula | two basic formulas | proposition symbolization
Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
vs code 插件 koroFileHeader
The difference between get and post
One brush 147-force deduction hot question-4 find the median of two positive arrays (H)
Redis: operation commands for list type data
Free data | new library online | cnopendata complete data of China's insurance intermediary outlets
ArrayList分析3 : 删除元素
One brush 142 monotone stack next larger element II (m)
[combinatorics] recursive equation (case where the non-homogeneous part is exponential | example where the non-homogeneous part is exponential)
Qt调节Win屏幕亮度和声音大小