From a055efb17c49582bb10445778092d4e72176a44b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Wed, 6 Nov 2019 18:09:11 +0100 Subject: [PATCH] add s2i support --- .s2i/bin/assemble | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .s2i/bin/assemble diff --git a/.s2i/bin/assemble b/.s2i/bin/assemble new file mode 100755 index 0000000..a5d35d2 --- /dev/null +++ b/.s2i/bin/assemble @@ -0,0 +1,22 @@ +#!/bin/bash + +# Exit on any error +set -e + +hugo_version=${HUGO_VERSION:-0.54.0} +hugo_bin_name=${HUGO_BIN_NAME:-hugo_${hugo_version}_Linux-64bit.tar.gz} +hugo_bin_url=${HUGO_BIN_URL:-https://github.com/gohugoio/hugo/releases/download/v${hugo_version}/${hugo_bin_name}} + +# Download Hugo +curl -s -o "/tmp/${hugo_bin_name}" -L "${hugo_bin_url}" + +# Install Hugo +tar -C /tmp -xf "/tmp/${hugo_bin_name}" hugo + +# Build the website +mv /tmp/src/ /tmp/git +/tmp/hugo -s /tmp/git +ln -s /tmp/git/public /tmp/src + +# Call the default S2I assemble script +exec /usr/libexec/s2i/assemble