github.com/iron-io/functions@v0.0.0-20180820112432-d59d7d1c40b2/Makefile (about)

     1  # Just builds
     2  .PHONY: all test dep build
     3  
     4  dep:
     5  	dep ensure
     6  
     7  build:
     8  	go build -o functions
     9  
    10  clean-db:
    11  	rm -f /tmp/bolt_fn_*.db
    12  
    13  test: clean-db
    14  	go test -v $(shell go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn)
    15  	cd fn && $(MAKE) test
    16  
    17  test-tag: clean-db
    18  	go test -v $(shell go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn) -tags=$(TAG)
    19  
    20  test-datastore:
    21  	cd api/datastore && go test -v ./...
    22  
    23  test-build-arm:
    24      GOARCH=arm GOARM=5 $(MAKE) build
    25      GOARCH=arm GOARM=6 $(MAKE) build
    26      GOARCH=arm GOARM=7 $(MAKE) build
    27      GOARCH=arm64 $(MAKE) build
    28  
    29  run:
    30  	./functions
    31  
    32  docker-build:
    33  	docker run --rm -v ${CURDIR}:/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions iron/go:dev go build -o functions-alpine
    34  	docker build -t iron/functions:latest .
    35  
    36  docker-run: docker-build
    37  	docker run --rm --privileged -it -e LOG_LEVEL=debug -e "DB_URL=bolt:///app/data/bolt.db" -v ${CURDIR}/data:/app/data -p 8080:8080 iron/functions
    38  
    39  docker-test:
    40  	docker run -ti --privileged --rm -e LOG_LEVEL=debug \
    41  	-v /var/run/docker.sock:/var/run/docker.sock \
    42  	-v ${CURDIR}:/go/src/github.com/iron-io/functions \
    43  	-w /go/src/github.com/iron-io/functions iron/go:dev go test \
    44  	-v $(shell docker run -ti -v ${CURDIR}:/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions -e GOPATH=/go golang:alpine sh -c 'go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn | grep -v datastore')
    45  
    46  all: dep build