Docker Community Forums

Share and learn in the Docker community.

Build env var CACHE_TAG not passed to post_push hook


(Babboste) #1

the following hooks/post_push script:
#!/bin/bash

if [[ 'staging' = $SOURCE_BRANCH ]]; then
  GIT_SHA_TAG=${SOURCE_COMMIT:0:12}

  echo "CACHE_TAG: $CACHE_TAG"
  echo "IMAGE_NAME: $IMAGE_NAME"
  echo "DOCKER_REPO: $DOCKER_REPO"
fi

results in (as seen from build logs in Docker Cloud):

CACHE_TAG:
IMAGE_NAME: correct value
DOCKER_REPO: correct value

with empty CACHE_TAG

For now we are parsing and splitting the IMAGE_NAME on “:” … but this does not seem to be a stable solution …

Thanks
Stefano


(Javier Alejandro Miño) #2

Have you been able to solve this issue? I am having the same problem. Maybe it would be a good idea to report this as an issue.