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

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

相关推荐
云和数据.ChenGuang10 小时前
运维技术教程之Jenkins的秘钥设置
运维·servlet·jenkins·自动化监控·运维技术教程
谢白羽10 小时前
jenkins搭建笔记
运维·笔记·jenkins
土小帽软件测试10 小时前
docker安装、启动jenkins服务,创建接口自动化定时任务(mac系统)
docker·容器·jenkins
世纪摆渡人10 小时前
部署-k8s和docker、jenkins的区别和联系
docker·kubernetes·jenkins
云和数据.ChenGuang1 天前
运维技术教程之Jenkins上的known_hosts文件
运维·servlet·jenkins·自动化监控·运维技术教程
bug攻城狮2 天前
SpringBoot+Loki4j+Loki+Grafana搭建轻量级日志系统
spring boot·jenkins·grafana
运维成长记2 天前
实例操作:基于 PipeLine 实现 JAVA项目集成 SonarQube代码检测通知 Jenkins
运维·jenkins
longze_72 天前
Jenkins credentials 增加了github credential 但是在Git SCM 凭证中不显示
git·github·jenkins
jinhuazhe20132 天前
Linux切换到Jenkins用户解决Jenkins Host key verification failed
运维·jenkins
测试老哥2 天前
Jmeter+ant+jenkins接口自动化测试框架
自动化测试·软件测试·python·测试工具·jmeter·jenkins·压力测试