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

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

相关推荐
醉颜凉4 天前
Elasticsearch高性能优化:Bulk API大规模数据导入性能调优全攻略
elasticsearch·性能优化·jenkins
sbjdhjd4 天前
从零搭建企业级 CI/CD(下):Jenkins+GitLab+Harbor 全链路实战指南
git·servlet·ci/cd·云原生·云计算·gitlab·jenkins
小美元4 天前
【爽之】使用jenkins实现前端一键发版
运维·jenkins
changxiang5 天前
Jenkins备忘
运维·jenkins
未若君雅裁7 天前
日志采集与ELK:从本地日志到集中检索分析
运维·elk·jenkins
Dontla7 天前
CI/CD前世今生(持续集成、持续交付、持续部署、Jenkins、Github Actions)
ci/cd·github·jenkins
Java 码思客7 天前
【ElasticSearch从入门到架构师】第7章-聚合查询——实现数据统计与分析
大数据·elasticsearch·jenkins
逻极8 天前
Jenkins 从入门到精通:CI/CD自动化流水线实战
ci/cd·自动化·jenkins·devops
炸炸鱼.8 天前
Git+Jenkins实战(一):从零搭建自动化发布与回滚系统(附完整代码)
git·jenkins
无人生还别怕8 天前
搭建jenkins服务并接入openldap认证
运维·jenkins