This CLI has a simple purpose: Cleanly and concisely display the status of the configured project's branch in Circle CI
You'll just need yarn in order to install dependencies and run the script. Feel free to use npm instead, but I haven't tested anything with npm.
npm install --global yarn
or for OSX
brew install yarn
- Clone the repo
git clone https://github.com/adamtaylor13/hoop.git
- Install yarn packages
yarn install
- Fill out the .env file with pertinent info
CIRCLE_API_TOKEN=token REPO_PATH=path/to/your/repo/hosted/on/circle PROJECT_SLUG=github/my-project WORKFLOW_NAME=workflow_to_isolate
CIRCLE_API_TOKEN
: This is the API token used to communicate with Circle CI
REPO_PATH
: The absolute path on your local machine, to the repository you want to track on Circle CI.
PROJECT_SLUG
: The slug used by Circle to uniquely identify your project's pipelines and workflows. It will be part
of the URL.
WORKFLOW_NAME
: The workflow to track in Circle. Eventually this may support tracking the entire pipeline for each commit,
but for now my use-case is only watching a specific workflow (the "testing" workflow) and watching that every individual
test job succeeds within that specific workflow.
To run the project, simply run yarn start
, and Ctrl-C
when you wish to end the loop.
In the future, there may be support to define when the loop should end, but for now
it's for monitoring, and to that end, there's no reason for it.
The goal behind this project is to easily monitor your CircleCI pipeline's status as you push / modify your branch.
--pipelineIndex=N
This arg defines some index (N
) to look backwards for pipelines. For example, if you're running your current pipeline,
but want to see which tests failed on the previous pipeline's run, you can run:
yarn start --pipelineIndex=1
This will run the 2nd most recent pipeline.
You can further extend this by leveraging a bash script to access this script from any location on your system. For example, I use the following function source'd into my bash_profile:
function hoop() {
startingPath=$(pwd)
debug "Starting at: ${startingPath}"
cd ~/path/to/hoop
yarn start --pipelineIndex="${1}"
debug "Navigating back to ${startingPath}"
cd "${startingPath}"
}
- Add tests
- 100% Test Coverage Goal
- Use Blessed in order to provide a more beautified experience
- Provide better error messaging & recovery options
- Allow this package to be installed / run globally so that it can work for any given repo without additional configuration