README.md in git-semaphore-1.0.0 vs README.md in git-semaphore-1.1.0

- old
+ new

@@ -36,21 +36,21 @@ The following [Semaphore API][] features are supported by `git semaphore`: | API feature | | command |summary | |------------------|----|---------|--------| -| [authentication][] | ✅ | | provide user authentication via an authentication token | -| [projects][] | ✅ | `git semaphore --projects` | list all projects and their current status | -| [project branches][] | ✅ | `git semaphore --branches` | list all branches for the current project | -| [branch status][] | ✅ | `git semaphore --status` | list the build status for the current branch | -| [branch history][] | ✅ | `git semaphore --history` | list the build history for the current branch | -| [build information][] | ❌ | | detailed information for a given build number | -| [build log][] | ❌ | | execution logs for a given build number _(per thread and command)_ | -| [rebuild][] | ✅ | `git semaphore --rebuild` | rebuild last revision for the current branch | -| [launch build][] | ❌ | | launch a build for the given commit SHA | -| [stop][] | ❌ | | stop an in-progress build | -| [deploy][] | ❌ | | run a deploy from a given build | +| [authentication][] | ✅ | | provide user authentication via an authentication token | +| [projects][] | ✅ | `git semaphore --projects` | list all projects and their current status | +| [project branches][] | ✅ | `git semaphore --branches` | list all branches for the current project | +| [branch status][] | ✅ | `git semaphore --status` | list the build status for the current branch | +| [branch history][] | ✅ | `git semaphore --history` | list the build history for the current branch | +| [build information][] | ✅ | `git semaphore --information` | detailed information for a given build number _(ie. all commits)_ | +| [build log][] | ❌ | | execution logs for a given build number _(per thread and command)_ | +| [rebuild][] | ✅ | `git semaphore --rebuild` | rebuild last revision for the current branch | +| [launch build][] | ❌ | | launch a build for the given commit SHA | +| [stop][] | ❌ | | stop an in-progress build | +| [deploy][] | ❌ | | run a deploy from a given build | [project branches]: https://semaphoreci.com/docs/branches-and-builds-api.html#project_branches [branch status]: https://semaphoreci.com/docs/branches-and-builds-api.html#branch_status [branch history]: https://semaphoreci.com/docs/branches-and-builds-api.html#branch_history [build information]: https://semaphoreci.com/docs/branches-and-builds-api.html#build_information @@ -109,10 +109,11 @@ | setting | inside git repo | pseudo-code | override | |--------------|--------------------|---------------------------------|---------------------------------| | project name | derived from pwd | `File.basename(Dir.pwd)` | `ENV['SEMAPHORE_PROJECT_NAME']` | | branch name | current git branch | `git symbolic-ref --short HEAD` | `ENV['SEMAPHORE_BRANCH_NAME']` | | commit SHA | current git head | `git rev-parse HEAD` | `ENV['SEMAPHORE_COMMIT_SHA']` | +| build number | last branch build | `N/A` | `ENV['SEMAPHORE_BUILD_NUMBER']` | However, each of these defaults can be overridden by setting the corresponding environment variable, as documented in the above table. The same `ENV`-based override mechanism can be leveraged to use `git semaphore` outside of a git repository. The `git semaphore --settings` command can be used to print out the values for these various settings: @@ -169,10 +170,16 @@ git semaphore --history _(the project and branch names are derived from the current git repository and the current git head)_ +### commit information for the last build of a project's branch + + git semaphore --information + +_(the project and branch names are derived from the current git repository and the current git head)_ + ## Formatting the raw `git semaphore` JSON output After installing [the indispensable jq utility][jq] (`brew install jq`), the raw JSON output generated by the various `git semaphore` commands can be formatted and queried as follows: # pretty-print the git semaphore settings @@ -184,9 +191,12 @@ # get the status of the last build for the current branch git semaphore --status | jq -r '.result' # list the build duration (in minutes) for all "passed" builds of the current branch git semaphore --history | jq -r '.builds | .[] | select(.result == "passed") | (.build_number|tostring) + "\t" + (.duration.minutes|tostring)' + + # list all commit SHAs that triggered the latest build + git semaphore --information | jq -r '.commits | .[] | .id' [semaphoreci.com]: https://semaphoreci.com/ [account settings]: https://semaphoreci.com/users/edit [Semaphore API]: https://semaphoreci.com/docs/api.html