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

Git info is generated in the dist dir

Open
#52 21 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22
Forks
57
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.