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

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

相关推荐
zhougl9961 天前
Elasticsearch 7.x vs 8.x
大数据·elasticsearch·jenkins
醉颜凉2 天前
Jenkins与Git集成完全指南:从基础配置到自动触发构建
运维·git·jenkins
醉颜凉3 天前
Elasticsearch核心架构:集群(Cluster)原理详解与核心作用
elasticsearch·架构·jenkins
云间月13144 天前
Elasticsearch 数据怎么看?部署 Kibana,从索引查询到可视化图表
大数据·elasticsearch·jenkins
略略略咯咯4 天前
jenkins
运维·servlet·jenkins
蒲锘4 天前
Devops项目笔记阶段 7:Jenkins CI/CD 自动化部署
笔记·jenkins·devops
醉颜凉5 天前
Elasticsearch 相关性评分核心解密:tie_breaker 参数作用原理与实战调优全解析
大数据·elasticsearch·jenkins
Behaviour5 天前
Unity游戏之Jenkins的安装部署应用
游戏·unity·jenkins
醉颜凉6 天前
Elasticsearch 核心基石:倒排索引全解析(原理+结构+流程图+实战)
elasticsearch·jenkins·流程图
醉颜凉6 天前
Elasticsearch底层原理:文档更新与删除完整执行流程深度剖析
大数据·elasticsearch·jenkins