<commit_before>GIT_COMMIT ?= HEAD
VERSION ?= $(shell git rev-parse --short ${GIT_COMMIT})
REGISTRY ?= quay.io/
IMAGE_PREFIX ?= mozmar
IMAGE_NAME ?= viewsourceconf
IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}\:${VERSION}
<<<<<<< HEAD
LATEST_DEPLOY_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}\:latest
BUILD_IMAGE_NAME ?= ${IMAGE_NAME}_build
BUILD_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${BUILD_IMAGE_NAME}\:${VERSION}
LATEST_BUILD_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${BUILD_IMAGE_NAME}\:latest
SERVE_PORT ?= 8080
LIVE_RELOAD_PORT ?= 35729
=======
LATEST_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}\:latest
BUILD_IMAGE_NAME ?= ${IMAGE_NAME}_build
BUILD_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${BUILD_IMAGE_NAME}\:${VERSION}
LATEST_BUILD_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${BUILD_IMAGE_NAME}\:latest
WATCH_PORT ?= 8080
SERVE_PORT ?= 8000
>>>>>>> Tag and push latest images
MOUNT_DIR ?= $(shell pwd)
APP_DIR ?= /app
DOCKER_RUN_ARGS ?= -v ${MOUNT_DIR}\:${APP_DIR} -w ${APP_DIR}
DEV_ARGS ?= ${DOCKER_RUN_ARGS} -p "${SERVE_PORT}:${SERVE_PORT}" \
                               -p "${LIVE_RELOAD_PORT}:${LIVE_RELOAD_PORT}"
SERVE_ARGS ?= -v ${MOUNT_DIR}/build:/usr/share/nginx/html \
              -v ${MOUNT_DIR}/nginx.conf:/etc/nginx/nginx.conf \
              -p "${SERVE_PORT}:80" 
HOST_IP ?= $(shell docker-machine ip || echo 127.0.0.1)
DEIS_PROFILE ?= usw
DEIS_APP ?= viewsourceconf-stage
PRIVATE_IMAGE ?= ${PRIVATE_REGISTRY}/${DEIS_APP}\:${VERSION}

.PHONY: build

build:
	docker run ${DOCKER_RUN_ARGS} ${BUILD_IMAGE} node build || \
	docker run ${DOCKER_RUN_ARGS} ${LATEST_BUILD_IMAGE} node build

dev:
	docker run ${DEV_ARGS} ${BUILD_IMAGE} node build dev || \
	docker run ${DEV_ARGS} ${LATEST_BUILD_IMAGE} node build dev

sh:
	docker run -it ${DOCKER_RUN_ARGS} ${BUILD_IMAGE} sh || \
	docker run -it ${DOCKER_RUN_ARGS} ${LATEST_BUILD_IMAGE} sh

build-build-image:
	docker build -f Dockerfile-build -t ${BUILD_IMAGE} .

build-deploy-image:
	docker build -t ${IMAGE} .

<<<<<<< HEAD
push-build-image: 
	docker push ${BUILD_IMAGE}

push-deploy-image: 
=======
tag-latest-build-image:
	docker tag -f ${IMAGE} ${LATEST_BUILD_IMAGE}

tag-latest-deploy-image:
	docker tag -f ${IMAGE} ${LATEST_DEPLOY_IMAGE}

push-build-image: tag-latest-build-image
	docker push ${BUILD_IMAGE}

push-deploy-image: tag-latest-deploy-image
>>>>>>> Tag and push latest images
	docker push ${IMAGE}
	docker push ${LATEST_DEPLOY_IMAGE}

