Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Install node 6 in the base image and make it the default.
Browse files Browse the repository at this point in the history
Install also additional base packages like Elm and Yarn.

Signed-off-by: David Calavera <david.calavera@gmail.com>
  • Loading branch information
calavera committed Oct 26, 2016
1 parent 217a398 commit 449895f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ USER root
USER buildbot
RUN git clone https://github.com/creationix/nvm.git ~/.nvm

RUN /bin/bash -c '. ~/.nvm/nvm.sh && nvm install 4 && nvm use 4 && \
npm install -g sm && \
npm install -g grunt-cli && \
npm install -g bower && \
npm install -g elm && \
npm install -g yarn'
RUN /bin/bash -c ". ~/.nvm/nvm.sh && \
nvm install 4 && nvm use 4 && npm install -g sm grunt-cli bower elm yarn && \
nvm install 6 && nvm use 6 && npm install -g sm grunt-cli bower elm yarn && \
nvm alias default node && nvm cache clear"

USER root

Expand Down
21 changes: 14 additions & 7 deletions run-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi

# Node version
source $HOME/.nvm/nvm.sh
export NODE_VERSION=4
export NODE_VERSION=6
if [ -f .nvmrc ]; then
nvm install $(cat .nvmrc)
if [ $? -ne 0 ]; then
Expand Down Expand Up @@ -84,18 +84,25 @@ fi
# NPM Dependencies
if [ -f package.json ]
then
echo "Installing npm modules"
if npm install; then
export PATH=$(npm bin):$PATH
echo "NPM modules installed"
echo "Installing npm modules"
if [ -f yarn.lock ]; then
if yarn install; then
export PATH=$(yarn bin):$PATH
echo "NPM modules installed"
fi
else
if npm install; then
export PATH=$(npm bin):$PATH
echo "NPM modules installed"
fi
fi
fi

# Bower Dependencies
if [ -f bower.json ]
then
echo "Installing bower components"
if bower install --config.interactive=false; then
echo "Installing bower components"
if bower install --config.interactive=false; then
echo "Bower components installed"
fi
fi
Expand Down

0 comments on commit 449895f

Please sign in to comment.