【问题标题】:Git clone doesn't auto-clone submodules, causes issues with heroku auto deployGit clone 不会自动克隆子模块,导致 heroku 自动部署出现问题
【发布时间】:2019-05-01 13:11:33
【问题描述】:

我有一个带有子模块的 git 存储库,我想在自动部署的管道上部署到 heroku,但是当 ng build --prod 进程接近完成时,我收到错误

ERROR in : Couldn't resolve resource ./repo/style.css relative to /tmp/build_d3089108a84fd9e7fb117fed84b787b6/src/app/resume/resume.component.ts

因为我的子模块(存在于/src/app/resume/repo)在文件resume.component.ts 中被引用:

@Component({
  selector: 'app-resume',
  templateUrl: './repo/resume.html',
  styleUrls: ['./repo/style.css']
})

虽然 github 存储库指向子模块的特定提交,但初始 git clone 不会克隆它旁边的子模块。

我的.gitmodules文件如下:

[submodule "Resume"]
    path = src/app/resume/repo
    url = https://github.com/<my username>/Resume.git

问题:

有没有办法强制 heroku-git 在完整 repo 的同时克隆子模块?

我可以运行一个脚本,让 heroku 在克隆完整 repo 之后但在构建之前自行克隆子模块吗?

【问题讨论】:

  • should just work。你确定你有一个正确的.gitmodules 文件吗? (子模块不仅仅是嵌套的存储库;containing repo should have a .gitmodules file。)
  • 我设置了一个 .gitmodules 文件,我会将它添加到帖子中。并且回购是公开的
  • 文件名大小写是否存在差异,例如resumeResume?这适用于 Windows 和 macOS,但不适用于 Heroku。
  • repo 名称的第一个字母大写,其他都是小写。
  • 尝试clone 使用递归子模块或递归选项(我忘记了)

标签: git heroku git-submodules


【解决方案1】:

在 Heroku 上使用 GitHub repo 子模块的唯一问题是:

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-10-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-06-09
  • 1970-01-01
相关资源
最近更新 更多