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

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

相关推荐
天才测试猿1 小时前
Jenkins+Docker自动化测试全攻略
自动化测试·软件测试·python·测试工具·docker·jenkins·测试用例
heimeiyingwang10 小时前
【架构实战】GitOps实践:让运维更优雅
架构·gitlab·jenkins
终端行者11 小时前
企业级Jenkins Pipeline 实战 Docker构建+Ansible发布
ci/cd·docker·ansible·jenkins
运维瓦工11 小时前
DevOps 生态介绍(四):Sonarqube&jacoco 与jenkins集成使用
运维·jenkins·devops
我是坑货1 天前
Jenkins 构建失败排查记录:mvn -U 把新版依赖被远程旧版覆盖
运维·jenkins
悠悠121381 天前
Jenkins + Ansible 集成实战:把配置管理焊进流水线里
运维·ansible·jenkins
北风toto1 天前
Jenkins新手入门安装插件全报错
java·运维·jenkins
海兰1 天前
使用 ES|QL 调试 LLM 延迟、成本与 GPU 饱和度
大数据·elasticsearch·jenkins
heimeiyingwang1 天前
【架构实战】Jenkins+GitLab CI/CD:持续集成与持续部署实践
架构·gitlab·jenkins
忆林5201 天前
Jenkins前端打包构建老项目拯救指南
运维·前端·jenkins