ember-cli-deploy / ember-cli-deploy/ember-cli-deploy-revision-data

Git info is generated in the dist dir

オープン
#52 コメント 21 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
22
フォーク
57
PR マージ指標
30日以内にマージされた PR はありません

説明

The Git info is currently generated in [the dist dir](https://github.com/ember-cli-deploy/ember-cli-deploy-revision-data/blob/master/index.js#L65) which causes problems if that dir is outside of the repo.

In our case we're deploying from a Docker container and mount the host's `tmp` dir as the `tmp` dir in the container. As that dir is a volume then and no regular folder any git operations performed in that dir won't work, leading to the error:

```
fatal: Not a git repository (or any parent up to mount point /usr/src/app/tmp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

/usr/src/app/node_modules/ember-cli-deploy-revision-data/lib/scm-data-generators/git.js:16
var info = log.latest;
^

TypeError: Cannot read property 'latest' of null
at /usr/src/app/node_modules/ember-cli-deploy-revision-data/lib/scm-data-generators/git.js:16:23
at Git. (/usr/src/app/node_modules/simple-git/src/git.js:1276:13)
at Git. (/usr/src/app/node_modules/simple-git/src/git.js:1192:21)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
error Command failed with exit code 1.
```

The error in `git.js` being a consequence of the first 2 lines really:

```
fatal: Not a git repository (or any parent up to mount point /usr/src/app/tmp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
```

`export GIT_DISCOVERY_ACROSS_FILESYSTEM = 1` actually does fix the problem for us but it seems suspicious that the git info is generated from the dist dir as opposed to the root of the repo or working directory that `ember deploy` is run from.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。