Skip to content

Commit

Permalink
Switch Docker build to use branches copy intead of depending on npm m…
Browse files Browse the repository at this point in the history
…odule
  • Loading branch information
geekgonecrazy committed Jun 3, 2016
1 parent f6b7c1b commit 8c82892
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ USER hubot

WORKDIR /home/hubot

ENV DEV false

ENV BOT_NAME "rocketbot"
ENV BOT_OWNER "No owner specified"
ENV BOT_DESC "Hubot with rocketbot adapter"
Expand All @@ -19,10 +17,20 @@ ENV EXTERNAL_SCRIPTS=hubot-diagnostics,hubot-help,hubot-google-images,hubot-goog
RUN yo hubot --owner="$BOT_OWNER" --name="$BOT_NAME" --description="$BOT_DESC" --defaults && \
sed -i /heroku/d ./external-scripts.json && \
sed -i /redis-brain/d ./external-scripts.json && \
npm install hubot-rocketchat && \
npm install hubot-scripts

ADD . /home/hubot/node_modules/hubot-rocketchat

# hack added to get around owner issue: https://github.com/docker/docker/issues/6119
USER root
RUN chown hubot:hubot -R /home/hubot/node_modules/hubot-rocketchat
USER hubot

RUN cd /home/hubot/node_modules/hubot-rocketchat && \
npm install && \
coffee -c /home/hubot/node_modules/hubot-rocketchat/src/*.coffee && \
cd /home/hubot

CMD node -e "console.log(JSON.stringify('$EXTERNAL_SCRIPTS'.split(',')))" > external-scripts.json && \
npm install $(node -e "console.log('$EXTERNAL_SCRIPTS'.split(',').join(' '))") && \
if $DEV; then coffee -c /home/hubot/node_modules/hubot-rocketchat/src/*.coffee; fi && \
bin/hubot -n $BOT_NAME -a rocketchat

0 comments on commit 8c82892

Please sign in to comment.