Drone

How to check Limits

This document describes how to check your user and repository count. This is helpful for companies that have purchased, or are interested in purchasing, a commercial license and want to evaluate their current usage.

Verify Limits

If you have an existing commercial license, your user and repository limits are printed to the console when the server starts.

{
  "build.limit": 0,
  "expires": "0001-01-01T00:00:00Z",
  "kind": "standard",
  "level": "debug",
  "msg": "main: license loaded",
+ "repo.limit": 25,
  "time": "2019-11-02T10:43:11-07:00",
+ "user.limit": 25
}

Finding Counts

You can find the total count of users and the total count of active repositories by visiting the /metrics endpoint in your browser. These are provided by the drone_user_count and drone_repo_count metrics, respectively. Note that you must have the system admin role to visit this endpoint.

# HELP drone_repo_count Total number of registered repositories.
# TYPE drone_repo_count gauge
drone_repo_count 54

# HELP drone_user_count Total number of active users.
# TYPE drone_user_count gauge
drone_user_count 24

You should compare your counts to your license limits.

Listing Resources

You can get a list of all users from the database using the below query, or you can use the command line utility [1] to list all users.

SELECT user_login FROM users

You can get a list of all active repositories from the database using the below query. Note the user interface only show repositories for which you are a collaborator and is therefore not expected to show all repositories, even if you are a system admin.

SELECT repo_slug FROM repos WHERE repo_active = true

Removing Resources

You can de-activate a repository using the command line utility [2] or by navigating to the repository settings page in the user interface and clicking the Disable button.

drone repo rm octocat/hello-world

You can remove user accounts using the command line utility [3]. Please note that if you remove a user account, and that user account activated a repository, it will need to be de-activated and then re-activated by another user.

drone user rm octocat

[1] https://docs.drone.io/cli/commands/user/drone-user-ls/
[2] https://docs.drone.io/cli/commands/repo/drone-repo-rm/
[3] https://docs.drone.io/cli/commands/user/drone-user-rm/