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

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

相关推荐
ζั͡山 ั͡有扶苏 ั͡✾5 小时前
EFK 日志系统搭建完整教程
运维·jenkins·kibana·es·filebeat
小晶晶京京20 小时前
day62-gitlab和JenKins
运维·gitlab·jenkins
奔跑吧邓邓子1 天前
Jenkins自动化持续集成:从入门到实战
ci/cd·自动化·实战·jenkins·自动化持续集成
e***0962 天前
Springboot中使用Elasticsearch(部署+使用+讲解 最完整)
spring boot·elasticsearch·jenkins
Better Bench2 天前
Elasticsearch BM25 检索器连接问题解决方案
大数据·elasticsearch·jenkins
2501_941800882 天前
Python高性能日志分析与Elasticsearch实战分享:海量日志索引、检索与可视化优化经验
运维·jenkins
秋邱2 天前
企业级部署升级:Nginx 反向代理 + ELK 日志监控,让成绩预测平台稳定可追溯
运维·jenkins
Mr_sun.2 天前
Day08——ElasticSearch-基础
大数据·elasticsearch·jenkins
CodeZ-Hao3 天前
gitea启用状态检查结合jenkins工作流实现pr门禁
servlet·jenkins·gitea
Q***K553 天前
一、 认识两位主角:Beats与Logstash
运维·jenkins