Deploying

Deploying

Shell
trustisto template deploy ./my-popup

template deploy validates the template, packs it into a zip and uploads it to the panel as a template of your organization. On the first deploy it asks for the template name (--name skips the question). The upload is processed in the background; the command waits until the panel has stored the template and prints its address:

Text
Deploying template 4953 (18 kB)...
Deployed template 4953: https://.../index.html

The template then shows up among your organization’s templates in the panel, ready to be picked for a campaign.

What is uploaded

Everything in the folder except:

  • files and folders whose name starts with a dot (.git, .DS_Store, .trustisto),
  • node_modules,
  • package.json and package-lock.json.

Deploying again

The id of the deployed template is saved in a .trustisto file in the template folder. The next deploy from the same folder asks whether to overwrite that template, so a change replaces it instead of creating a copy:

Shell
trustisto template deploy ./my-popup --yes   # overwrite without asking
trustisto template deploy ./my-popup --new   # create another template

Campaigns that use the template pick up the new version: they point at the template, not at a copy. Commit .trustisto if everyone on the team should deploy to the same template, or keep it out of the repository if each person deploys their own.

If the template was deleted in the panel, deploy notices it and creates a new one.

Deploying from CI

With TRUSTISTO_EMAIL and TRUSTISTO_TOKEN set (see Logging in), pass everything the command would otherwise ask for:

Shell
npx @trustisto/cli template deploy ./my-popup --name "Spring sale" --yes --json

--json prints the deployed template as JSON instead of text, for example to read its id and url in the next step of the pipeline.

Deleting

Shell
trustisto template delete ./my-popup

template delete removes the deployed template from the panel after asking (--yes skips the question) and forgets its id in .trustisto. The local folder stays as it is. Campaigns that still use the template stop finding it, so switch them to another template first.