ngrok实现内网穿透

在使用jenkins进行自动化部署时,需要设置github的webhook钩子来触发构建,由于jenkins运行在自己的电脑上,因此需要通过内网穿透来接受http请求。

Install ngrok via Homebrew with the following command:

Plain 复制代码
brew install ngrok/ngrok/ngrok

Put your app online at ephemeral domain Forwarding to your upstream service. For example, if it is listening on port http://localhost:8080, run:

Plain 复制代码
ngrok http http://localhost:8080

ngrok tunnel --label edge=edghts_token http://localhost:8080

将端口映射到本地8080,此时访问ngrok提供的domain,可以访问到本地的jenkins服务。

ngrok tunnel --label edge=edghts_http://localhost:8080

开启管道后使用github测试。注意在提供给我们的地址后面加上:/github-webhook/

发送成功。

在这里插入图片描述

勾选jenkins项目触发器中的GitHub hook trigger for GITScm polling

提交一次推送,此时自动开始构建。

相关推荐
qq_452396231 天前
【工程实战】第九篇:持续集成 —— Jenkins 与 GitLab CI:构建无人值守的自动化流水线
ci/cd·gitlab·jenkins
野木香1 天前
linux安装常用服务(不含jenkins)
linux·运维·jenkins
终端行者4 天前
Jenkins 流水线 Pipeline 声明式语法基础 入门----上
运维·jenkins
终端行者4 天前
Jenkins流水线Pipeline声明式语法基础入门----下
运维·jenkins·cicd
lifewange4 天前
Jenkins Windows MSI 安装包完整安装教程
windows·servlet·jenkins
marsh02064 天前
35 openclawCQRS模式应用:分离读写操作提升性能
运维·ai·jenkins·编程·技术
Oliver_LaVine5 天前
java项目启动报错:CreateProcess error=206, 文件名或扩展名太长
java·linux·jenkins
Asurplus5 天前
【Ngrok】Linux运行内网穿透工具Ngrok
linux·运维·服务器·内网穿透·ngrok
白毛大侠5 天前
Elasticsearch 核心概念解析:从倒排索引到字段存储
大数据·elasticsearch·jenkins