<commit_before># Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the
# "License"). You may not use this file except in compliance
#  with the License. A copy of the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and
# limitations under the License.
VERSION := $(shell git describe --tags | sed -e 's/v//' -e 's/-.*//')

.PHONY: dev generate lint static test build-mock-images sources rpm

dev:
	./scripts/gobuild.sh dev

generate:
	PATH=$(PATH):$(shell pwd)/scripts go generate -v ./...

lint:
	./scripts/lint.sh

static:
	./scripts/gobuild.sh

gotest:
	GOPATH="$(shell pwd)/ecs-init/Godeps/_workspace:$(GOPATH)" go test -short -v -cover ./...

test: generate lint gotest

test-in-docker:
	docker build -f scripts/dockerfiles/test.dockerfile -t "amazon/amazon-ecs-init-test:make" .
	docker run -v "$(shell pwd):/go/src/github.com/aws/amazon-ecs-init" "amazon/amazon-ecs-init-test:make"

build-mock-images:
	docker build -t "test.localhost/amazon/mock-ecs-agent" -f "scripts/dockerfiles/mock-agent.dockerfile" .
	docker build -t "test.localhost/amazon/wants-update" -f "scripts/dockerfiles/wants-update.dockerfile" .
	docker build -t "test.localhost/amazon/exit-success" -f "scripts/dockerfiles/exit-success.dockerfile" .

sources:
	./scripts/update-version.sh
	cp packaging/amazon-linux-ami/ecs-init.spec ecs-init.spec
	cp packaging/amazon-linux-ami/ecs.conf ecs.conf
	tar -czf ./sources.tgz ecs-init scripts

srpm: sources
	rpmbuild -bs ecs-init.spec

rpm: sources
	rpmbuild -bb ecs-init.spec

ubuntu-trusty:
	cp packaging/ubuntu-trusty/ecs.conf ecs.conf
	tar -czf ./amazon-ecs-init_${VERSION}.orig.tar.gz ecs-init ecs.conf scripts README.md
	mkdir -p BUILDROOT
	cp -r packaging/ubuntu-trusty/debian BUILDROOT/debian
	cp -r ecs-init BUILDROOT
	cp ecs.conf BUILDROOT
	cp -r scripts BUILDROOT
	cp README.md BUILDROOT
	cd BUILDROOT && debuild

get-deps:
	go get github.com/tools/godep
	go get golang.org/x/tools/cover
	go get golang.org/x/tools/cmd/cover
	go get golang.org/x/tools/cmd/goimports
<commit_msg>Option to build debs without signing<commit_after># Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the
# "License"). You may not use this file except in compliance
#  with the License. A copy of the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and
# limitations under the License.
VERSION := $(shell git describe --tags | sed -e 's/v//' -e 's/-.*//')
DEB_SIGN ?= 1

.PHONY: dev generate lint static test build-mock-images sources rpm

dev:
	./scripts/gobuild.sh dev

generate:
	PATH=$(PATH):$(shell pwd)/scripts go generate -v ./...

lint:
	./scripts/lint.sh

static:
	./scripts/gobuild.sh

gotest:
	GOPATH="$(shell pwd)/ecs-init/Godeps/_workspace:$(GOPATH)" go test -short -v -cover ./...

test: generate lint gotest

test-in-docker:
	docker build -f scripts/dockerfiles/test.dockerfile -t "amazon/amazon-ecs-init-test:make" .
	docker run -v "$(shell pwd):/go/src/github.com/aws/amazon-ecs-init" "amazon/amazon-ecs-init-test:make"

build-mock-images:
	docker build -t "test.localhost/amazon/mock-ecs-agent" -f "scripts/dockerfiles/mock-agent.dockerfile" .
	docker build -t "test.localhost/amazon/wants-update" -f "scripts/dockerfiles/wants-update.dockerfile" .
	docker build -t "test.localhost/amazon/exit-success" -f "scripts/dockerfiles/exit-success.dockerfile" .

sources:
	./scripts/update-version.sh
	cp packaging/amazon-linux-ami/ecs-init.spec ecs-init.spec
	cp packaging/amazon-linux-ami/ecs.conf ecs.conf
	tar -czf ./sources.tgz ecs-init scripts

srpm: sources
	rpmbuild -bs ecs-init.spec

rpm: sources
	rpmbuild -bb ecs-init.spec

ubuntu-trusty:
	cp packaging/ubuntu-trusty/ecs.conf ecs.conf
	tar -czf ./amazon-ecs-init_${VERSION}.orig.tar.gz ecs-init ecs.conf scripts README.md
	mkdir -p BUILDROOT
	cp -r packaging/ubuntu-trusty/debian BUILDROOT/debian
	cp -r ecs-init BUILDROOT
	cp ecs.conf BUILDROOT
	cp -r scripts BUILDROOT
	cp README.md BUILDROOT
	cd BUILDROOT && debuild $(shell [ "$(DEB_SIGN)" -ne "0" ] || echo "-uc -us")

get-deps:
	go get github.com/tools/godep
	go get golang.org/x/tools/cover
	go get golang.org/x/tools/cmd/cover
	go get golang.org/x/tools/cmd/goimports

{'fraction_non_alphanumeric': 0.1307531380753138, 'fraction_numerical': 0.005439330543933054, 'mean_word_length': 3.6780821917808217, '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': '3029006', 'n_tokens_mistral': 1765, 'n_tokens_neox': 1706, 'n_words': 474}