-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the Command Framework to generate the tool's own documentation. (#6)
- Loading branch information
Showing
7 changed files
with
312 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# CircleCI tools | ||
|
||
Continuous integration: [![Test](https://github.com/helly25/circleci/actions/workflows/main.yml/badge.svg)](https://github.com/helly25/circleci/actions/workflows/main.yml). | ||
|
||
WIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,87 @@ | ||
# CircleCI tools | ||
|
||
Continuous integration: [![Test](https://github.com/helly25/circleci/actions/workflows/main.yml/badge.svg)](https://github.com/helly25/circleci/actions/workflows/main.yml). | ||
|
||
WIP | ||
|
||
A simple [CircleCI API](https://circleci.com) client that fetches workflow | ||
stats from the CircleCI API server and writes them as a CSV file. | ||
|
||
# Usage | ||
``` | ||
bazel run //circleci:workflows -- <command> [args...] | ||
``` | ||
|
||
## Commands | ||
* combine: Read multiple files generated by `workflow.py fetch` and combine them. | ||
* fetch: Fetch workflow stats from the CircleCI API server and writes them as a CSV file. | ||
* fetch_details: Given a workflow CSV file, fetch details for each workflow (slow). | ||
* filter: Read CSV files generated from `workflow.py fetch` and filters them. | ||
* help: Provides help for the program. | ||
* request_branches: Read and display the list of branches for `workflow` from CircleCI API. | ||
* request_workflow: Given a workflow ID return its details. | ||
* request_workflows: Read and display the list of workflow names from CircleCI API. | ||
|
||
Most file based parameters transparently support gzip and bz2 compression when | ||
they have a '.gz' or '.bz2' extension respectively. | ||
|
||
## For command specific help use | ||
``` | ||
bazel run //circleci:workflows -- <command> --help. | ||
``` | ||
|
||
## Command combine | ||
|
||
Read multiple files generated by `workflow.py fetch` and combine them. | ||
|
||
``` | ||
bazel run //circleci:workflows -- combine --output=/tmp/circleci.csv "${PWD}/data/circleci_workflows*.csv*" | ||
``` | ||
|
||
## Command fetch | ||
|
||
Fetch workflow stats from the CircleCI API server and writes them as a CSV file. | ||
|
||
``` | ||
bazel run //circleci:workflows -- fetch --output "${PWD}/data/circleci_workflows_$(date +"%Y%m%d").csv.bz2" | ||
``` | ||
|
||
## Command fetch_details | ||
|
||
Given a workflow CSV file, fetch details for each workflow (slow). | ||
|
||
``` | ||
bazel run //circleci:workflows -- fetch_details --input "${PWD}/data/circleci_workflows_IN.csv.bz2" --output "${PWD}/data/circleci_workflows_OUT.csv.bz2" | ||
``` | ||
|
||
## Command filter | ||
|
||
Read CSV files generated from `workflow.py fetch` and filters them. | ||
|
||
``` | ||
bazel run //circleci:workflows -- filter --workflow default_workflow,pre_merge --input /tmp/circleci.csv --output "${HOME}/circleci_filtered_workflows.csv" | ||
``` | ||
|
||
## Command request_branches | ||
|
||
Read and display the list of branches for `workflow` from CircleCI API. | ||
|
||
``` | ||
bazel run //circleci:workflows -- request_branches | ||
``` | ||
|
||
## Command request_workflow | ||
|
||
Given a workflow ID return its details. | ||
|
||
``` | ||
bazel run //circleci:workflows -- request_workflow --workflow_id <ID> | ||
``` | ||
|
||
## Command request_workflows | ||
|
||
Read and display the list of workflow names from CircleCI API. | ||
|
||
``` | ||
bazel run //circleci:workflows -- request_workflows | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.