Skip to main content

gocd_logo Yet another GoCD python client

https://travis-ci.org/grundic/yagocd.svg?branch=master https://coveralls.io/repos/github/grundic/yagocd/badge.svg?branch=master https://badge.fury.io/py/yagocd.svg https://readthedocs.org/projects/yagocd/badge/?version=latest

Introduction

This library is a high level python API wrapper upon ThoughtWorks GoCD REST API. From the official documentation:

Go Continuous Delivery is continuous integration/deployment server, which helps you automate and streamline the build-test-release cycle for worry-free.

Using it, you can access to internals of the Pipelines, check their statuses, download Artifacts and more. It is designed with maximum comfort and productivity from the user perspective, so it should be very easy to use it in your own project. More information is available at official documentation

Installation

$ pip install yagocd

Quick example

from yagocd import Yagocd

go = Yagocd(
    server='https://example.com',
    auth=('user', 'password'),
    options={
        'verify': False  # skip verification for SSL certificates.
    }
)

for pipeline in go.pipelines:   # Iterate over all pipelines
    for instance in pipeline:   # Iterate over each instance of some pipeline
        for stage in instance:  # Iterate over each stages of some pipeline instance
            for job in stage:   # Iterate over each job of some pipeline
                for root, folder, files in job.artifacts:  # Iterate over artifacts like `os.walk` manner
                    for artifact in files:
                        print(artifact.data.url)

                # print property of each job
                for key, value in job.properties.items():
                    print("{} => {}".format(key, value))

Different implementations of GoCD API

Here is list of similar projects, that implements GoCD API:

Licence

MIT

Release History

1.0.0 (2017-04-13)

Improvements - Added elastic profile support. - Added package repositories API support. - Added package management API support. - Added encryption API support. - Improvements in ValueStreamMap. - Added enumerations (constants) for stage result and state. - Reworked artifact manager (breaking change!) - ETag is now part of resource object (breaking change!)

Miscellaneous - Added support for 16.11.0 version. - Added support for 17.01.0 version. - Added support for 17.02.0 version. - Added support for 17.03.0 version. - Refactored managers urls and parameters.

0.4.4 (2016-12-01)

Improvements - Client’s manager are now initialized just once, which makes possible to cache the results of their calls.

0.4.3 (2016-11-23)

Improvements - Improvements in ValueStreamMap. - Added possibility to programmatically disable version check in Since decorator, using ENABLED flag.

Miscellaneous - Added support for 16.10.1 version.

0.4.2 (2016-10-28)

Improvements - ValueStreamMap: put dictionary instead of StageInstance.

0.4.1 (2016-10-09)

Improvements - Added custom exception error, which outputs error in clear format. - Added support for pluggable SCM materials API. - Added support for template API. - Improvements in ValueStreamMap.

Miscellaneous - Documentation updated. - Docker image updated, which used in testing. - Added support for 16.10.0 version.

0.4.0 (2016-10-01)

Improvements

  • Added support for pipeline config API.

  • Added support for version API.

  • Added support for plugin info API.

  • Added support for environments API.

  • Added methods for getting different internal information (undocumented): support and process_list.

  • Added magic methods for iterating and key based access for some classes.

  • All classes and their methods are now decorated with @since decorator, which adds possibility to check at run-time whether given functionality already supported in the GoCD server and let’s dynamically select correct headers.

Testing

  • Now tests are executed for GoCD version, running in Docker container, which add possibility to test for any available version of the server. Also cassettes are also saved individually for each GoCD version.

  • Added testing for PEP8 and other checks via flake8.

0.3.2 (2016-07-26)

Improvements

  • Added support of value_stream_map functionality.

Bugfixes

  • Fix return value of Artifact.fetch method from text to binary.

0.2.0 (2016-05-24)

Improvements

  • Added support of getting server version through parsing /about page.

  • Added Confirm: true header to some API calls.

Metadata

Release files for yagocd 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yagocd 1.0.1
File Size Uploaded
yagocd-1.0.1.tar.gz 37.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yagocd 1.0.1
File Interpreter ABI Platform
yagocd-1.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 102.8 kB

Release files / yagocd-1.0.1.tar.gz

Download URL yagocd-1.0.1.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
654ab837d4a3a7d165c0df8299360bd3180e4313e9f4fab94ed6a6966b0924af
BLAKE2b-256 checksum
How to use checksums
6ea948baf3ed55fe13c2a90da69691274fb23c54dd9727e5a6ba8ad06dfe45c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / yagocd-1.0.1-py2.py3-none-any.whl

Download URL yagocd-1.0.1-py2.py3-none-any.whl
Size 65.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
689195e7265c40ad1950e0a8dda71606c173ab0ef11773cffae69a1c0e012a7b
BLAKE2b-256 checksum
How to use checksums
e5fad748eab06ac4536343174104202652536de34804ad463df0d286e06fb15f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

1 release file

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page