aboutsummaryrefslogtreecommitdiff
path: root/docker/entrypoint.sh
blob: f8068c10cc5732c9bdcb44b926ce2f99f8fa6c2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
WORK_DIR="/app"
SRC_DIR="/cstate"

# Check if the working dir is empty, if it is we'll need to copy
# the files in from src directory (usually /cstate)
if ! [ "$(ls -A $WORK_DIR)" ]; then
    # First run, copy cstate's files in.
    echo "First time run! Hello, World :)"
    cp -R $SRC_DIR/* $WORK_DIR
fi

# Continue with building

# CD into working dir
cd /app

# Build the hugo site
hugo

# Copy built files into NGINX directory
cp -r /app/public/* /usr/share/nginx/html