<commit_before># Static binaries are where it's at!
CGO_ENABLED=0

# I'm waiting till the discussion pans out on vendoring. (https://github.com/golang/go/issues/14417 and others)
#
# I personally support the idea that vendor directories should *not* be tested (i.e. that the vendor directory
# should be named _vendor), as I like go test ./... as an idiom, but don't want to, and more importantly can't
# reliably run the tests for all my dependencies as we can't reliably pull in the transitive closure of all
# our dependencies dependencies at working versions - so running tests on dependencies opens us up to random
# flakes (for stuff we don't care about).
#
# The following 2 lines basically put back Go <= 1.5 gom behavior, using _vendor (which is then ignored in tests).
GO15VENDOREXPERIMENT=0
GOM_VENDOR_NAME=_vendor

TRAVIS_BUILD_NUMBER?=debug0

.PHONY: coverage get test clean

all: _vendor coverage AWSnycast

_vendor: Gomfile
	gom install

_vendor/src/github.com/stretchr/testify/assert: Gomfile
	gom -test install

AWSnycast: *.go */*.go _vendor
	gom build -a -tags netgo -ldflags '-w' .
	strip AWSnycast

test: _vendor/src/github.com/stretchr/testify/assert
	gom test -short ./...

fmt:
	go fmt ./...

coverage: _vendor/src/github.com/stretchr/testify/assert
	gom test -cover -short ./...

integration: _vendor/src/github.com/stretchr/testify/assert
	gom test ./...

clean:
	rm -rf dist */coverage.out */coverprofile.out coverage.out coverprofile.out AWSnycast _vendor

realclean: clean
	make -C tests/integration realclean

coverage.out:
	cd aws ; go test -coverprofile=coverage.out ./... ; cd ..
	cd daemon ; go test -coverprofile=coverage.out ./... ; cd ..
	cd config ; go test -coverprofile=coverage.out ./... ; cd ..
	cd healthcheck ; go test -coverprofile=coverage.out ./... ; cd ..
	cd instancemetadata ; go test -coverprofile=coverage.out ./... ; cd ..
	echo "mode: set" > coverage.out && cat */coverage.out | grep -v mode: | sort -r | awk '{if($$1 != last) {print $$0;last=$$1}}' >> coverage.out

itest_%:
	make -C package itest_$*

Gemfile.lock:
	bundle install

dist: AWSnycast Gemfile.lock
	rm -rf dist/ *.deb
	bundle exec fpm -s dir -t deb --name awsnycast --url "https://github.com/bobtfish/AWSnycast" --maintainer "<NAME> <<EMAIL>>" --description "Anycast in AWS" --license Apache2 --iteration $(TRAVIS_BUILD_NUMBER) --version $$(./AWSnycast -version) --prefix /usr/bin AWSnycast
	bundle exec fpm -s dir -t rpm --name awsnycast --url "https://github.com/bobtfish/AWSnycast" --maintainer "<NAME> <<EMAIL>>" --description "Anycast in AWS" --license Apache2 --iteration $(TRAVIS_BUILD_NUMBER) --version $$(./AWSnycast -version) --prefix /usr/bin AWSnycast
	mkdir dist
	mv *.deb *.rpm dist/
<commit_msg>Try fixing travis harder<commit_after># Static binaries are where it's at!
CGO_ENABLED=0

# I'm waiting till the discussion pans out on vendoring. (https://github.com/golang/go/issues/14417 and others)
#
# I personally support the idea that vendor directories should *not* be tested (i.e. that the vendor directory
# should be named _vendor), as I like go test ./... as an idiom, but don't want to, and more importantly can't
# reliably run the tests for all my dependencies as we can't reliably pull in the transitive closure of all
# our dependencies dependencies at working versions - so running tests on dependencies opens us up to random
# flakes (for stuff we don't care about).
#
# The following 4 lines basically put back Go <= 1.5 gom behavior, using _vendor (which is then ignored in tests).
GO15VENDOREXPERIMENT=0
GOM_VENDOR_NAME=_vendor
export GO15VENDOREXPERIMENT
export GOM_VENDOR_NAME

TRAVIS_BUILD_NUMBER?=debug0

.PHONY: coverage get test clean

all: _vendor coverage AWSnycast

_vendor: Gomfile
	gom install

_vendor/src/github.com/stretchr/testify/assert: Gomfile
	gom -test install

AWSnycast: *.go */*.go _vendor
	gom build -a -tags netgo -ldflags '-w' .
	strip AWSnycast

test: _vendor/src/github.com/stretchr/testify/assert
	gom test -short ./...

fmt:
	go fmt ./...

coverage: _vendor/src/github.com/stretchr/testify/assert
	gom test -cover -short ./...

integration: _vendor/src/github.com/stretchr/testify/assert
	gom test ./...

clean:
	rm -rf dist */coverage.out */coverprofile.out coverage.out coverprofile.out AWSnycast _vendor

realclean: clean
	make -C tests/integration realclean

coverage.out:
	cd aws ; go test -coverprofile=coverage.out ./... ; cd ..
	cd daemon ; go test -coverprofile=coverage.out ./... ; cd ..
	cd config ; go test -coverprofile=coverage.out ./... ; cd ..
	cd healthcheck ; go test -coverprofile=coverage.out ./... ; cd ..
	cd instancemetadata ; go test -coverprofile=coverage.out ./... ; cd ..
	echo "mode: set" > coverage.out && cat */coverage.out | grep -v mode: | sort -r | awk '{if($$1 != last) {print $$0;last=$$1}}' >> coverage.out

itest_%:
	make -C package itest_$*

Gemfile.lock:
	bundle install

dist: AWSnycast Gemfile.lock
	rm -rf dist/ *.deb
	bundle exec fpm -s dir -t deb --name awsnycast --url "https://github.com/bobtfish/AWSnycast" --maintainer "<NAME> <<EMAIL>>" --description "Anycast in AWS" --license Apache2 --iteration $(TRAVIS_BUILD_NUMBER) --version $$(./AWSnycast -version) --prefix /usr/bin AWSnycast
	bundle exec fpm -s dir -t rpm --name awsnycast --url "https://github.com/bobtfish/AWSnycast" --maintainer "<NAME> <<EMAIL>>" --description "Anycast in AWS" --license Apache2 --iteration $(TRAVIS_BUILD_NUMBER) --version $$(./AWSnycast -version) --prefix /usr/bin AWSnycast
	mkdir dist
	mv *.deb *.rpm dist/

{'fraction_non_alphanumeric': 0.12971014492753624, 'fraction_numerical': 0.006884057971014493, 'mean_word_length': 3.593178036605657, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 6, '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': '4677339', 'n_tokens_mistral': 1872, 'n_tokens_neox': 1813, 'n_words': 629}