https://github.com/mrprompt/deploybot-sdk
A Deploybot SDK written in Python
https://github.com/mrprompt/deploybot-sdk
cd continuous deploy deploybot python sdk
Last synced: 7 months ago
JSON representation
A Deploybot SDK written in Python
- Host: GitHub
- URL: https://github.com/mrprompt/deploybot-sdk
- Owner: mrprompt
- License: gpl-3.0
- Created: 2017-05-24T03:19:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-12T21:01:58.000Z (over 8 years ago)
- Last Synced: 2025-03-22T11:20:29.278Z (12 months ago)
- Topics: cd, continuous, deploy, deploybot, python, sdk
- Language: Python
- Homepage: https://pypi.python.org/pypi/deploybot-sdk/
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Deploybot SDK
[](https://travis-ci.org/mrprompt/deploybot-sdk)
[](https://codeclimate.com/github/mrprompt/deploybot-sdk)
[](https://codeclimate.com/github/mrprompt/deploybot-sdk/coverage)
[](https://codeclimate.com/github/mrprompt/deploybot-sdk)
[](https://github.com/mrprompt/deploybot-sdk/issues)
[](https://github.com/mrprompt/deploybot-sdk/stargazers)
[](https://raw.githubusercontent.com/mrprompt/deploybot-sdk/master/LICENSE)
A library to [Deploybot](https://www.deploybot.com) API.
To see how to use, look [Cli](https://github.com/mrprompt/deploybot-cli).
## Install
```
pip install deploybot-sdk
```
## Usage
### Client
Client is the main library, this is responsible to make and receive requests from API.
The first step, is instantiate to your application using your account name and API token.
```python
from deploybot.client import Client
import os
account = os.environ.get('DEPLOYBOT_ACCOUNT')
token = os.environ.get('DEPLOYBOT_TOKEN')
client = Client(account, token)
```
### Repository
Get one or list repositories.
```python
from deploybot.repository import Repository
# client is defined before
client = object
repository = Repository(client)
# list all repositories
print(repository.list())
# get specific repository to details
print(repository.get(99999))
```
### Environment
Get one or list your environments
```python
from deploybot.environment import Environment
# client is defined before
client = object
environment = Environment(client)
# list all environments
repository = 1
print(environment.list(repository))
# get specific environment to details
environment = 1
print(environment.get(environment))
```
### Server
Get one or list your servers
```python
from deploybot.server import Server
# client is defined before
client = object
server = Server(client)
# list all servers
print(server.list())
# get specific server to details
print(server.get(123456))
```
### User
Get one or list users from account
```python
from deploybot.user import User
# client is defined before
client = object
user = User(client)
# list all users
print(user.list())
# get specific user to details
print(user.get(123456))
```
### Deploy
List, view and trigger a deploy.
```python
from deploybot.deploy import Deploy
# client is defined before
client = object
deploy = Deploy(client)
# list all deploys
repository = 1
environment = 2
print(deploy.list(repository, environment))
# get specific deploy to details
deploy_id = 123456
print(deploy.get(deploy_id))
# trigger a deploy
environment = 2
print(deploy.trigger(environment))
```
## Testing
```
python setup.py test
```