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

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

相关推荐
不惑_6 小时前
Logstash 安装与部署(无坑版)
运维·jenkins
Lill_bin1 天前
ElasticSearch底层原理解析
大数据·分布式·elasticsearch·搜索引擎·zookeeper·云原生·jenkins
爱吃香蕉的阿豪1 天前
828华为云征文|Flexus X实例Docker+Jenkins+gitee实现CI/CD自动化部署-解放你的双手~
ci/cd·docker·gitee·华为云·jenkins
laufing2 天前
基于 jenkins 的持续集成、持续部署方案
运维·ci/cd·jenkins·开发
NEIL_XU_4 天前
jenkins流水线+k8s部署springcloud微服务架构项目
服务器·spring cloud·架构·kubernetes·jenkins
Linux运维老纪4 天前
基于zabbix实现监控Jenkins过程---超详细
linux·云计算·jenkins·zabbix·运维开发
m0_629776925 天前
CI/CD中gitlab和jenkins讲解
git·ci/cd·gitlab·jenkins
qq_586475435 天前
Jenkins、Ansible 和 Git 的自动化部署教程
git·ansible·jenkins
挽风8215 天前
Jenkins生成html报告
jenkins
爱摄影的程序猿5 天前
DevOps平台搭建过程详解--Gitlab+Jenkins+Docker+Harbor+K8s集群搭建CICD平台
gitlab·jenkins·devops