Change or Update Previews
Want to update or change a Preview build? Tugboat offers a few different ways to do that:
- To update a Preview with your latest code, you can Refresh it. Refreshing a Preview pulls in the
latest code from the connected Git repo, and run commands from the from the Tugboat config file’s
update
andbuild
phases. - To change a Preview’s Docker images, or the make changes to Services’
init
commands, you can Rebuild it. Rebuilding a Preview pulls fresh Docker images, pulls in the latest code from the connected Git repo, and runs all of the Tugboat config file’sinit
,update
andbuild
commands.
On a basic level, you can think of it as the difference between updating the code (Refresh) and making more substantial changes to the way a Service is configured (Rebuild). For more info on what exactly is happening under the covers, take a look at the Preview build process: explained.
Note
When you’re updating a Preview that was built from a Base Preview, Rebuild does not pull fresh
Docker images and run commands from init
and update
. Instead, child Previews jump directly to the build
phase. For
more info, see:
rebuild Previews when working with a Base Preview.
Refresh Previews
When you Refresh a Preview, Tugboat:
- Pulls the latest code from git.
- Runs commands from the
update
section of the config file. - Runs commands from the
build
section of the config file.
When you’re not using a Base Preview, Refreshing is a faster process than building the
entire container again, as Tugboat doesn’t have to set up Services and complete all the init
processes again. However,
if you are using a Base Preview, Rebuild is the faster update process.
For more info about build phases, see: the build process: explained.
To Refresh a Preview:
- Go to username -> My Projects at the upper-right of the Tugboat screen.
- Select the project where you want to update a Preview.
- Click the name of the repo that contains the code you want to use for the Preview update.
- Select the Preview build you want to update.
- Click the Actions drop-down menu for that Preview, and select Refresh.
- Press the Yes button to confirm and start the Refresh process.
You’ll see a yellow refreshing status while Tugboat is running the update, which will change to a green ready once the update is complete.
Rebuild Previews
When you Rebuild a Preview (that was not built using a Base Preview), Tugboat:
- Pulls the latest code from git.
- Pulls fresh Docker images.
- Runs commands from the
init
section of the configuration. - Runs commands from the
update
section of the configuration. - Runs commands from the
build
section of the configuration.
When you’re not using a Base Preview, this process takes longer than a
Refresh, so you should mainly use this if you need to pull new Docker images, or run commands from
init
in your config.yml. However, if you are using a Base Preview, Rebuild is the faster update process.
For more info about build phases, see: the build process: explained.
To Rebuild a Preview:
- Go to username -> My Projects at the upper-right of the Tugboat screen.
- Select the project where you want to rebuild a Preview.
- Click the name of the repo that contains the code you want to use for the Preview rebuild.
- Select the Preview you want to rebuild.
- Click the Actions drop-down menu for that Preview, and select Rebuild.
- Press the Yes button to confirm and start the Rebuild process.
You’ll see a yellow building status while Tugboat is rebuilding the Preview, which will change to a green ready once the build is complete.
Note
When you Rebuild a Preview that was built from a Base Preview, Rebuild does not pull fresh Docker
images and run commands from init
and update
. Instead, child Previews jump directly to the build
phase. For more
info, see: updating Previews when working with a Base Preview.