July 27, 2020

New Service Commands for More Flexible Preview Builds

Dachary Carey

As a git pull request builder focused on the “build” part, Tugboat has added new service commands to support more flexible Preview builds! These additional commands provide support for post-build processes, and offer new possibilities for third-party integrations.

Introducing: the start and online service commands

Two of Tugboat’s new service commands are focused on adding functionality to your .tugboat/config.yml to run after your deploy preview has built.

These new service commands give you the option to execute instructions after the build process is complete, versus the original service commands init, update, and clone, that execute during the build process.

Service command for Cloned Previews

We’ve also added a new service command to execute lines in your config.yml when you use Clone to create a duplicate from an existing deploy environment build.

When you use clone as a service command in your config, Tugboat executes those instructions on the new deploy environment you’re creating when you Clone an existing Preview. Then, that duplicate Preview, with the additional instructions executed, gets committed as a build snapshot, so the instructions that run in your clone command become a part of the new Preview.

You might use clone when something in your Preview is derived from Preview ID or Service URL, where the values will change in the newly-cloned Preview. A good example of this is updating a WordPress database to work with the new Preview and Service URLs.

This is distinct from the behavior of the other new service commands, which run after the build process is complete; changes they make are not committed as part of the build Snapshot. Unlike the other commands, you can use clonecommands to add instructions that persist after Resetting a Preview, or when using it as a Base Preview.

How to use the new service commands

These new service commands work the same as our existing service commands: write them into each service you set up in your config.yml file. Use them alongside init, update, and build to structure your commands and get the functionality you want in your Preview environments. Then, every time you make a git pull request, your new Previews will incorporate those additional commands. (Or, in the case of clone, new environments that you create by Cloning an existing environment will execute those new instructions.)

Happy building!

Need More Info on Tugboat?

Tell us about your project, schedule a demo, or consult with a Tugboat Technical Account Executive.

Your request has been sent.
Oops! Something went wrong while submitting the form.