<commit_before>GO15VENDOREXPERIMENT=1
APP=baryon

all: deps test build

deps: gvt_install
deps:
	gvt rebuild

test:
	go test

build:
	go build

build_linux:
	GOOS=linux go build

deploy:
	kubectl rolling-update $(APP)  --poll-interval="500ms" --image=gcr.io/$(GOOGLE_PROJECT)/$(APP)

force_pod_restart:
	kubectl get  pod -l"app=baryon" --no-headers | awk '{print $$1}' | xargs kubectl delete pod

cert:
	curl https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt -o ca-certificates.crt

circle_deps:
	bash deploy/gce/gcloud-setup.sh
	bash deploy/install-go.sh

update_secrets:
	kubectl replace -f deploy/gce/baryon-ssl.yml
	kubectl replace -f deploy/gce/baryon-secrets.yml

update_rc:
	kubectl get rc/baryon && kubectl replace -f deploy/gce/baryon-rc.yml ||  kubectl create -f deploy/gce/baryon-rc.yml

release:
	 GOOS=linux go build -o baryon-x86_64
	 GOOS=darwin go build -o baryon-darwin
	 GOOS=windows go build

refresh_deps: gvt_install
refresh_deps:
	bash deploy/refresh.sh

gvt_install:
	go get -u github.com/FiloSottile/gvt

# gce task builds the docker container, and pushes it to gce container repo.
# no reason this can't be quay.io
#  We pull down root certs, cause the docker image doesn't have them.
gce: docker
gce:
	gcloud docker push gcr.io/$(GOOGLE_PROJECT)/$(APP)

docker: cert build_linux
docker:
	docker build -t gcr.io/$(GOOGLE_PROJECT)/$(APP)  .

.PHONY: all<commit_msg>add list and release targets<commit_after>GO15VENDOREXPERIMENT=1
APP=baryon

all: deps test build

list:
	@make -rqp | awk -F':' '/^[a-zA-Z0-9][^$$#\/\t=]*:([^=]|$$)/ {split($$1,A,/ /);for(i in A)print A[i]}' | sort | uniq

deps: gvt_install
	gvt rebuild

test:
	go test

build:
	go build

build_linux:
	GOOS=linux go build

deploy:
	kubectl rolling-update $(APP)  --poll-interval="500ms" --image=gcr.io/$(GOOGLE_PROJECT)/$(APP)

force_pod_restart:
	kubectl get  pod -l"app=baryon" --no-headers | awk '{print $$1}' | xargs kubectl delete pod

cert:
	curl https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt -o ca-certificates.crt

circle_deps:
	bash deploy/gce/gcloud-setup.sh
	bash deploy/install-go.sh

update_secrets:
	kubectl replace -f deploy/gce/baryon-ssl.yml
	kubectl replace -f deploy/gce/baryon-secrets.yml

update_rc:
	kubectl get rc/baryon && kubectl replace -f deploy/gce/baryon-rc.yml ||  kubectl create -f deploy/gce/baryon-rc.yml

release_deps:
	go get github.com/aktau/github-release
	go get -u github.com/pantheon-systems/autotag

release: release_deps
release: TAG=$(shell autotag -n)
release:
	 @echo "Building release for $(TAG)"
	 autotag
	 GOOS=linux go build -o baryon-linux
	 GOOS=darwin go build -o baryon-darwin
	 GOOS=windows go build
	 github-release release -u pantheon-systems -r baryon -t $(TAG) --draft
	 github-release upload -u pantheon-systems -r baryon -n Linux -f baryon-linux -t $(TAG)
	 github-release upload -u pantheon-systems -r baryon -n OSX -f baryon-darwin -t $(TAG)
	 github-release upload -u pantheon-systems -r baryon -n Windows -f baryon.exe -t $(TAG)


refresh_deps: gvt_install
	bash deploy/refresh.sh

gvt_install:
	go get -u github.com/FiloSottile/gvt

# gce task builds the docker container, and pushes it to gce container repo.
# no reason this can't be quay.io
#  We pull down root certs, cause the docker image doesn't have them.
gce: docker
	gcloud docker push gcr.io/$(GOOGLE_PROJECT)/$(APP)

docker: cert build_linux
	docker build -t gcr.io/$(GOOGLE_PROJECT)/$(APP)  .

.PHONY: all
{'fraction_non_alphanumeric': 0.12323639504750936, 'fraction_numerical': 0.006046645551396487, 'mean_word_length': 3.998561151079137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4339971', 'n_tokens_mistral': 1481, 'n_tokens_neox': 1363, 'n_words': 363}