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 天前
Elastic Stack基础概念
运维·jenkins
北风toto1 天前
Jenkins的安装与启动
运维·servlet·jenkins
任我坤2 天前
搭建Jenkins服务-2025更新
运维·servlet·jenkins
bearpping3 天前
Java进阶(ElasticSearch的安装与使用)
java·elasticsearch·jenkins
代码星辰3 天前
Jenkins——安装与使用
运维·ci/cd·jenkins
带娃的IT创业者3 天前
WeClaw 日志分析实战:如何从海量日志中快速定位根因?
运维·python·websocket·jenkins·fastapi·架构设计·实时通信
常利兵5 天前
Spring Boot 邂逅Elasticsearch:打造搜索“光速引擎”
spring boot·elasticsearch·jenkins
耀耀_很无聊5 天前
09_Jenkins安装JDK环境
java·运维·jenkins
深念Y6 天前
Elasticsearch 8.11 + IK 分词器安装踩坑记录
大数据·数据库·elasticsearch·中文分词·jenkins·ki分词器