From 21d2a808af8ddc81de662711c6f2ff9dace1cdb5 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Fri, 26 Jan 2024 16:04:30 +0000 Subject: [PATCH] added devcontainer --- .devcontainer/devcontainer.json | 23 +++++++++++++++++++++++ .devcontainer/post-create.sh | 18 ++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/post-create.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..d3bf8ec --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,23 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/jekyll +{ + "name": "AtlassianPS Dev Environment - Jekyll", + "image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye", + "features": { + "ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {} + }, + "postCreateCommand": ".devcontainer/post-create.sh", + "customizations": { + "vscode": { + "settings": {} + }, + "extensions": [ + "DavidAnson.vscode-markdownlint", + "editorconfig.editorconfig", + "ginfuru.ginfuru-vscode-jekyll-syntax", + "ginfuru.vscode-jekyll-snippets", + "jasonnutter.vscode-codeowners", + "streetsidesoftware.code-spell-checker" + ] + } +} diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100755 index 0000000..2433949 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +# Jekyll does not work on ruby v3.3* +rvm install "ruby-2.6" +rvm use + +# Install the version of Bundler specified in the Gemfile.lock +if [ -f Gemfile.lock ] && grep "BUNDLED WITH" Gemfile.lock > /dev/null; then + cat Gemfile.lock | tail -n 2 | grep -C2 "BUNDLED WITH" | tail -n 1 | xargs gem install bundler -v +fi + +# If there's a Gemfile, then run `bundle install` +# It's assumed that the Gemfile will install jekyll too +if [ -f Gemfile ]; then + bundle install +fi + +bundle exec jekyll serve --force-polling