diff --git a/overlay/etc/skel/add-ons/docs/create-doc-site.sh b/overlay/etc/skel/add-ons/docs/create-doc-site.sh new file mode 100755 index 0000000..ea744a2 --- /dev/null +++ b/overlay/etc/skel/add-ons/docs/create-doc-site.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 3 April 2025 +# Updated : 24 April 2024 +# Purpose : Creates a Jekyll doc site +set -e +source /opt/emcomm-tools/bin/et-common + +function usage() { + echo "$(basename $0) " +} + +if [[ $# -ne 1 ]]; then + usage + exit 1 +fi + +SITE="$1" + +rbenv local 3.3.8 +gem install jekyll bundler && jekyll new ${SITE} + +echo -e "${YELLOW}1. Move into the site directory: ${WHITE}cd ${SITE}${NC}" +echo -e "${YELLOW}2. Build and start site: ${WHITE}bundle exec jekyll serve${NC}" +echo -e "${YELLOW}3. Access site in web browser: ${WHITE}min http://localhost:4000${NC}" diff --git a/overlay/etc/skel/add-ons/docs/install-doc-tools.sh b/overlay/etc/skel/add-ons/docs/install-doc-tools.sh new file mode 100755 index 0000000..4dba6c1 --- /dev/null +++ b/overlay/etc/skel/add-ons/docs/install-doc-tools.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 2 April 2025 +# Updated : 24 April 2025 +# Purpose : Installs documentation tooling +set -e + +RUBY_VERSION="3.3.8" + +if [[ "${EUID}" -eq 0 ]]; then + echo "This script be run as your normal user, not as root." + exit 1 +fi + +if [[ ! -e ~/.rbenv ]]; then + echo "Install 'rbenv' into your home directory..." + git clone https://github.com/rbenv/rbenv.git ~/.rbenv + + echo "Adding 'rbenv' into your path..." + echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile + echo 'eval "$(rbenv init - bash)"' >> ~/.bash_profile + + echo "Adding 'ruby-build' plugin..." + git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build +fi + +source ~/.bash_profile + + +echo "Installing Ruby ${RUBY_VERSION}..." +rbenv install ${RUBY_VERSION} +rbenv global ${RUBY_VERSION} + +echo "Using ruby version: $(ruby -v)" +echo "Using gem version: $(gem -v)" + +ruby -v | grep "${RUBY_VERSION}" +if [[ $? -ne 0 ]]; then + "The documentation tool requires Ruby ${RUBY_VERSION}." + exit 1 +fi diff --git a/scripts/install-dev-tools.sh b/scripts/install-dev-tools.sh index 8d972a4..e14cc70 100755 --- a/scripts/install-dev-tools.sh +++ b/scripts/install-dev-tools.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 29 December 2023 -# Updated : 20 October 2024 +# Updated : 24 April 2025 # Purpose : Install development tools set -e @@ -37,3 +37,10 @@ then sudo apt update sudo apt install --no-install-recommends cubic -y fi + + +# libyaml-dev - needed for Ruby via rbenv +et-log "Installing tools needed for ETC R5" +apt install \ + libyaml-dev \ + -y