diff --git a/Dockerfile b/Dockerfile index e775e3d..74bd758 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,10 @@ RUN apk --no-cache add sshpass openssh-client lftp; mkdir -p /opt/app WORKDIR /opt/app ADD requirements.txt /root/ ADD Dockerfile /root/ -ADD bin/deploy.sh /usr/local/bin/deploy.sh +ADD bin/*.sh /usr/local/bin/ # ignore "Running pip as root" warning ENV PIP_ROOT_USER_ACTION=ignore -RUN chmod 755 /usr/local/bin/deploy.sh && pip install -r /root/requirements.txt && pip freeze && rm -Rf "$(pip cache dir)" +RUN chmod 755 /usr/local/bin/*.sh && pip install -r /root/requirements.txt && pip freeze && rm -Rf "$(pip cache dir)" diff --git a/bin/build.sh b/bin/build.sh new file mode 100644 index 0000000..727aa8f --- /dev/null +++ b/bin/build.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +if ! test -d website +then + echo "Website directory not found" + exit 1 +fi + +if ! command -v nikola >/dev/null 2>&1 +then + echo "nikola command not found" + exit 1 +fi + +cd website + +nikola build +exit "$?"