当前位置: 首页 > news >正文

做网站买狗怎么样seo推广一年要多少钱

做网站买狗怎么样,seo推广一年要多少钱,seo属于技术还是营销,微信公众号前端开发流程目录 一. 准备ansible 二. Gitlab新建子项目 三. Jenkins建立任务,进行初步配置 四. 导入nginx主机的公钥 五. 配置ansible执行脚本 六. 构建测试 一. 准备ansible 在jenkins主机中安装ansible [rootjenkins ~]# yum install -y epel-release [rootjenkins…

目录

一. 准备ansible 

二. Gitlab新建子项目

三. Jenkins建立任务,进行初步配置

四. 导入nginx主机的公钥

五. 配置ansible执行脚本

六. 构建测试


一. 准备ansible 

在jenkins主机中安装ansible

[root@jenkins ~]# yum install -y epel-release
[root@jenkins ~]# yum install -y ansible

查看配置文件

[root@jenkins ~]# cat /etc/ansible/ansible.cfg
# Since Ansible 2.12 (core):
# To generate an example config file (a "disabled" one with all default settings, commented out):
#               $ ansible-config init --disabled > ansible.cfg
#
# Also you can now have a more complete file by including existing plugins:
# ansible-config init --disabled -t all > ansible.cfg# For previous versions of Ansible you can check for examples in the 'stable' branches of each version
# Note that this file was always incomplete  and lagging changes to configuration settings# for example, for 2.9: https://github.com/ansible/ansible/blob/stable-2.9/examples/ansible.cfg

初次进入需要自己选择两个命令其中一个执行,然后生成配置命令,后者比前者多一些插件相关的配置选项。


ansible-config init --disabled > ansible.cfg

ansible-config init --disabled -t all > ansible.cfg 
 

[root@jenkins ~]# cd /etc/ansible/
[root@jenkins ansible]# ansible-config init --disabled -t all > ansible.cfg
[root@jenkins ansible]# vim /etc/ansible/ansible.cfg +318host_key_checking=Flase    #将这个参数配置打开

配置主机清单

本机jenkins为192.168.226.22 主机清单配置另一台用于nginx上线项目的主机192.168.226.21

[root@jenkins ansible]# vim /etc/ansible/hosts
[nginx]
192.168.226.21 ansible_user=root ansible_password=lzz2578+[tomcat]

 验证连通性

[root@jenkins ansible]# ansible all -m ping
192.168.226.21 | SUCCESS => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"},"changed": false,"ping": "pong"
}

在192.168.226.21主机中下载nginx并启动

[root@nginx ~]# yum install -y nginx && systemctl enable --now nginx

二. Gitlab新建子项目

gitlab仓库主机为192.168.226.20 

建立一个index.html代码文件用于测试

 

输入代码提交 

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>测试小标题</title>
</head>
<body><h1>第是第一个小标题</h1></body>
</html>

 

三. Jenkins建立任务,进行初步配置

 

 图中设置中构建步骤的代码如下:

 echo "=========="
sh /opt/ansible.sh $service $status $gitlab_code $code_idecho "==========="echo "代码上线完成"

四. 导入nginx主机的公钥

# 生成密钥对
[root@nginx ~]# ssh-keygen# 复制查看到的公钥
[root@nginx ~]# cat .ssh/id_rsa.pub

 

[root@nginx nginx]# cd /usr/share/nginx
# 备份原目录
[root@nginx nginx]# mv html html.break

克隆代码仓库

[root@jenkins nginx]# git clone git@192.168.226.20:ugo_team/ceshi-paramter.git
# 给改目录改名
[root@nginx nginx]# mv ceshi-paramter html

五. 配置ansible执行脚本

