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

Git info is generated in the dist dir

Ouverte
#52 21 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
22
Forks
57
Métriques de merge des PR
Aucune PR mergée en 30 j

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.