Simple API for running CircleCI jobs via public endpoints.
The purpose of this app is to allow "safe" CircleCI jobs to be run on-demand without credentials. This is intended to allow organizational house-keeping tasks captured in scripts to be run by chatbot commands and through custom menus in Google Docs.
This section is a work-in-progress.
Configure the app appropriately, and POST to endpoints of the following format:
https://myapp.herokuapp.com/jobs/my_job_name
You may fetch a list of options for runnable job names via:
https://myapp.herokuapp.com/jobs
The specific job name will depend how you've named them in your target
repo's .circleci/config.yml
.
-
GITHUB_REPO
. The repo from which the jobs should be run. Example:CivicTechTO/civictechto-scripts
. -
GIT_BRANCH
. The name of the branch from which the code should be run. This defaults to the default branch as set through GitHub. (Optional) -
CIRCLE_API_USER_TOKEN
. A personal API token for a user with appropriate permissions on the repo. Having write access on the GitHub repo should give proper access. (Project tokens are read-only, and so won't work.) -
JOBS_BLACKLIST
. A comma-separated list of job names that shouldn't be runnable via public API endpoint. (Optional. Default:default
)
cp sample.env .env
# Customize values in .env
pipenv install
pipenv run flask run
- Create landing page.
- Add redirects to landing page.
- Create swagger doc and link on landing page.
- Use default branch.
- Add heroku deploy button.
- Add whitelist/blacklist for job names.
- Add tests.
- Add auto-deploy to Heroku.
- Add ability to set repo/branch in POST data.
- Convert to a GitHub app.