<commit_before>.SILENT :
.PHONY : volume mount build clean start stop rm shell test dist

USERNAME:=ncarlier
APPNAME:=webhookd
IMAGE:=$(USERNAME)/$(APPNAME)

TAG:=`git describe --abbrev=0 --tags`
LDFLAGS:=-X main.buildVersion $(TAG)
ROOTPKG:=github.com/$(USERNAME)
PKGDIR:=$(GOPATH)/src/$(ROOTPKG)

define docker_run_flags
--rm \
-v /var/run/docker.sock:/var/run/docker.sock \
--env-file $(PWD)/etc/env.conf \
-P \
-i -t
endef

all: build

volume:
	echo "Building $(APPNAME) volumes..."
	sudo docker run -v $(PWD):/var/opt/$(APPNAME) -v ~/var/$(APPNAME):/var/opt/$(APPNAME) --name $(APPNAME)_volumes busybox true

key:
	$(eval docker_run_flags += -v $(PWD)/ssh:/root/.ssh)
	echo "Add private deploy key"

mount:
	$(eval docker_run_flags += --volumes-from $(APPNAME)_volumes)
	echo "DEVMODE: Using volumes from $(APPNAME)_volumes"

build:
	echo "Building $(IMAGE) docker image..."
	sudo docker build --rm -t $(IMAGE) .

clean: stop rm
	echo "Removing $(IMAGE) docker image..."
	sudo docker rmi $(IMAGE)

start:
	echo "Running $(IMAGE) docker image..."
	sudo docker run $(docker_run_flags) --name $(APPNAME) $(IMAGE)

stop:
	echo "Stopping container $(APPNAME) ..."
	-sudo docker stop $(APPNAME)

rm:
	echo "Deleting container $(APPNAME) ..."
	-sudo docker rm $(APPNAME)

shell:
	echo "Running $(IMAGE) docker image with shell access..."
	sudo docker run $(docker_run_flags) --entrypoint="/bin/bash" $(IMAGE) -c /bin/bash

test:<commit_msg>chore: Update volume paths.<commit_after>.SILENT :
.PHONY : volume mount build clean start stop rm shell test dist

USERNAME:=ncarlier
APPNAME:=webhookd
IMAGE:=$(USERNAME)/$(APPNAME)

TAG:=`git describe --abbrev=0 --tags`
LDFLAGS:=-X main.buildVersion $(TAG)
ROOTPKG:=github.com/$(USERNAME)
PKGDIR:=$(GOPATH)/src/$(ROOTPKG)

define docker_run_flags
--rm \
-v /var/run/docker.sock:/var/run/docker.sock \
--env-file $(PWD)/etc/env.conf \
-P \
-i -t
endef

all: build

volume:
	echo "Building $(APPNAME) volumes..."
	sudo docker run \
		-v $(PWD)/src:/go/src/github.com/$(USERNAME)/$(APPNAME) \
		-v $(PWD)/scripts:/var/opt/$(APPNAME)/scripts \
		--name $(APPNAME)_volumes busybox true

key:
	$(eval docker_run_flags += -v $(PWD)/ssh:/root/.ssh)
	echo "Add private deploy key"

mount:
	$(eval docker_run_flags += --volumes-from $(APPNAME)_volumes)
	echo "Using volumes from $(APPNAME)_volumes"

build:
	echo "Building $(IMAGE) docker image..."
	sudo docker build --rm -t $(IMAGE) .

clean: stop rm
	echo "Removing $(IMAGE) docker image..."
	sudo docker rmi $(IMAGE)

start:
	echo "Running $(IMAGE) docker image..."
	sudo docker run $(docker_run_flags) --name $(APPNAME) $(IMAGE)

stop:
	echo "Stopping container $(APPNAME) ..."
	-sudo docker stop $(APPNAME)

rm:
	echo "Deleting container $(APPNAME) ..."
	-sudo docker rm $(APPNAME)

shell:
	echo "Running $(IMAGE) docker image with shell access..."
	sudo docker run $(docker_run_flags) --entrypoint="/bin/bash" $(IMAGE) -c /bin/bash

test:
{'fraction_non_alphanumeric': 0.17846153846153845, 'fraction_numerical': 0.0006837606837606838, 'mean_word_length': 4.010273972602739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5838968', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1046, 'n_words': 295}