ruzickap.github.io

Overview

Personal blog and website built with Jekyll using the Chirpy theme.

ruzickap.github.io

Theme Source

Chirpy:

Building / Testing Locally

On Ubuntu / Intel-based Mac:

bundle install
bundle exec jekyll s

Using Docker:

# Build the site
docker run --rm -it \
  --volume="${PWD}:/srv/jekyll" \
  -e JEKYLL_UID="${UID}" \
  -e JEKYLL_GID="${GID}" \
  jekyll/jekyll -- bash -c 'chown -R jekyll /usr/gem/ && jekyll build --destination "public"'

# Serve the site locally
docker run --rm -it \
  --volume="${PWD}:/srv/jekyll" \
  -e JEKYLL_UID="${UID}" \
  -e JEKYLL_GID="${GID}" \
  --publish 4000:4000 \
  jekyll/jekyll -- bash -c 'chown -R jekyll /usr/gem/ && jekyll serve'

Megalinter:

mega-linter-runner --remove-container \
  --container-name="mega-linter" \
  --debug \
  --env VALIDATE_ALL_CODEBASE=true

Tests

docker run --rm -it -v "$PWD:/mnt" -v "/var/run/docker.sock:/var/run/docker.sock" \
  --env AWS_ACCESS_KEY_ID --env AWS_SECRET_ACCESS_KEY --env AWS_ROLE_TO_ASSUME \
  --env GOOGLE_CLIENT_ID --env GOOGLE_CLIENT_SECRET --env FORCE_COLOR=1 --env USER \
  --workdir /mnt \
  ubuntu bash -c 'set -euo pipefail && \
    apt update -qq && apt install -qqy bsdextrautils curl docker.io jq unzip wget && \
    curl -sL https://mise.run -o - | bash && \
    eval "$(~/.local/bin/mise activate bash)" && \
    mise run "create-delete:posts:all" \
  '

Notes

  • Use ```bash to run commands during the post_tests "create" execution:

    ```bash
    ### <some create commands...>
    ```
    
  • Use ```shell not to run commands during the post_tests execution (they will be only displayed on the web pages):

    ```shell
    ### some commands...
    ```
    
  • Use ```sh to run commands during the post_tests "destroy" execution:

    ```sh
    ### <some clean-up/destroy commands...>
    ```