Skip to content

Commit

Permalink
added script to run npm installs without having to install NodeJS on …
Browse files Browse the repository at this point in the history
…the host machine
  • Loading branch information
maxlath committed Oct 15, 2018
1 parent 4240f5b commit cfaea14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -18,9 +18,12 @@ clone the two repos inventaire needs to run :
- `inventaire` core application server -> [setup](https://github.com/inventaire/inventaire#installation)
- `entities-search-engine` for querying entities -> [go to repo](https://github.com/inventaire/entities-search-engine)

```
```sh
git clone https://github.com/inventaire/inventaire.git
git clone https://github.com/inventaire/entities-search-engine.git
# Install NodeJS dependencies
./utils/docker_npm inventaire install
./utils/docker_npm entities-search-engine install
```

Create empty folders for docker volume to dump backup. In accordance with docker-compose volumes, example: `mkdir data couch-test couch es`
Expand Down
11 changes: 11 additions & 0 deletions utils/docker_npm
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eu

path=$1
cwd=$(realpath $path)
uid=$(stat -c '%u' $cwd)

# All args but the first one
npm_args="${@:2}"

docker run --user $uid --rm --volume "${cwd}:/cwd" --workdir /cwd node:8 npm --color=always $npm_args

0 comments on commit cfaea14

Please sign in to comment.