Skip to content

Commit

Permalink
preinstall redocly-cli into devcontainer
Browse files Browse the repository at this point in the history
also remove the redocly VS code extension, since there isn't
a way to have it ignore openapi-split.yaml
  • Loading branch information
caindy committed Jan 19, 2024
1 parent 9d86a0e commit 3c4c10a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"Redocly.openapi-vs-code",
"emeraldwalk.RunOnSave",
"42Crunch.vscode-openapi",
"stoplight.spectral",
Expand Down
6 changes: 5 additions & 1 deletion .devcontainer/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 3c4c10a

Please sign in to comment.