The final step in setting up your Tugboat is creating a Tugboat config. This config is Tugboat’s infrastructure-as-code implementation for specifying the instructions required to build working Previews of your website. There are two ways to pass config information to Tugboat:
The traditional way to create a Tugboat config is to commit a YAML Config file in the linked git repository.
The Tugboat Config file should live at .tugboat/config.yml
in the branch, tag, commit or pull request that is being
built.
You can pass a Tugboat config file as a parameter in two ways:
When you’re making changes to your config file, you can iterate quickly by passing the config file with the Tugboat CLI.
When you create
a Preview through the CLI, you can pass your config file as an argument, using this syntax:
tugboat create preview main repo=[repoid] config=./config.yml
Once you’ve iterated your way to a config.yml
that functions as desired, you can commit the file to the repository to
power your Preview builds.
If you’re using the Tugboat API to build Previews, you can pass the config information as a JSON object when building Previews using the API. This option is available on POST when creating Previews.
The config file defines the Services that your Tugboat Preview will set up during the build process, as well as any Service commands you’ll use to provide instructions at specific points in the build process.
Start with these docs to begin creating a config.yml
for your Previews:
You may also find these docs helpful if you want to do things like use the Tugboat CLI to build Previews, shell into services, or debug your Tugboat config: