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

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

相关推荐
kaixin_learn_qt_ing1 天前
Jenkins
运维·jenkins
Madison-No72 天前
Jenkins持续集成
运维·ci/cd·jenkins
boy快快长大3 天前
【Jenkins】入门学习
运维·学习·jenkins
oioihoii3 天前
Jenkins自动部署全流程:CentOS 7、GitHub、Gitee、GitLab、Vue+Maven与Webhook
centos·github·jenkins
Geek-Chow4 天前
Building and Using a Jenkins Shared Library
jenkins
flytalei4 天前
逐浪笔记 GitOps 实战:Jenkins 构建、Argo CD 同步与 Git 回滚
笔记·git·jenkins
flytalei5 天前
从 Jenkins 到 Argo CD:搭建一条完整的 GitOps 实战链路
运维·jenkins
你看我名字5 天前
LAMP 架构演练:从云主机准备到 Apache、PHP、MySQL 上线验证
运维·ci/cd·架构·kubernetes·jenkins
成为你的宁宁5 天前
【基于 SSH 与 JNLP 协议的 Jenkins 分布式构建方案】
分布式·jenkins
小白的码BUG之路9 天前
Jenkins -- 配置jdk和maven
java·jenkins·maven