Skip to content

Commit

Permalink
Replace yarn usages with NPM usages
Browse files Browse the repository at this point in the history
Refs #394
  • Loading branch information
lukasjuhrich committed Jul 27, 2020
1 parent b5ca7a6 commit 566a7b9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ glance:
entrypoint.
* A `dev-app` service/container based on `agdsn/pycroft-dev` derived from
`agdsn/pycroft-base`. The development image contains additional packages
for development, e.g. `gcc`, `yarn`. The service uses two persistent volumes:
for development, e.g. `gcc`, `npm`. The service uses two persistent volumes:
* the home directory `/opt/pycroft` of the `pycroft` user, that contains among
other things, the virtual environment, the pip cache, and the
`.bash_history`.
Expand All @@ -81,7 +81,7 @@ glance:
optimized in-memory database.
* A `prod-app` service/container based on `agdsn/pycroft-prod`, which is based on
`agdsn/pycroft-base` that contains only the basics that are required for
running Pycroft without development tools, such as `gcc` or `yarn`.
running Pycroft without development tools, such as `gcc` or `npm`.
Pycroft and its dependencies are build using an instance of the
`agdsn/pycroft-develop` image using the
[multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/)
Expand Down Expand Up @@ -403,10 +403,10 @@ alias drc=docker-compose

### Webpack appears to be missing a library

Re-Install everything using yarn, and re-run the webpack entrypoint.
Re-Install everything using npm, and re-run the webpack entrypoint.

```sh
drc run --rm dev-app shell yarn install
drc run --rm dev-app shell npm install
drc run --rm dev-app webpack
```

Expand Down
1 change: 0 additions & 1 deletion docker/base/container/commands/version
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ run() {
EOF
fi
[[ -x nodejs ]] && echo "NodeJS: $(nodejs --version)" || :
[[ -x yarn ]] && echo "yarn: $(yarn --version)" || :
}

[[ "$0" == "$BASH_SOURCE" ]] && run "$@" || :
2 changes: 0 additions & 2 deletions docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ COPY etc/apt /etc/apt
# Install Debian packages
# Build-essential is needed For compiling things in pip
RUN apt-key add /etc/apt/keys/nodesource.gpg.key \
&& apt-key add /etc/apt/keys/yarnpkg.gpg.key \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
Expand All @@ -27,7 +26,6 @@ RUN apt-key add /etc/apt/keys/nodesource.gpg.key \
strace \
unzip \
vim \
yarn \
&& apt-get clean

COPY . /
Expand Down
2 changes: 1 addition & 1 deletion docker/dev/container/commands/webpack
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ readonly DESCRIPTION=(

run() {
cd /opt/pycroft/app
exec yarn run webpack --require @babel/register --config webpack.config.babel.js "$@"
exec npm run webpack --require @babel/register --config webpack.config.babel.js "$@"
}

[[ "$0" == "$BASH_SOURCE" ]] && run "$@" || :
2 changes: 1 addition & 1 deletion docker/dev/container/hooks/init/20_yarn
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ if [[ -d node_modules ]] && $(shopt -s nullglob dotglob; files=(node_modules/*);
exit
fi

yarn install --network-concurrency 1
npm install
1 change: 0 additions & 1 deletion docker/dev/etc/apt/sources.list.d/yarnpkg.list

This file was deleted.

4 changes: 2 additions & 2 deletions docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ RUN /opt/pycroft/venv/bin/pip wheel --wheel-dir /opt/pycroft/wheel -r requiremen

# Download JS/CSS dependencies
COPY --chown=pycroft:pycroft package.json .
RUN yarn install --network-concurrency 1
RUN npm install

# Build Pycroft wheel
COPY --chown=pycroft:pycroft . .
RUN yarn run --prod build
RUN npm run --prod build
RUN /opt/pycroft/venv/bin/pip wheel --no-deps --wheel-dir /opt/pycroft/wheel .

FROM agdsn/pycroft-base
Expand Down

0 comments on commit 566a7b9

Please sign in to comment.