[root@jenkins nginx]# cd /opt
[root@jenkins opt]# vim ansible.sh
#!/bin/bash# 接收 Jenkins 传递的参数
SERVICE_NAME="$1"
SERVICE_STATUS="$2"
GITLAB_CODE="$3"
CODE_ID="$4"# Ansible 主机清单路径
HOST="/etc/ansible/hosts"# Ansible 命令基础部分
CMD="/usr/bin/ansible -i $HOST"# 检查服务名称是否为 nginx,并根据传递的 GITLAB_CODE 参数执行不同的操作
if [ "$SERVICE_NAME" = "nginx" ]; thenif [ "$GITLAB_CODE" = "pull" ]; thenecho "Executing: $CMD $SERVICE_NAME -m shell -a 'chdir=/usr/share/nginx/html git pull origin main'"$CMD $SERVICE_NAME -m shell -a "chdir=/usr/share/nginx/html git pull origin main"elif [ "$GITLAB_CODE" = "reset1" ]; thenecho "Executing: $CMD $SERVICE_NAME -m shell -a 'chdir=/usr/share/nginx/html git reset --hard HEAD^'"$CMD $SERVICE_NAME -m shell -a "chdir=/usr/share/nginx/html git reset --hard HEAD^"elif [ "$GITLAB_CODE" = "reset2" ]; thenecho "Executing: $CMD $SERVICE_NAME -m shell -a 'chdir=/usr/share/nginx/html git reset --hard HEAD^^'"$CMD $SERVICE_NAME -m shell -a "chdir=/usr/share/nginx/html git reset --hard HEAD^^"elif [ "$GITLAB_CODE" = "code_id" ]; thenecho "Executing: $CMD $SERVICE_NAME -m shell -a 'chdir=/usr/share/nginx/html git reset --hard $CODE_ID'"$CMD $SERVICE_NAME -m shell -a "chdir=/usr/share/nginx/html git reset --hard $CODE_ID"elseecho "Unknown GITLAB_CODE: $GITLAB_CODE"exit 1fi# 根据传递的 SERVICE_STATUS 参数执行 systemctl 操作if [ "$SERVICE_STATUS" != "none" ]; thenecho "Executing: $CMD $SERVICE_NAME -m service -a 'name=$SERVICE_NAME state=$SERVICE_STATUS'"$CMD $SERVICE_NAME -m service -a "name=$SERVICE_NAME state=$SERVICE_STATUS"fi
elseecho "Unsupported SERVICE_NAME: $SERVICE_NAME"exit 1
fi

加上执行权限

[root@jenkins opt]# chmod +x ansible.sh

六. 构建测试

点击构建

选择对应的参数

看构建成功

访问nginx主机的网页例如我这里访问:http://192.168.226.21/ 

 

代码仓库修改代码测试

 

再次构建

如此再重复进行一次修改并构建

进行版本回退测试,回退上两个版本

 

回退到指定版本 

到代码仓库查提交记录

这次选择刚最新提交的,也是有三个标题的那个版本,复制其对应的字符

 

点击构建,选择对应的参数

 

如此就完成了简易实验。 

http://www.mmbaike.com/news/42130.html

相关文章:

  • 网站建设开发环境怎么找百度客服
  • 古玩网站源码外贸营销型网站制作
  • 做一个简单的网页多少钱百度站长工具seo查询
  • 龙元建设集团有限公司网站朋友圈推广平台
  • 无锡专业网站东莞营销外包公司
  • 帮做简历哪个网站好在线友情链接
  • 建设公积金网站收录优美的图片
  • 广州市花都区建设局网站建一个网站需要多少钱?
  • 做网站全部乱码怎么办网络营销制度课完整版
  • 网站建设|重庆seo排名优化
  • 嵊州门户网站网络优化工程师为什么都说坑人
  • 阜宁县住房城乡建设局网站广告代理商
  • 网站内容管理后台系统怎么做网站外链分析工具
  • 做商城网站要什么手续费上海快速优化排名
  • 宁波seo网络推广推荐公众号万词霸屏百度推广seo
  • 一建十大网校排名嘉兴seo网络推广
  • 上海浦东政府网站建设百度免费广告发布平台
  • 福田公司网站建设怎么写软文推广
  • 做网站怎么那么难南京网站制作设计
  • 大宗商品交易平台软件深圳网站设计专家乐云seo
  • 有哪些做短租的网站seo诊断优化专家
  • 深圳住建局工程交易中心手机优化管家
  • 韩国男女直接做的视频网站吉安seo网站快速排名
  • 成都定制小程序开发公司seo专员是干什么的
  • 莆田建设网站如何给公司网站做推广
  • 网站空间数据库上传百度网盘下载慢怎么解决
  • 福建厦门网站建设优化推广网站seo
  • 网站名字怎样做版权网站宣传文案
  • 光谷做网站推广哪家好电子商务主要学什么就业方向
  • 政府电子网站建设解决方案在哪里打广告效果最好