aboutsummaryrefslogtreecommitdiffstats
path: root/s2i
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-09-10 08:35:15 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-09-10 08:35:15 +0200
commitd3bf02054b774067bf5f64d6cffb95fe13f87441 (patch)
tree9e6b410448e06fefd12a0c255a0ffa6d4c257c31 /s2i
parent0d181d49c616fc52c55991215c238ea38ce9fb97 (diff)
downloads2i-jekyll-d3bf02054b774067bf5f64d6cffb95fe13f87441.tar.gz
switch to openshift/httpd base image
Diffstat (limited to 's2i')
-rwxr-xr-xs2i/bin/assemble31
-rwxr-xr-xs2i/bin/run10
2 files changed, 22 insertions, 19 deletions
diff --git a/s2i/bin/assemble b/s2i/bin/assemble
index 63cdb20..723d4e4 100755
--- a/s2i/bin/assemble
+++ b/s2i/bin/assemble
@@ -12,31 +12,44 @@ if [[ "$1" == "-h" ]]; then
exec /usr/libexec/s2i/usage
fi
-# Restore artifacts from the previous build (if they exist).
-#
+set -e
+
+echo "---> Enabling s2i support in httpd24 image ..."
+source ${HTTPD_CONTAINER_SCRIPTS_PATH}/common.sh
+config_s2i
+
if [ "$(ls /tmp/artifacts/ 2>/dev/null)" ]; then
- echo "---> Restoring build artifacts..."
+ echo "---> Restoring build artifacts ..."
mv /tmp/artifacts/. ./
fi
-echo "---> Installing application source..."
+echo "---> Installing application source ..."
cp -Rf /tmp/src/. ./
-echo "---> Building application from source..."
-set -ex
if test -f Gemfile; then
+ echo "---> Installing packages from Gemfile ..."
bundle config path $(pwd)/.gem
bundle config
bundle install
+ echo "---> Building jekyll site (gemfile version) ..."
bundle exec jekyll build
else
+ echo "---> Building jekyll site (default version) ..."
jekyll build
fi
+
if test -f _config.yml; then
base=$(awk '/^baseurl/ { print $2 }' _config.yml | tr -d '"')
else
base=""
fi
-cd _site
-mkdir -p /opt/app-root/html$base
-cp -a . /opt/app-root/html$base
+dest="${HTTPD_APP_ROOT}/html$base"
+
+echo "---> Copying pages to $dest ..."
+pushd _site
+mkdir -p "$dest"
+cp -a . "$dest"
+popd
+
+echo "---> Fix permissions ..."
+fix-permissions ./
diff --git a/s2i/bin/run b/s2i/bin/run
deleted file mode 100755
index ab9c2e0..0000000
--- a/s2i/bin/run
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash -e
-#
-# S2I run script for the 'kraxel/s2i-jekyll' image.
-# The run script executes the server that runs your application.
-#
-# For more information see the documentation:
-# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md
-#
-
-exec /usr/sbin/httpd -f /opt/app-root/etc/httpd.conf -DFOREGROUND