crawling the build histories of pipelines and calculate the metrics
Project description
Crawling-GoCD
This project works for crawling the build histories of pipelines and calculate the metrics.
Installation
- python 3
- pipenv
Development
- Install the packages
pipenv install
- Run test
pipenv run python -m unittest discover
Run
- Input configration in the file
inputs.yaml
pipelines:
-
name: account-management-normal-master
calc_grouped_stages:
ci:
- code-scan
- test-integration
- build
qa:
- flyway-qa
- deploy-qa
start_time: 2019-07-10 00:00:00
end_time: 2019-08-12 23:59:59
-
name: account-management-normal-release
calc_grouped_stages:
uat:
- flyway-uat
- deploy-uat
global:
start_time: 2019-07-01 00:00:00
end_time: 2019-08-12 23:59:59
pipeline name
is the string in the history API URL.
pipeline calc_grouped_stages
includes each phase needed to calculate metrics.
Such as, if we want to calculate the deployment frequency for QA environment, and the QA deployment has two stages.
If one of the two stages fails, determines QA deployment failed, so we configure the qa phase has flyway-qa
、deploy-qa
.
global start_time
and global end_time
, determines the time slot for crawling pipeline histories.
Also, there are pipeline start_time
and pipeline end_time
, they have a high priority to global start_time
and global end_time
.
- Run command
pipenv run python main.py
Attention: Need set the environment variables GOCD_SITE
、GOCD_USER
、GOCD_PASSWORD
before running the command.
Alternatively, use the following command:
GOCD_SITE="<your_gocd_site>" GOCD_USER="<your_username>" GOCD_PASSWORD="<your_password>" pipenv run python -m crawling_gocd
Expansibility
So far the crawling URL is according to the goCD version 18.11.
If need use to incompatible goCD version, just replace the file Crawler.py
.
If need some new metrics handler, just write the implementation class under the superclass CalculateStrategyHandler
, and assemble into Calculator
in the file Portal
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for crawling_gocd-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04d5f2a4bc23d5d6dc254d74fa2ae58b46b6f25270d871322038fec1563c014a |
|
MD5 | 3b356f4deb3d96ec4b738a2dd440f7ae |
|
BLAKE2b-256 | 6d50d7096edeee70c59308aa6e39af66d90971c883d59bbfd78e384057c9f743 |