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

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

相关推荐
maomao1713143 小时前
Jenkins 环境部署
运维·jenkins
江湖人称小鱼哥1 天前
jenkins在windows配置sshpass
运维·jenkins
koboides1 天前
我的第一个开源项目-jenkins集成k8s项目
linux·运维·云原生·容器·kubernetes·jenkins
苦逼IT运维2 天前
Jenkins + SonarQube 从原理到实战三:SonarQube 打通 Windows AD(LDAP)认证与踩坑记录
运维·服务器·windows·docker·云计算·jenkins·devops
Hello.Reader3 天前
Elasticsearch Node.js 客户端连接指南(Connecting)
elasticsearch·node.js·jenkins
阑梦清川3 天前
派聪明RAG知识库----关于elasticsearch报错,重置密码的解决方案
大数据·elasticsearch·jenkins
孙克旭_4 天前
day073-Jenkins消息通知与pipline流水线
linux·运维·jenkins
l and4 天前
Jenkins 搭建鸿蒙打包
jenkins·harmonyos
Tony6666888884 天前
【Jenkins入门以及安装】
运维·jenkins
猫先生OVO5 天前
【无标题】
运维·jenkins