0.1.2 • Published 5 years ago

gitlab-ci-trace v0.1.2

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

gitlab-ci-trace

npm version

Output the results of CI job traces into the console that has pushed the commit. This mimics the behaviour users of Heroku are used to where by a push to heroku will trigger a build and the build status appears as part of the push status.

Features

  • Support for gitlab.com or custom deployments
  • Auto detects the GitLab host based on the ssh or https git url
  • Trace multiple simultaneous jobs
  • Auto detect the correct running jobs based on the HEAD commit hash

Usage

npm install -g gitlab-ci-trace

Unfortunately there is no functionality within git itself for a post push hook which is what we would like to hook onto. Instead we need to use a git alias.

You can choose to name the alias whatever you want. I chose git pusht for push and trace.

# ~/.gitconfig
[alias]
	pusht = !"git push $* && gitlab-ci-trace"

or

git config --global alias.pusht '!git push $* && gitlab-ci-trace'

You can also choose to just call the command directly after a push when you need to check on the status of a build.