Skip to content

Commit

Permalink
Merge pull request #24 from jebediah47/jebediah47/issue23
Browse files Browse the repository at this point in the history
issue23
  • Loading branch information
jebediah47 committed Dec 9, 2021
2 parents fb99700 + f49adf6 commit a3863cc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ RUN pacman -Syyu git nodejs npm typescript python3 --noconfirm
RUN pacman-key --init
RUN pacman-key --populate archlinux

COPY config.json root/
COPY build.sh root/
COPY src root/src
COPY tsconfig.json root/
COPY package.json root/
WORKDIR /root/
COPY config.json .
COPY build.sh .
COPY build.js .
COPY src src
COPY tsconfig.json .
COPY package.json .

RUN ["chmod", "+x", "root/build.sh"]

Expand Down
40 changes: 35 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
#!/bin/sh
#!/bin/bash
cd /root/

mkdir galactica-bot
cp -r src /root/galactica-bot/
cp tsconfig.json /root/galactica-bot/
cp config.json /root/galactica-bot/
cp package.json /root/galactica-bot/

# file name vars
SRC="src"
TSCONFIG="tsconfig.json"
CONFIG="config.json"
PACKAGE="package.json"

# file exists message
FILE_EXISTS="file exists, ignoring."
DIR_EXISTS="directory exists, ignoring."

if test -d "$SRC"; then
echo ""$SRC", $DIR_EXISTS"
else
cp -r src /root/galactica-bot/
fi

if test -f "$TSCONFIG"; then
echo ""$TSCONFIG", $FILE_EXISTS"
else
cp tsconfig.json /root/galactica-bot/
fi

if test -f "$CONFIG"; then
echo ""$CONFIG", $FILE_EXISTS"
else
cp config.json /root/galactica-bot/
fi

if test -f "$PACKAGE"; then
echo ""$PACKAGE", $FILE_EXISTS"
else
cp package.json /root/galactica-bot/
fi

cd galactica-bot
npm install --only=production
Expand Down

0 comments on commit a3863cc

Please sign in to comment.