commit 6db283eb13a730a22c3bf59adec21025c65844cd Author: Florian du Garage Num Date: Fri Dec 15 16:14:36 2023 +0100 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..ca9a727 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +#Hugo-Buildpack + +## What is it? + +A buildpack for easy deploy hugo website on dokku / heroku + +## How to use it? diff --git a/bin/compile b/bin/compile new file mode 100644 index 0000000..ede2da0 --- /dev/null +++ b/bin/compile @@ -0,0 +1,25 @@ +#!/bin/sh + +BUILD_DIR=$1 + +HUGO_VERSION=$(grep 'hugoVersion' $BUILD_DIR/config.yaml | cut -d '"' -f 2) + +if [ -z "$HUGO_VERSION" ]; then + HUGO_VERSION="0.111.2" # default version +fi + + +# Download and install Hugo + +curl -s https://api.github.com/repos/gohugoio/hugo/releases/tags/v$HUGO_VERSION \ + | grep browser_download_url \ + | grep linux-amd64.deb \ + | grep extended \ + | cut -d '"' -f 4 \ + | wget -i - + +dpkg -i hugo*_linux-amd64.deb +rm hugo*_linux-amd64.deb + +cd $BUILD_DIR +hugo diff --git a/bin/detect b/bin/detect new file mode 100644 index 0000000..cebe159 --- /dev/null +++ b/bin/detect @@ -0,0 +1,8 @@ +#!/bin/sh + +# check if config.toml or config.yaml exists +if [ -f "config.toml" ] || [ -f "config.yaml" ]; then + exit 0 +else + exit 1 +fi diff --git a/bin/release b/bin/release new file mode 100644 index 0000000..e69de29