Skip to content

Commit

Permalink
Use the right paths
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Aug 26, 2018
1 parent 61f447d commit 76bd0f0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# These come from https://docs.docker.com/docker-cloud/builds/advanced/

printenv
env

echo "DOCKER_TAG: ${DOCKER_TAG}"
echo "SOURCE_BRANCH: ${SOURCE_BRANCH}"
Expand All @@ -14,10 +13,14 @@ echo "COMMIT_MSG: ${COMMIT_MSG}"
echo "DOCKER_REPO: ${DOCKER_REPO}"
echo "DOCKER_TAG: ${DOCKER_TAG}"
echo "IMAGE_NAME: ${IMAGE_NAME}"
echo "PATH: ${DOCKERFILE_PATH}"
echo "BUILD_PATH: ${BUILD_PATH}"

echo "before"
FILE=$(echo -n $BUILD_PATH | tail -c +2)
echo "after"

if [ -z "${DOCKER_TAG}" ]; then
docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) --build-arg=BRANCH=${SOURCE_BRANCH} -t $IMAGE_NAME -f $DOCKERFILE_PATH .
docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) --build-arg=BRANCH=$SOURCE_BRANCH -t $IMAGE_NAME -f $FILE .
else
docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) --build-arg=BRANCH=${DOCKER_TAG} -t $IMAGE_NAME -f $DOCKERFILE_PATH .
docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) --build-arg=BRANCH=$DOCKER_TAG -t $IMAGE_NAME -f $FILE .
fi

0 comments on commit 76bd0f0

Please sign in to comment.