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

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

相关推荐
小安同学iter12 分钟前
天机学堂-优惠券功能-day09(七)
java·spring cloud·微服务·jenkins·优惠券·天机学堂
管理大亨1 小时前
ELK + Redis Docker 企业级部署落地方案
大数据·运维·elk·elasticsearch·docker·jenkins
weixin_307779134 小时前
Jenkins Pipeline: Multibranch 插件详解:现代CI/CD的多分支管理利器
运维·开发语言·自动化·jenkins·etl
m0_632482504 小时前
Jenkins + Pytest +allure接口自动化测试配置与操作
jenkins·集成测试·pytest·jenkins配置
eddy-原4 小时前
全链路 DevOps 实战:基于 Jenkins、GitLab、Prometheus 与 SonarQube 的持续集成、部署、监控与优化
运维·jenkins
weixin_307779135 小时前
Jenkins Folders插件详解:组织、管理与最佳实践
运维·开发语言·自动化·jenkins
weixin_307779136 小时前
Jenkins声明式管道扩展点API:深度解析与应用指南
开发语言·ci/cd·自动化·jenkins·etl
要站在顶端2 天前
Jenkins PR编号提取&环境变量赋值问题总结
java·servlet·jenkins
DN金猿2 天前
jenkins 权限控制(用户只能看指定的项目)
linux·运维·服务器·jenkins
weixin_307779132 天前
Jenkins Pipeline: Basic Steps 插件详解
开发语言·ci/cd·自动化·jenkins·etl