push-latest-build-image: push-build-image<commit_msg>Refactor image push and push latest build image<commit_after>GIT_COMMIT ?= HEAD
VERSION ?= $(shell git rev-parse --short ${GIT_COMMIT})
REGISTRY ?= quay.io/
IMAGE_PREFIX ?= mozmar
IMAGE_NAME ?= viewsourceconf
IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}\:${VERSION}
<<<<<<< HEAD
LATEST_DEPLOY_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}\:latest
BUILD_IMAGE_NAME ?= ${IMAGE_NAME}_build
BUILD_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${BUILD_IMAGE_NAME}\:${VERSION}
LATEST_BUILD_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${BUILD_IMAGE_NAME}\:latest
SERVE_PORT ?= 8080
LIVE_RELOAD_PORT ?= 35729
=======
LATEST_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}\:latest
BUILD_IMAGE_NAME ?= ${IMAGE_NAME}_build
BUILD_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${BUILD_IMAGE_NAME}\:${VERSION}
LATEST_BUILD_IMAGE ?= ${REGISTRY}${IMAGE_PREFIX}/${BUILD_IMAGE_NAME}\:latest
WATCH_PORT ?= 8080
SERVE_PORT ?= 8000
>>>>>>> Tag and push latest images
MOUNT_DIR ?= $(shell pwd)
APP_DIR ?= /app
DOCKER_RUN_ARGS ?= -v ${MOUNT_DIR}\:${APP_DIR} -w ${APP_DIR}
DEV_ARGS ?= ${DOCKER_RUN_ARGS} -p "${SERVE_PORT}:${SERVE_PORT}" \
                               -p "${LIVE_RELOAD_PORT}:${LIVE_RELOAD_PORT}"
SERVE_ARGS ?= -v ${MOUNT_DIR}/build:/usr/share/nginx/html \
              -v ${MOUNT_DIR}/nginx.conf:/etc/nginx/nginx.conf \
              -p "${SERVE_PORT}:80" 
HOST_IP ?= $(shell docker-machine ip || echo 127.0.0.1)
DEIS_PROFILE ?= usw
DEIS_APP ?= viewsourceconf-stage
PRIVATE_IMAGE ?= ${PRIVATE_REGISTRY}/${DEIS_APP}\:${VERSION}

.PHONY: build

build:
	docker run ${DOCKER_RUN_ARGS} ${BUILD_IMAGE} node build || \
	docker run ${DOCKER_RUN_ARGS} ${LATEST_BUILD_IMAGE} node build

dev:
	docker run ${DEV_ARGS} ${BUILD_IMAGE} node build dev || \
	docker run ${DEV_ARGS} ${LATEST_BUILD_IMAGE} node build dev

sh:
	docker run -it ${DOCKER_RUN_ARGS} ${BUILD_IMAGE} sh || \
	docker run -it ${DOCKER_RUN_ARGS} ${LATEST_BUILD_IMAGE} sh

build-build-image:
	docker build -f Dockerfile-build -t ${BUILD_IMAGE} .

build-deploy-image:
	docker build -t ${IMAGE} .

<<<<<<< HEAD
<<<<<<< HEAD
push-build-image: 
	docker push ${BUILD_IMAGE}

push-deploy-image: 
=======
tag-latest-build-image:
	docker tag -f ${IMAGE} ${LATEST_BUILD_IMAGE}

tag-latest-deploy-image:
	docker tag -f ${IMAGE} ${LATEST_DEPLOY_IMAGE}

push-build-image: tag-latest-build-image
=======
push-build-image: 
>>>>>>> Refactor image push and push latest build image
	docker push ${BUILD_IMAGE}
	docker tag -f ${IMAGE} ${LATEST_BUILD_IMAGE}
	docker push ${LATEST_BUILD_IMAGE}

push-deploy-image: tag-latest-deploy-image
>>>>>>> Tag and push latest images
	docker push ${IMAGE}
	docker tag -f ${IMAGE} ${LATEST_DEPLOY_IMAGE}
	docker push ${LATEST_DEPLOY_IMAGE}

push-latest-build-image: push-build-image
{'fraction_non_alphanumeric': 0.1730030721966206, 'fraction_numerical': 0.009600614439324117, 'mean_word_length': 5.215990453460621, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7066986', 'n_tokens_mistral': 2102, 'n_tokens_neox': 1977, 'n_words': 377}