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

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

相关推荐
i_am_a_div_日积月累_1 小时前
jenkins打包报错
运维·rust·jenkins·jenkins打包报错
一个处女座的暖男程序猿1 小时前
2G2核服务器安装ES
服务器·elasticsearch·jenkins
一个处女座的暖男程序猿10 小时前
2G2核服务器安装ES 7X版本
服务器·elasticsearch·jenkins
GeminiJM12 小时前
优化Elasticsearch批量写入性能:从单分片瓶颈到多索引架构
elasticsearch·架构·jenkins
matrixlzp14 小时前
Jenkins 实战2:pipeline 编写一个自动化部署
运维·jenkins
城南花开时14 小时前
CCID工具,Jenkins、GitLab CICD、Arbess一文全方位对比分析
jenkins·gitlab cicd
江湖人称小鱼哥15 小时前
Jenkins 在构建 Java 项目并操作 Docker 时 CPU 会突然飙高
java·docker·jenkins
snow@li1 天前
运维:部署Jenkins
运维·jenkins
zjshuster1 天前
elastic search 学习
学习·elasticsearch·jenkins
安冬的码畜日常2 天前
【JUnit实战3_22】 第十三章:用 JUnit 5 做持续集成(下):Jenkins + JUnit 5 + Git 持续集成本地实战演练完整复盘
git·测试工具·ci/cd·jenkins·集成测试·持续集成·junit5