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

公司网站建设哪里好做网站做的好的公司有哪些

公司网站建设哪里好,做网站做的好的公司有哪些,媒介平台,页面模板怎么用基于基于Jenkins自动打包并部署Tomcat环境_学习新鲜事物的博客-CSDN博客环境 准备git仓库 [rootgit ~]# su - git 上一次登录:五 8月 25 15:09:12 CST 2023从 192.168.50.53pts/2 上 [gitgit ~]$ mkdir php.git [gitgit ~]$ cd php.git/ [gitgit php.git]$ git --b…

基于基于Jenkins自动打包并部署Tomcat环境_学习新鲜事物的博客-CSDN博客环境

准备git仓库

[root@git ~]# su - git

上一次登录:五 8月 25 15:09:12 CST 2023从 192.168.50.53pts/2 上

[git@git ~]$ mkdir php.git

[git@git ~]$ cd php.git/

[git@git php.git]$ git --bare init

初始化空的 Git 版本库于 /home/git/php.git/

[git@git php.git]$ exit

登出

上传代码到仓库

[root@git ~]# git clone git@192.168.50.51:/home/git/php.git/

正克隆到 'php'...

git@192.168.50.51's password:

warning: 您似乎克隆了一个空版本库。

[root@git ~]# cd php/

[root@git php]# cat << EOF > index.php

> <?php

> phpinfo();

> ?>

> EOF

[root@git php]# git add .

[root@git php]# git commit -m "all"

[master(根提交) a251610] all

 1 file changed, 3 insertions(+)

 create mode 100644 index.php

[root@git php]# git push origin master

git@192.168.50.51's password:

Counting objects: 3, done.

Writing objects: 100% (3/3), 218 bytes | 0 bytes/s, done.

Total 3 (delta 0), reused 0 (delta 0)

To git@192.168.50.51:/home/git/php.git/

 * [new branch]      master -> master

部署web主机环境

[root@tomcat ~]#  yum install -y httpd mariadb-server mariadb mariadb-devel php php-mbstring php-mysql php-bcmath php-gd php-xmlrpc php-ldap php-xml libevent libevent-devel net-snmp net-snmp-devel libxml2 libxml2-devel ntpdate

[root@tomcat ~]# yum -y install rsync

[root@tomcat ~]# systemctl start httpd

[root@tomcat ~]# systemctl start mariadb

Jenkins主机将密钥发布到web主机

[root@jenkins ~]# su -s /bin/bash jenkins
bash-4.2$ ssh-keygen
bash-4.2$ ssh-copy-id root@192.168.50.54

[root@jemkins ~]# su -s /bin/bash jenkins

bash-4.2$  ssh-copy-id root@192.168.50.54

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/lib/jenkins/.ssh/id_rsa.pub"

The authenticity of host '192.168.50.54 (192.168.50.54)' can't be established.

ECDSA key fingerprint is SHA256:QTpNCUOIFG1aAs7OSxPHKn0MlNEnLbS7SP/V1xdN8Cg.

ECDSA key fingerprint is MD5:f8:df:e8:5f:ae:af:56:a8:e9:0c:76:13:8b:0e:07:4c.

Are you sure you want to continue connecting (yes/no)? yes

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

root@192.168.50.54's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@192.168.50.54'"

and check to make sure that only the key(s) you wanted were added.

基于rsync部署

创建一个Freestyle project

git@192.618.50.51:/home/git/php.git

 

 

rsync -avz --delete * root@192.168.50.54:/var/www/html/

 

 

 

 

[root@tomcat ~]#  ls /var/www/html/

index.php

[root@tomcat ~]#  cat /var/www/html/index.php

<?php

phpinfo();

?>

 基于ansible部署

[root@jemkins ~]# yum -y install ansible

[root@jemkins ~]#  vim /etc/ansible/hosts

 [webservers]
192.168.50.54

修改jenkins运行用户

[root@jemkins ~]# vim /usr/lib/systemd/system/jenkins.service

 34 User=root

 35 Group=root

一般在/etc/init.d/jenkins或/usr/lib/systemd/system/jenkins.service。根据不同的Linux发行版可能略有不同,请根据实际情况进行查找。

添加Ansible插件 

 创建php-ansible

 

 做好ssh密钥通联

 

 

 src=${WORKSPACE} dest=/var/www/html rsync_opts=--exclude=.git

 

 

 

 

 访问http://192.168.50.54/php-ansbile/

 再见

http://www.yayakq.cn/news/451250/

相关文章:

  • 网站优化柳州网络优化推广
  • 站长之家域名查询排行营销技巧心得体会
  • 网站开发维护的工作职责自己开发网站需要多少钱
  • 云南域名注册网站建设logo免费生成网站
  • 河北省建设机械协会是正规网站吗做网站互联网公司
  • 免费的个人主页网站wordpress o2o
  • 网站开发相关书籍做网站的积木式编程
  • 东台网站制作移动网站建设cnfg
  • 企业网站推广策划书搜索app下载安装
  • 青岛商务学校网站建设想学网站搭建与推广
  • 杭州精高端网站建设苏州网络公司排行
  • 网站建设人员的分工慈溪建设银行支行网站
  • 小说网站建站程序拍网制作方法图片教程
  • 网站一般字体肇庆网络营销外包公司
  • 企业网站备案 淘宝客电子商务网站建设与管理程序设计题6
  • 手机app制作软件哪个好济南网站优化公司
  • 网站后台用什么开发网站建设征求意见通知
  • 南京网站定制公司c 做网站的六大对象
  • 一级域名建站网站建设行吗网站策划名词解释
  • 游戏网站织梦模板北京网站建设项目
  • 三合一网站开发手机网站推荐哪个好
  • 哈尔滨住房和城乡建设厅网站北京网站建设icp有限公司
  • 江苏州 网站制作wordpress无法上传
  • 网络公司 营销型网站网站建设 阿里巴巴旗下
  • 如何做整人网站电子商务网站平台建设前景展望
  • 淄博建设局网站开源博客程序WordPress下载
  • 网站开发团队取什么名字好网站后台的意义
  • 网站视觉规范厦门协会网站建设
  • 网站建设指导方案国家重大建设项目库网站注册
  • 网站怎样绕过360认证wordpress固定链接设置技巧