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

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

相关推荐
zxd0203111 分钟前
EFK(Elasticsearch + Fluentd + Kibana) 日志收集系统
运维·docker·jenkins
终端行者16 分钟前
Jenkins Pipeline 企业级用法 参数化构建+Ansible发布---上
docker·ansible·jenkins·cicd
认真的薛薛3 小时前
Linux运维:Jenkins部署
linux·运维·jenkins
终端行者4 小时前
jenkins Pipeline 企业级别的流水线构建 Docker 负责打包 最后上传到Nexus
ci/cd·docker·jenkins
认真的薛薛5 小时前
Linux运维:Jenkins+Argocd
linux·运维·jenkins
cgsthtm1 天前
openEuler release 24.03 (LTS-SP2) 安装 jenkins
jenkins·openeuler·firewall-cmd·jenkins.reps
IT界的老黄牛1 天前
Flink 重启变双开:一次部署引发的两个 CDC 任务并发消费
大数据·flink·jenkins
liyunlong-java3 天前
Elasticsearch 8.5.3 + IK 分词器 + Kibana 8.5.3 一键安装
大数据·elasticsearch·jenkins
Linux运维技术栈4 天前
Jenkins服务器更新密钥后任务构建不了?排查实录与解决方案
服务器·servlet·jenkins
醉颜凉5 天前
Elasticsearch 实战:数据自动化清理完全指南(ILM + 定时删除 + 最佳实践)
elasticsearch·自动化·jenkins