Hugo Static Site
A Tugboat Preview for a Hugo static site builds the static site, and then serves it. This config
generates a static site that looks like your hugo build on your local development environment, but is accessible via
the secure Tugboat URL by anyone who has the link; no need for the viewer to have a local environment.
Configure Tugboat
The Tugboat configuration is managed by a YAML file at
.tugboat/config.yml in the git repository. Here’s a basic Hugo static site configuration you can use as a starting
point, with comments to explain what’s going on:
services:
  # What to call the service hosting the site. Because there is only
  # one service, it is automatically set as the default service, which
  # does a few things
  #   1. Clones the git repository into the service container
  #   2. Exposes port 80 to the Tugboat HTTP proxy
  #   3. Routes requests to the preview URL to this service
  apache:
    # Use the available version of Apache by not specifying a version
    image: tugboatqa/httpd
    # A set of commands to run while building this service
    commands:
      # Commands that set up the basic preview infrastructure
      init:
        # Use curl to download Hugo into the Apache service
        - curl -Ls https://github.com/gohugoio/hugo/releases/download/v0.58.3/hugo_0.58.3_Linux-64bit.tar.gz | tar -C
          /usr/local/bin -zxf - hugo
      build:
        # Hugo's command to build your static site
        - hugo
        # Link the document root to the expected path. This example links the
        # /public directory generated by the Hugo build to the docroot
        - ln -snf "${TUGBOAT_ROOT}/public" "${DOCROOT}"Want to know more about something mentioned in the comments of this config file? Check out these topics:
- Name your Service
- Specify a Service image
- Leverage Service commands
- Define a default Service
- Set the document root path
- Preview build process phases (init,update,build)
Start Building Previews!
Once this Tugboat configuration file is committed to your git repository, you can start building previews!