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

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

相关推荐
庸子9 小时前
基于Jenkins和Kubernetes构建DevOps自动化运维管理平台
运维·kubernetes·jenkins
裁二尺秋风10 小时前
CI/CD — Pipeline的使用以及Blue Ocean多分支流水线的使用方法
ci/cd·gitlab·jenkins
真实的菜14 小时前
Jenkins 插件深度应用:让你的CI/CD流水线如虎添翼 [特殊字符]
servlet·ci/cd·jenkins
ldj202016 小时前
Jenkins 构建过程常见错误
运维·jenkins
绝不偷吃1 天前
ELK日志分析系统
运维·elk·jenkins
真实的菜2 天前
Jenkins生态与拓展:构建现代化DevOps工具链的终极指南
servlet·jenkins·devops
去伪存真11 天前
如何封装Jenkins参数化构建中的动态选项获取代码片段?
前端·jenkins
white.tie11 天前
docker方式启动Jenkins
docker·容器·jenkins
至此流年莫相忘12 天前
Git集成Jenkins通过Pipeline方式实现一键部署
运维·git·jenkins
张敬之、12 天前
jenkins-2.439.1搭建
运维·elasticsearch·jenkins