Skip to main content

Yet another Python client for ThoughtWorks GOCD REST API.

Project description

Yet another gocd python client
==============================

Introduction
------------
This project represent itself high level wrapper upon ThoughtWorks gocd REST API.
Go Continuous Delivery is continues integration/deployment server, which helps you automate
and streamline the build-test-release cycle for worry-free.
Using this library you can access to internals of the Pipelines, check their statuses, download Artifacts and more.

Library has a `Client` class, which is a single entry point of whole project. Creating instance of it would give you
possibilities to work with all functionality.

Installation
------------
.. code-block:: bash

$ pip install requests

Examples
--------
##### Create instance of `yagocd.client.Client`
```python
go = Client(
server='https://example.com',
auth=('user', 'password'),
options={
'verify': False # skip verification for SSL certificates.
}
)
```

List of available managers of the client, accessible as it's properties:
* `agents`: manage build agents
* `configurations`: manage configuration
* `feeds`: work with feeds
* `materials`: list,modify and notify materials
* `pipelines`: work with pipelines
* `properties`: work with job's properties
* `stages`: work with stages
* `users`: manage users

##### Pipeline
```python
# list pipelines
print(go.pipelines.list())
```

Code Organisation
-----------------

Development notes
-----------------

Original API is part of the open source [GOCD project](https://github.com/gocd/gocd).
But it's difficult to find appropriate implementation.
* First, there are url rewrite rules in
[/server/webapp/WEB-INF/urlrewrite.xml](https://github.com/gocd/gocd/blob/master/server/webapp/WEB-INF/urlrewrite.xml)
in <!-- RESTful URLS --> section.
* Second, there is [/server/webapp/WEB-INF/rails.new/config/routes.rb](https://github.com/gocd/gocd/blob/master/server/webapp/WEB-INF/rails.new/config/routes.rb)
file, in which some routes are set as well.
* Third, in [/server/src/com/thoughtworks/go/server/controller](https://github.com/gocd/gocd/tree/master/server/src/com/thoughtworks/go/server/controller)
folder there is implementation of all API endpoints, but with different interfaces and URLs (which are handled
by aforementioned configs).

Using this information could give better understanding of internals of Go server for future development and support.

Running local server
--------------------

As described in [this post](https://www.go.cd/2015/08/05/Go-Sample-Virtualbox.html), there is ready to use
Virtual Box image with pre-configured GoCD server and agent, which could easy development and debugging.
To run, executing this command (ensure, that vagrant and Virtual Box are installed):
```
vagrant init gocd/gocd-demo
```

In the current directory will be created `Vagrantfile` with initial content. I recommend forward ports:
```
config.vm.network "forwarded_port", guest: 8153, host: 8153
config.vm.network "forwarded_port", guest: 8154, host: 8154
```

One for `http`, another for `https` -- this will make it possible to use it from https://localhost:8154/go/ url.
After that run
```
vagrant up
```
and wait some time for machine to load and service to be up.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yagocd-0.1.2.tar.gz (13.0 kB view details)

Uploaded Source

File details

Details for the file yagocd-0.1.2.tar.gz.

File metadata

  • Download URL: yagocd-0.1.2.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yagocd-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ec91ec1665a6ecd1ef51519dcc8d6a723ee65bf4452798b27ce1c0a96b70455b
MD5 258ad8cbfc19ad72355270bcc4f89bee
BLAKE2b-256 ed95fe7165f40ef885443b963e614e0882d18d05249c888ddfcacd9c95c3c94b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page