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 0f03e58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions Dockerfile.runner
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ ARG COMMIT=""
LABEL branch=${BRANCH}
LABEL commit=${COMMIT}

RUN echo "BRANCH: ${BRANCH}" \
&& echo "COMMIT: ${COMMIT}" \

ADD . /app
WORKDIR /app

Expand Down
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 0f03e58

Please sign in to comment.