1.构建任务
使用小野猫构建更方便
Repository URL是连接到软件仓库的关键
项目存放地址和脚本存放地址需要自己创建
2.创建文件
和上面保持一致
[root@localhost ~]# mkdir myhtml
[root@localhost ~]# mkdir mytml/sh
[root@localhost ~]# vim myhtml/sh/my.sh
3.安装nginx
[root@localhost myhtml]# yum install nginx -y
[root@localhost myhtml]# systemctl start nginx
4.编写脚本
[root@localhost myhtml]# vim /root/myhtml/sh/my.sh
#!/bin/bash
rm -rf /usr/share/nginx/html/*
cp -r /root/myhtml/* /usr/share/nginx/html/
5.赋予权限
[root@localhost ~]# chmod +x /root/myhtml/sh/my.sh