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 天前
win11下部署elastic9.0+常见问题及解决方法(续)
运维·jenkins
海鸥811 天前
k8s中Jenkins 配置文件「 更新不了 」
java·kubernetes·jenkins
_运维那些事儿1 天前
GitLab&Jenkins
运维·ci/cd·gitlab·jenkins·devops
一念一花一世界1 天前
Jenkins 太重?试试超轻量开源 CI/CD 工具 Arbess
运维·ci/cd·jenkins·arbess
liux35281 天前
Elasticsearch 8.13.2 单机部署与配置详细指南
大数据·elasticsearch·jenkins
切糕师学AI2 天前
Jenkins Pipeline 小解
运维·servlet·jenkins
BUTCHER52 天前
elasticsearch时间搜索
大数据·elasticsearch·jenkins
Hellc0072 天前
Jenkins 上下游 Job + Docker 镜像部署完整实战(避坑版)
java·docker·jenkins
不积硅步2 天前
jenkins安装jdk、maven、git
java·jenkins·maven
海兰2 天前
win11下本地部署单节点Elasticsearch9.0+开发
大数据·elasticsearch·jenkins