2025-09-16 19:37:33 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2025-11-29 11:07:00 -05:00
|
|
|
##@Version : 202511291200-git
|
2025-09-16 19:37:33 -04:00
|
|
|
# @@Author : CasjaysDev
|
|
|
|
|
# @@Contact : CasjaysDev <docker-admin@casjaysdev.pro>
|
|
|
|
|
# @@License : MIT
|
|
|
|
|
# @@ReadME :
|
|
|
|
|
# @@Copyright : Copyright 2023 CasjaysDev
|
|
|
|
|
# @@Created : Mon Aug 28 06:48:42 PM EDT 2023
|
|
|
|
|
# @@File : 05-custom.sh
|
2025-11-29 11:07:00 -05:00
|
|
|
# @@Description : script to install Jekyll with GitHub Pages support
|
2025-09-16 19:37:33 -04:00
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# shellcheck shell=bash
|
|
|
|
|
# shellcheck disable=SC2016
|
|
|
|
|
# shellcheck disable=SC2031
|
|
|
|
|
# shellcheck disable=SC2120
|
|
|
|
|
# shellcheck disable=SC2155
|
|
|
|
|
# shellcheck disable=SC2199
|
|
|
|
|
# shellcheck disable=SC2317
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# Set bash options
|
|
|
|
|
set -o pipefail
|
|
|
|
|
[ "$DEBUGGER" = "on" ] && echo "Enabling debugging" && set -x$DEBUGGER_OPTIONS
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# Set env variables
|
|
|
|
|
exitCode=0
|
2025-11-29 11:07:00 -05:00
|
|
|
LANG_VERSION="${LANG_VERSION:-latest}"
|
2025-09-16 19:37:33 -04:00
|
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# Predefined actions
|
2025-11-29 11:07:00 -05:00
|
|
|
echo "Installing Jekyll with GitHub Pages support"
|
2025-09-16 19:37:33 -04:00
|
|
|
|
2025-11-29 11:07:00 -05:00
|
|
|
# Install Jekyll and GitHub Pages dependencies
|
|
|
|
|
if [ "$LANG_VERSION" = "latest" ]; then
|
|
|
|
|
echo "Installing latest Jekyll with github-pages gem..."
|
|
|
|
|
gem install jekyll bundler github-pages webrick || exitCode=1
|
|
|
|
|
else
|
|
|
|
|
echo "Installing Jekyll version ${LANG_VERSION}..."
|
|
|
|
|
gem install jekyll:${LANG_VERSION} bundler github-pages webrick || exitCode=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Verify installation
|
|
|
|
|
if command -v jekyll >/dev/null 2>&1; then
|
|
|
|
|
echo "Jekyll installed successfully"
|
|
|
|
|
jekyll --version || exitCode=1
|
|
|
|
|
echo "Installed gems:"
|
|
|
|
|
gem list | grep -E "(jekyll|github-pages|bundler)" || true
|
|
|
|
|
else
|
|
|
|
|
echo "Jekyll installation failed" >&2
|
|
|
|
|
exitCode=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Create default site directory
|
|
|
|
|
mkdir -p /srv/jekyll || exitCode=1
|
|
|
|
|
chown -R root:root /srv/jekyll || true
|
2025-09-16 19:37:33 -04:00
|
|
|
|
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# Set the exit code
|
|
|
|
|
exit $exitCode
|
2025-11-29 11:07:00 -05:00
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
|
# ex: ts=2 sw=2 et filetype=sh
|