From 3c4c10a9562edda12bf77d3829bb3183c4695208 Mon Sep 17 00:00:00 2001 From: Christopher Atkins Date: Thu, 18 Jan 2024 20:22:51 -0500 Subject: [PATCH] preinstall redocly-cli into devcontainer also remove the redocly VS code extension, since there isn't a way to have it ignore openapi-split.yaml --- .devcontainer/devcontainer.json | 1 - .devcontainer/post.sh | 6 +++++- .github/.devcontainer/Dockerfile | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5acae75..95db0ed 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,6 @@ "vscode": { "extensions": [ "ms-azuretools.vscode-docker", - "Redocly.openapi-vs-code", "emeraldwalk.RunOnSave", "42Crunch.vscode-openapi", "stoplight.spectral", diff --git a/.devcontainer/post.sh b/.devcontainer/post.sh index dbf6c96..0a7e885 100755 --- a/.devcontainer/post.sh +++ b/.devcontainer/post.sh @@ -28,7 +28,11 @@ if [[ "${1,,}" == "create" ]]; then fi if [[ ("${1,,}" == "bundle") || ("${1,,}" == "start") ]]; then - npx --yes @redocly/cli bundle $DOCS_PATH/_data/openapi-split.yaml -o $DOCS_PATH/openapi.yaml + if [[ -n "$BUNDLE_PID" && -n "$(ps -p $BUNDLE_PID)" ]]; then + kill $BUNDLE_PID + fi + redocly bundle $DOCS_PATH/_data/openapi-split.yaml -o $DOCS_PATH/openapi.yaml & + export BUNDLE_PID=$! fi if [[ "${1,,}" == "start" ]]; then diff --git a/.github/.devcontainer/Dockerfile b/.github/.devcontainer/Dockerfile index d4ba6ba..44cb0ea 100644 --- a/.github/.devcontainer/Dockerfile +++ b/.github/.devcontainer/Dockerfile @@ -4,6 +4,8 @@ RUN set -eux; \ apt update -y -qq && apt install -y -qq ruby-full build-essential \ && gem install bundler; +RUN npm -g install @redocly/cli + USER node RUN gem install --user-install github-pages webrick \