
3 changed files with 84 additions and 1 deletions
@ -0,0 +1,30 @@ |
|||
# Learn more about the Docker images here: |
|||
# https://gitlab.com/paddy-hack/devuan/blob/master/README.md |
|||
|
|||
|
|||
# Things won't work with ruby 2.5 on beowulf, someone should look into that. |
|||
FROM registry.gitlab.com/paddy-hack/devuan:ascii |
|||
|
|||
RUN apt-get update && apt-get upgrade -y && \ |
|||
apt-get install -y --no-install-recommends \ |
|||
build-essential ruby ruby-dev zlib1g-dev libcurl3 pandoc git |
|||
|
|||
RUN gem install rake middleman && gem install bundler |
|||
|
|||
# Pre-install requisites to allow for quick subsequent webpage builds |
|||
RUN mkdir -p /devuan-www/src |
|||
COPY Gemfile /devuan-www/Gemfile |
|||
COPY Gemfile.lock /devuan-www/Gemfile.lock |
|||
RUN cd /devuan-www && bundle install --path /devuan-www/vendor/bundle |
|||
|
|||
# If /devuan-www/src/Gemfile does not exist, following repo will be cloned |
|||
# You could e.g. mount /devuan-www/src as a docker volume |
|||
ENV DEVUAN_WWW_REPO https://git.devuan.org/devuan-editors/devuan-www.git |
|||
ENV DEVUAN_WWW_BRANCH master |
|||
|
|||
# Built site will be placed in a `public` subdir |
|||
# A build log will be placed in `build.log` |
|||
ENV DEVUAN_DIR_OUT /devuan-www/out |
|||
|
|||
COPY docker_init.sh /docker_init.sh |
|||
CMD ./docker_init.sh |
@ -0,0 +1,35 @@ |
|||
#!/bin/sh |
|||
|
|||
DEVUAN_DIR="/devuan-www/src" |
|||
|
|||
# Only clone main repo if directory does not exist |
|||
if [ ! -f "${DEVUAN_DIR}/Gemfile" ]; then |
|||
git clone --single-branch --branch "${DEVUAN_WWW_BRANCH}" "${DEVUAN_WWW_REPO}" "${DEVUAN_DIR}" |
|||
fi |
|||
|
|||
cd "${DEVUAN_DIR}" |
|||
|
|||
if [ ! -d "${DEVUAN_DIR}/.bundle" ]; then |
|||
mkdir "${DEVUAN_DIR}/.bundle" |
|||
fi |
|||
|
|||
tee "${DEVUAN_DIR}/.bundle/config" << EOF |
|||
--- |
|||
BUNDLE_PATH: "${DEVUAN_DIR}/../vendor/bundle" |
|||
BUNDLE_DISABLE_SHARED_GEMS: "true" |
|||
EOF |
|||
|
|||
if [ ! -f "${DEVUAN_DIR}/config.rb" ]; then |
|||
cp "${DEVUAN_DIR}/config.rb.dist" "${DEVUAN_DIR}/config.rb" |
|||
fi |
|||
|
|||
# Create output dir if needed |
|||
mkdir -p "${DEVUAN_DIR_OUT}"||true |
|||
# Remove old files if needed |
|||
if [ -d "${DEVUAN_DIR_OUT}/public" ]; then |
|||
rm -r "${DEVUAN_DIR_OUT}/public" |
|||
fi |
|||
# Build and pipe log to output dir |
|||
bundle exec middleman build --verbose 2>&1 | tee "${DEVUAN_DIR_OUT}/build.log" |
|||
# Place result in output dir |
|||
mv public "${DEVUAN_DIR_OUT}" |
Loading…
Reference in new issue