Closed stevescavo closed 6 years ago
I need more context into this issue. Husky should only run when making commits so its a dev dependancy. It is running during deployment? If so that shouldn't be happening. It should only run against staged files when making a commit.
Husky should only run when making commits so its a dev dependancy.
Correct. It's doing that now, but it relies on locally installed node_modules
. One of the benefits of Docker is that your dependencies are not installed locally, but they reside inside your container. After a quick Google, there appear to be some solutions in place. I don't mind looking more into this when I have some time.
It is running during deployment?
"I'm deploying Docker locally" is synonymous with saying "I'm running Docker locally". Sorry for the confusion.
As of now the a host machine must also have node installed to use husky and commit via Tower or any other tool that does not have access to bash exports. This seems to be the one place where we're breaking the encapsulation of a docker running node.
I'd ❤️ to get this working across the board. The pre commit hooks are awesome.
Check out the PR #30. Runs (exec) inside the web container
Note: This pre commit requires you have to already built the web container at one point
The Husky pre-commit hooks rely on locally installed node modules. So if you're deploying locally via Docker, the pre-commit hooks fail. Feels "wrong" to be forced to run a local install of dependencies when I'm already running Docker.
Possible solutions:
Open to other suggestions.