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

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

相关推荐
014.1 天前
2025最新jenkins保姆级教程!!!
java·运维·spring boot·spring·jenkins
leifengzhy1 天前
Jenkins使用pipeline和maven创建项目
运维·jenkins·maven
辣椒种子1 天前
Elasticsearch 基础入门--开发elasticsearch搜索数据篇
大数据·elasticsearch·jenkins
码农阿豪1 天前
Jenkins Git 克隆失败深度解析:从 “Connection reset by peer“ 到彻底解决
运维·git·jenkins
莫比乌斯之梦1 天前
使用 Docker 运行 Jenkins:快速搭建高效 CI/CD 环境指南
ci/cd·docker·jenkins
何中应3 天前
Jenkins常用的任务触发器
运维·ci/cd·jenkins
only_Klein3 天前
Jenkinsfile流水线设计解析
kubernetes·jenkins·argocd·cicd
迎仔4 天前
10-算力中心运维三剑客:Ansible + Jenkins + K8s 高效实战
运维·kubernetes·ansible·jenkins
weixin_531651814 天前
Elasticsearch 检索原理分析
大数据·elasticsearch·jenkins
海兰5 天前
Elasticsearch 9.3.0 日志数据源配置
大数据·elasticsearch·jenkins