TACC-Cloud / abaco-cli

Command line toolkit for developing, managing, and using Abaco Actors
Other
2 stars 3 forks source link

Support for tagging Docker image with latest Git commit hash #22

Open mwvaughn opened 5 years ago

mwvaughn commented 5 years ago

A workflow that grew out of some user's CICD workflows is to tell abaco deploy to override the value specified by DOCKER_IMAGE_VERSION in the reactor.rc file with the current Git repo short hash.

This is achieved by detecting the hash and passing it to the -t option, but this requires a separate, out-of-band step to detect the hash.

Extend the abaco deploy workflow to support this automatically:

  1. Add DOCKER_USE_COMMIT_HASH as a reactor.rc variable
  2. Add detection of current git commit hash to abaco deploy
  3. Update behavior of -t so the image tag is set in the following order when DOCKER_USE_COMMIT_HASH=1

Argument -t [value] > [git commit hash] > latest if git | DOCKER_IMAGE_VERSION if ! git

mwvaughn commented 5 years ago

Implemented in e1b4cd0fa3aa5a55c9733fdef586022dd5eaa684

mwvaughn commented 5 years ago

Reopening to test