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

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

相关推荐
meijinmeng16 分钟前
Jenkins-批量自动化构建指定目录或者视图下所有Job或者指定Job
jenkins
搬砖天才、1 小时前
es数据备份
大数据·elasticsearch·jenkins
终端行者2 小时前
Jenkins Pipeline在不同阶段指定不同的 agent 或 Docker 容器进行执行任务和固定一个节点分段执行任务,一文带你搞定
java·docker·jenkins·cicd
@土豆2 小时前
Jenkins CI_CD流水线案例
运维·ci/cd·jenkins
Cyber4K3 小时前
【DevOps专项】GitLab 与 Jenkins 介绍及部署持续集成环境
运维·ci/cd·gitlab·jenkins·devops
终端行者3 小时前
Jenkins流水线添加企业微信或者钉钉通知 pipeline 如何通过企微/钉钉通知
ci/cd·jenkins·钉钉·企业微信
郝开3 小时前
Docker Compose 本地环境搭建:elasticsearch
elasticsearch·docker·jenkins
Elivs.Xiang1 天前
centos9中安装Jenkins
linux·运维·centos·jenkins
我叫唧唧波1 天前
【自动化部署】CI/CD 实战(三):让 Argo CD 接管 CD,Jenkins 镜像自动同步到集群
运维·前端·ci/cd·docker·自动化·jenkins·argocd
Elivs.Xiang1 天前
ubuntu20中安装Jenkins
linux·运维·ubuntu·jenkins