Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added script to run npm installs #2

Merged
merged 1 commit into from Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -21,6 +21,9 @@ clone the two repos inventaire needs to run :
```
git clone https://github.com/inventaire/inventaire.git
git clone https://github.com/inventaire/entities-search-engine.git
# Install NodeJS dependencies
./scripts/docker_npm inventaire install
./scripts/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
13 changes: 13 additions & 0 deletions scripts/docker_npm
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eu

path=$1
cwd=$(realpath $path)
dir=$(dirname $cwd)
workdir="/opt/${dir}"
uid=$(stat -c '%u' $cwd)

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

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