Tracking deploys

Deploys help you understand how changes impact performance by allowing you to see timeline markers for code deployments. You can create deploys with the CLI, Node.JS API or by using the HTTP Site API.

Creating deploys using the CLI

Create a deploy using the following command:

$ calibre site create-deploy --site=site-slug
✔ Deploy created: 0ac61084-a38b-4b0f-a00f-56795186140b

To create deploys as part of your continuous integration or deployment system, add revision, repository and username details:

$ calibre site create-deploy --site=site-slug --revision= 7d9580a --repository=https://github.com/username --username=Deployer

Creating deploys using the Node.JS API

The open source repository for CLI also contains working code examples of the Node.js API.

Creating deploys using the HTTP Site API

The deploy endpoint is https://calibreapp.com/api/sites/site-slug/deploys. You can find your site-slug on the Site Settings page.

You can create a deploy for a site by making a POST request to https://calibreapp.com/api/sites/site-slug/deploys with the following URL parameters:

  • secret: Your site's secret key (found on the site settings page)
  • revision: The source control revision id of the code you are deploying (e.g. git hash or tag name)
  • repository: The base URL of the repository containing the source code being deployed (e.g. https://github.com/calibreapp/app)
  • username: The name of the user who deployed the code

Heroku deployment tracking

You can track deploys with Heroku's free deploy hooks addon. To add a deploy hook, install the Heroku CLI and run the following command:

$ heroku addons:add deployhooks:http --url="https://calibreapp.com/api/sites/site-slug/deploys?secret=site-secret&revision={{head}}&username={{user}}&repository=app-repository" --app app-name

You should replace the following with your own values:

  • site-slug: Your site's slug (found on the site settings page)
  • site-secret: Your site's secret key (found on the site settings page)
  • app-repository: The base URL of the repository containing the source code being deployed (e.g. https://github.com/calibreapp/app)
  • app-name: The name of your Heroku app