Skip to content
 
 

Repository files navigation

Operations runbooks

This repo is a collection of runbooks for common tasks and activities done by the operations / platforms teams, hosted with GitHub Pages on:

Ops-Runbooks Site

Open in Codespaces

Local installation

Install Ruby with Rubygems, preferably with a Ruby version manager, and the Bundler gem.

In the application folder type the following to install the required gems:

bundle install

Making changes

To make changes edit the source files in the source folder.

Mermaid diagrams

Ideally create diagrams using Mermaid.
Mermaid is a diagramming framework that allows many diagram types to be stored in a clean, easily readable code.
This is much cleaner and readable than a typical XML that you might get from e.g. draw.io. It also allows us to use Coding agents to aid with the diagramming tasks such as applying formatting, layout etc. to speed it up. Another advantage is that this code can then be used to automatically generate PNG drawings to include within the documentation. You can get Mermaid preview extension in VSCode to preview the diagram (no need to create an account) as you are writing it.

Currently you can generate some diagrams within the Jenkins documentation using this method, simply run:

make jenkins-mermaid-pngs

This should pull down latest mermaid-cli Docker image and execute the command to export diagrams into PNG files.
When adding new diagrams, consider expanding on this.

Single page output

Although a single page of HTML is generated the markdown is spread across multiple files to make it easier to manage. They can be found in source/documentation.

A new markdown file isn't automatically included in the generated output. If we add a new markdown file at the location source/documentation/agile/scrum.md, the following snippet in source/index.html.md.erb, includes it in the generated output.

<%= partial 'documentation/agile/scrum' %>

Including files manually like this lets us specify the position they appear in the page.

Multiple pages

To add a completely new page, create a file with a .html.md extension in the /source directory.

For example, source/about.html.md will be accessible on http://localhost:4567/about.html.

Preview

There are 2 options to preview changes:

  • Using the bundle middleman server to start up a web server and access it via a browser as it would be normally
  • Using a markdown extension in your code editor to preview the html.md.erb files whilst editing.

Middleman Server

Whilst writing documentation we can run a middleman server to preview how the published version will look in the browser. After saving a change the preview in the browser will automatically refresh.

The preview is only available on our own computer. Others won't be able to access it if they are given the link.

Type the following to start the server:

bundle exec middleman server

If all goes well something like the following output will be displayed:

== The Middleman is loading
== LiveReload accepting connections from ws://192.168.0.8:35729
== View your site at "http://Laptop.local:4567", "http://192.168.0.8:4567"
== Inspect your site configuration at "http://Laptop.local:4567/__middleman", "http://192.168.0.8:4567/__middleman"

You should now be able to view a live preview at http://localhost:4567.

Local preview

To view the markdown files locally you can add a markdown preview extension/add-on to your code editor.

For example VSCode has one built in that allows you to preview markdown (.md) files by right clicking on the file name and selecting preview

However this only works when the file suffix is *.md but for this repository the files are .md.erb so VSCode does not automatically pick these up.

The fix for this is to add an association in settings so that VSCode will offer the preview option.

Set the association in preferences: markdown association setting

Right click on files to see the preview option: preview option

Whilst the local preview offers the fastest feedback it is still a good idea to use the Middleman server as a final confirmation when all changes have been made and you are ready to push to Github.

Build

If you want to publish the website without using a build script you may need to build the static HTML files.

Type the following to build the HTML:

bundle exec middleman build

This will create a build subfolder in the application folder which contains the HTML and asset files ready to be published.

Testing external URLs

If you want to check that all external URLs are still valid you can run the following command:

bundle exec rake check_urls

You will need a GitHub token for this to work correctly as the code requires this for private repositories. To make this easy you can use the GH CLI tool: brew install gh

To login in you should run gh auth login which will prompt you on how you want to authenticate.

Using https and browser will allow you to use your current logged in session on GitHub.

Once authenticated you can now create tokens as required with gh auth token.

For the script this should be set as an environment variable: export GH_TOKEN=$(gh auth token).

With this complete you can now run the bundle command to check urls in the repo.

AI Agent for Runbook Creation

This repository includes a GitHub Copilot agent that assists in creating runbooks/guides following our contribution guidelines.

Usage

@runbook-creator create a troubleshooting guide for DNS issues in AKS

The Runbook Creator Agent reads contribution guides, applies HMCTS-specific patterns, and generates properly formatted .html.md.erb files with correct YAML frontmatter, verification steps, and testing instructions.

See .github/agents/runbook-creator-agent.md for complete documentation.

Publishing

Run:

bundle exec rake publish

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages