mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
since the db files were being created inside of the docker container with only permissions for the root user to rwx and docker run needs all of $PWD to be readable in order to build a docker container on the host, `make run-docker` was broken on any subsequent runs. If we create more permissive permissions then we don't have that issue (group +rx)
38 lines
1.0 KiB
Makefile
38 lines
1.0 KiB
Makefile
# Just builds
|
|
|
|
DIR := ${CURDIR}
|
|
|
|
dep:
|
|
glide install --strip-vendor
|
|
|
|
build:
|
|
go build -o functions
|
|
|
|
build-docker:
|
|
set -ex
|
|
docker run --rm -v $(DIR):/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions iron/go:dev go build -o functions-alpine
|
|
docker build -t iron/functions:latest .
|
|
|
|
test:
|
|
go test -v $(shell go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn)
|
|
cd fn && $(MAKE) test
|
|
|
|
test-datastore:
|
|
cd api/datastore && go test -v
|
|
|
|
test-docker:
|
|
docker run -ti --privileged --rm -e LOG_LEVEL=debug \
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
-v $(DIR):/go/src/github.com/iron-io/functions \
|
|
-w /go/src/github.com/iron-io/functions iron/go:dev go test \
|
|
-v $(shell go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn | grep -v datastore)
|
|
|
|
run:
|
|
./functions
|
|
|
|
run-docker: build-docker
|
|
set -ex
|
|
docker run --rm --privileged -it -e LOG_LEVEL=debug -e "DB_URL=bolt:///app/data/bolt.db" -v $(DIR)/data:/app/data -p 8080:8080 iron/functions
|
|
|
|
all: dep build
|