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

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

相关推荐
回眸不遇1 天前
类型的区别和应用场景 nested 每个对象独立存储为隐藏的子文档 适合存储数组 查询的时候有特定的语法 nested查询 且字段要 ...
运维·jenkins
X1A0RAN2 天前
容器化部署 Jenkins 教程
运维·docker·jenkins
BullSmall2 天前
jenkins 全局工具变更后,构建的任务为什么没有刷新过来
运维·jenkins
BullSmall2 天前
报错 libatomic.so.1: No such file or directory
jenkins
ji_shuke3 天前
从零深入:基于 Playwright + Pytest + Allure 的企业级 Web 端到端自动化测试框架实战
前端·自动化测试·docker·jenkins·pytest·allure·playwright
上海安当技术3 天前
老系统零改造接入:旁路代理统一认证实战
java·servlet·架构·kubernetes·jenkins
Mr. zhihao3 天前
Jenkins 从节点连不上主节点?一次网络排查全记录 + 机器间通信“拦截层“全景讲解
网络·servlet·jenkins
砍材农夫4 天前
运维|devops|jenkins构建分支选择及执行日志展示
运维·jenkins·devops
阿标在干嘛4 天前
政策快报平台日志系统的3次演进:从文件到ELK到告警
运维·elk·jenkins
worilb5 天前
Spring Cloud 学习与实践(16):Elasticsearch 商品搜索、中文分词与索引一致性
运维·jenkins