一种使用gitlab的CI/CD功能实现Nginx配置更新的方法
2024-10-20 15:59:53
至于nginx的docker制作,前面已介绍过。
现在使用gitlab在线编辑的方式,可实现Nginx的自定义配置并更新。
.gitlab-ci.yml内容如下:
variables: project_root: ./nginx www_root: /nginx/conf.d stages: - deploy php-deploy: when: manual stage: deploy script: - ls - echo deploy - sh -x deploy.sh tags: - php
deploy.sh内容如下:
#!/bin/sh # $project_root and $www_root is set in gitlab ci/cd variables # project_root is ./nginx; www_root is /nginx/conf.d echo $project_root echo $www_root cp -ur $project_root/* $www_root docker exec -i nginx nginx -s reload
gitlab runner已配置好。因为是本地更新,采用shell方式即可。
为了谨慎,采用手动触发。
最新文章
- objective-c 语法快速过(1)
- UVA2636
- [Tool] 使用CodeMaid自动程序排版
- [转]如何在 Visual Studio 中使用 Git 同步代码到 CodePlex
- SQLServer排序时与读取的记录会影响到结果?
- Oracle安装基本步骤
- 坚持使用GNU/Linux
- vue 生命周期
- uva 1583
- 巨人大哥谈Web应用中的Session(session详解)
- android官方技术文档翻译——Case 标签中的常量字段
- 深入学习MySQL事务:ACID特性的实现原理
- 低成本制作基于OpenWRT的渗透工具
- 项目中的Launch_getSecurityEntitle_postlaunch
- (七)STL适配器
- mysql真的不能做搜索引擎吗?
- drf-序列化器的理解
- 移动端适配之sprite雪碧图背景定位
- SQL - 查询某一字段值相同而另一字段值最大的记录
- Android数据存储之SQLite
热门文章
- 使用二进制的方式部署 K8S-1.16 高可用集群
- [转] Win10插入U盘后双击无法打开,无法访问,显示设备未就绪;驱动哥帮你解决
- Java 8 集合之流式(Streams)操作, Streams API 详解
- SpringBoot配置文件敏感信息加密-jasypt
- centos发布 7.7.1908版本了,怎么把老版本更新到新版本了?
- 【LEETCODE】47、985. Sum of Even Numbers After Queries
- go 学习笔记(4) --变量与常量
- Spring Cloud Alibaba学习笔记(24) - Spring Boot Actuator 监控数据可视化:Spring Boot Admin
- 无法将文件xxx复制到xxx文件xxx正由另一进程使用,因此该进程无法访问此文件
- MyEclipse的 lib和Build path(构建路径)