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

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

相关推荐
heimeiyingwang2 天前
【GitOps·入门篇】工具生态:ArgoCD、Flux、Jenkins X 对比选型
jenkins·flux·argocd·gitops
骇客野人2 天前
基于Nginx+Eureka+Apollo+Jenkins+SpringBoot Web系统分布式部署方案
nginx·eureka·jenkins
中才实用3 天前
Jenkins自动化部署
运维·自动化·jenkins
童槿顏丶6 天前
Jenkins部署(Docker)
java·docker·jenkins
Elastic 中国社区官方博客10 天前
使用 Elasticsearch open inference API 对 OpenAI chat completions 进行支持
大数据·elasticsearch·搜索引擎·全文检索·jenkins
X1A0RAN11 天前
Jenkins Pipeline 变量打印指南
运维·servlet·jenkins
heimeiyingwang11 天前
【CI/CD·Jenkins篇】多节点构建:Agent 配置与任务分发策略
ci/cd·jenkins
heimeiyingwang12 天前
【CI/CD·Jenkins篇】环境搭建:从零部署 Jenkins 主从架构
ci/cd·jenkins
heimeiyingwang12 天前
【CI/CD·Jenkins篇】Pipeline 基础:Declarative 与 Scripted 语法详解
ci/cd·pipeline·jenkins
遨游DATA13 天前
Jenkins 修改 config.xml 后页面仍是旧配置:让 live job 配置真正生效
ci/cd·jenkins·devops·故障排查·config.xml