Skip to content

Instantly share code, notes, and snippets.

@fizerkhan
Last active November 14, 2017 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fizerkhan/7497a7acd7c284b0fadca81cef758147 to your computer and use it in GitHub Desktop.
Save fizerkhan/7497a7acd7c284b0fadca81cef758147 to your computer and use it in GitHub Desktop.
Tracking Deployments With Atatus

Tracking Deployments With Atatus

About Atatus

Atatus helps you monitor the performance and track errors related to your web and back-end applications. During your continuous deployment workflow with Codeship Pro, you can record your deployments in Atatus.

By using Atatus, you can compare metrics and errors with previous deployment.

Their documentation does a great job of providing more information, in addition to the setup instructions below.

Codeship Pro

Setting Your Admin API Key

You will need to add your Atatus admin api key to your encrypted environment variables that you encrypt and include in your codeship-services.yml file.

Logging During Deployment

Next, you will need to add the following commands to a script, placed in your repository, that you will call from your codeship-steps.yml file.

In this case we are calling a script named deploy-atatus.sh.

curl https://api.atatus.com/api/deployments \
  -F admin_api_key=$ADMIN_API_KEY \
  -F revision=$CI_COMMIT_ID \
  -F release_stage=$CI_BRANCH \
  -F user=$CI_COMMITTER_USERNAME \
  -F changes="$DEPLOYMENT_NOTES"

You will need to call this script on all deployment-related branches by specifying the tag. Be sure to add this step after your deployment commands, so that it only runs if the deployments were successful. For example:

- name: deploy
  service: app
  tag: master
  command: your deployment commands

- name: atatus
  service: app
  tag: master
  command: deploy-atatus.sh

Codeship Basic

Setting Your Admin API Key

You will need to add your Atatus admin api key to your to your project’s environment variables.

You can do this by navigating to Project Settings and then clicking on the Environment tab.

Logging During Deployment

To log a deployment-related datapoint in Atatus, you will want to add a new custom-script step to all of your deployment pipelines.

This new step will either run the following commands, or run a script that includes the following commands:

curl https://api.atatus.com/api/deployments \
  -F admin_api_key=$ADMIN_API_KEY \
  -F revision=$CI_COMMIT_ID \
  -F release_stage=$CI_BRANCH \
  -F user=$CI_COMMITTER_USERNAME \
  -F changes="$DEPLOYMENT_NOTES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment