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

Git info is generated in the dist dir

Đang mở
#52 21 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
22
Fork
57
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.