Skip to content

Commit

Permalink
feat: add npm install tool (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice authored May 10, 2021
1 parent 2522d85 commit f7beb7e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ RUN install-tool node 14.16.1
RUN install-tool pnpm 6.0.2
# renovate: datasource=npm
RUN install-tool yarn 1.22.10
# renovate: datasource=npm
RUN install-npm lerna 3.22.1

# renovate: datasource=github-releases lookupName=containerbase/php-prebuild
RUN install-tool php 8.0.6
Expand Down
15 changes: 15 additions & 0 deletions src/usr/local/bin/install-npm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

. /usr/local/buildpack/util.sh

require_root
require_tool "$@"
check_command npm

echo "Installing npm tool ${TOOL_NAME} v${TOOL_VERSION}"
npm install --global ${TOOL_NAME}@${TOOL_VERSION}

# Clean download cache
npm cache clean --force
3 changes: 3 additions & 0 deletions test/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ USER root
# renovate: datasource=npm
RUN install-tool yarn 1.22.10

# renovate: datasource=npm
RUN install-npm lerna 3.22.1

USER 1000

RUN set -ex; \
Expand Down

0 comments on commit f7beb7e

Please sign in to comment.