Skip to main content

Docubuilder Script

docubuilder.sh is a bash script that downloads the Docusaurus template from S3 and installs it into the current directory. It guides you through the process with a preview of what will happen, per-step confirmation prompts, and a summary of what was done.

Usage

From the root of any Neulabs repository:

curl -fsSL https://neulabs-docs-swamp.s3.eu-west-1.amazonaws.com/bootstrap/docubuilder.sh | bash

The script runs in three phases:

  1. Preview — prints exactly what it is about to do based on whether a docs/ folder already exists.
  2. Download — asks for confirmation, then downloads doc_template.zip from the public S3 URL and extracts it to a temporary directory.
  3. Install — asks for a second confirmation, then either creates docs/ from the template (first run) or merges new files into the existing docs/ (subsequent runs).

After completion the script prints a summary of what happened and the next steps to get your documentation site running.

note

The script uses ANSI colour output when running in an interactive terminal. Colour codes are automatically disabled when output is piped or redirected (e.g. in CI).

Behaviour

First run — no docs/ folder

The extracted template is moved directly into docs/.

your-repo/
└── docs/ ← created from template
├── docs/
├── src/
├── static/
├── package.json
└── docusaurus.config.ts

Subsequent runs — docs/ already exists

The template is merged into the existing docs/ folder. Existing files are never overwritten. Only files that are missing from docs/ will be added.

This means you can safely run the script again after a template update and only new files will be added.

Confirmation prompts

The script asks for confirmation at two points:

PromptWhat it guards
Download doc_template.zip from <URL>?The network download step
Create new docs/ directory from template? or Merge template into existing docs/?The file system write step

Answer y or yes (case-insensitive) to continue. Any other input — including pressing Enter — aborts cleanly with no changes made.

Post-completion output

When the script finishes it prints:

  • A "What happened" summary listing the actions that were taken.
  • A "Next steps" guide with the commands to install dependencies, preview the site, and start writing:
  Next steps:
1. cd docs
2. npm install — install Docusaurus dependencies
3. npm run start — preview the site locally
4. Edit docs/intro.md — start writing your documentation
5. npm run build — build for production

Environment variable override

By default the script downloads from the Neulabs S3 bucket. You can point it to a different bucket by setting DOCUBUILDER_S3_URL:

DOCUBUILDER_S3_URL=https://my-bucket.s3.eu-west-1.amazonaws.com/bootstrap \
curl -fsSL .../docubuilder.sh | bash

Or if running the script directly:

DOCUBUILDER_S3_URL=https://my-bucket.s3.eu-west-1.amazonaws.com/bootstrap ./docubuilder.sh

The variable controls the base URL only — the script always appends /doc_template.zip to it.

Source

The script is maintained at bootstrap/scripts/docubuilder.sh in this repository and is automatically uploaded to S3 by the upload-bootstrap.yml workflow on every push to main.