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升级版本(2.289.3-2.528.3)
jenkins
GeminiJM10 小时前
Elasticsearch Dump 失败问题排查:Store: True 导致的字段数组化问题
大数据·elasticsearch·jenkins
石小千10 小时前
配置Jenkins使用tag发布
jenkins
可以吧可以吧10 小时前
前端vue jenkins打包资源增加阿里云oss+cdn加速
前端·vue.js·jenkins
曹牧11 小时前
Java:Jenkins
java·开发语言·jenkins
一条闲鱼_mytube1 天前
Github+Jenkins + Harbor CI/CD 指南
ci/cd·github·jenkins
汪碧康2 天前
【k8s-1.34.2安装部署】五.worker端containerd2.2.1、kubelet-1.34.2安装
docker·云原生·容器·kubernetes·jenkins·kubelet·xkube
Rhys..2 天前
Jenkins配置GitHub token教程
运维·github·jenkins·ci
yuxb733 天前
Jenkins 流水线:镜像仓库与自动化部署
笔记·jenkins