FireHydrant provides a command line tool, fhcli, to easily submit changes from your existing CI or orchestration systems. With fhcli you can record the creation of Docker images, deploy events in Jenkins, CI build statuses, etc.

We publish releases at https://github.com/firehydrant/fhcli/releases and builds are available for MacOS (darwin) and Linux (amd64) with support for more platforms coming. 

Configuration

You'll need a bot token for the controller to authenticate with; we recommend that you generate one specifically for this integration. Put this in an environment variable in your CI system or export it in a setup script. If the bot token is stored in FH_API_KEY  then fhcli tool will automatically use it. 

You can also store it in ~/firehydrant.cfg  or /etc/firehydrant.cfg  and it will automatically be used. We recommend also storing the environment name there if it's the same across all invocations of fhcli  from this system.

apiKey: fhb-00a0a0a00a0a0a00a0a0a0a0a00a0a0a
environment: production 

Usage

You can record the creation of a docker image in FireHydrant by wrapping your call to docker build  with fhcli:

fhcli execute --service=railsapp -- docker build -t app .

This is a simple example but we recommend sending identities for a change like the Git revision or container image URL with the fhcli  call: 

fhcli execute --service=railsapp --identities "revision=${CIRCLE_SHA1},git=${CIRCLE_REPOSITORY_URL}:${CIRCLE_SHA1},image=us.gcr.io/${GOOGLE_PROJECT_ID}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1}" -- docker build -t app .

This may look complicated at first but it's just adding the above mentioned data , in this case it's provided by CircleCI:

  • Current Git revision revision=${CIRCLE_SHA1} 
  • Full path of Git commit git=${CIRCLE_REPOSITORY_URL}:${CIRCLE_SHA1} 
  • Docker image image=us.gcr.io/${GOOGLE_PROJECT_ID}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1}

By sending this information we can link a GitHub pull request to an updated Pod spec in a Kubernetes deployment. Sending this level of detail is not required but leads to better visibility into the propagation of changes through your system.

Did this answer your question?