【问题标题】:Can't get information from git server using spring cloud config无法使用spring cloud config从git服务器获取信息
【发布时间】:2017-08-04 13:04:22
【问题描述】:

我有一个 Spring Cloud Config 项目,我在其中连接到我的 github 帐户,我的项目运行良好,但在我的工作中,我的老板想要制作一个 git 服务器并使用它而不是 github 帐户,所以在我的上安装 git 之后服务器(linux,我创建了一个这样的存储库:

git init configuracionCarnet

cd configuracionCarnet

git pull <url from github>

git remote add origin user@ip:/home/desarrollo/configuracionCarnetDesarrollo.git

在我的 Spring 云配置项目中,我像这样更改我的 application.yml:

spring:
  cloud:
    config:
      server:
        git:
          uri: user@ip:/home/desarrollo/configuracionCarnet.git
          username: user
          password: password
server:
  port: 8001

我运行项目并启动正常,但是当我执行 http://localhost:8001/health 时,它会抛出项目已关闭,因此我无法连接到 git 服务器,我做错了什么?,

提前致谢

【问题讨论】:

  • 请参阅Git on the Server(以及以下部分)了解有关设置您自己的服务器的介绍。

标签: linux git github spring-cloud-config


【解决方案1】:

您没有使用…remote add… 创建服务器。

您也不会通过将不存在的 URL 放入配置中来使用 Spring 配置创建服务器。

可能性:

  1. 像以前一样,通过将 GitHub URL 放入 Spring 配置中来使用 Spring 隐藏 GitHub。
  2. 用 Gitblit 镜像隐藏 GitHub(你必须安装 Gitblit 和 google 一下)
  3. 使用 Gitblit 作为 GitHub 的替代品。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-01
    • 2019-10-15
    • 2021-03-01
    • 1970-01-01
    • 2016-02-23
    • 2019-03-26
    • 2018-11-10
    • 1970-01-01
    相关资源
    最近更新 更多