mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Updated makefile docker commands (#545)
* Updated makefile docker commands * Fix * rename make target
This commit is contained in:
committed by
Seif Lotfy سيف لطفي
parent
83564387b4
commit
333f648b84
@@ -57,7 +57,7 @@ make test
|
|||||||
#### Run in Docker
|
#### Run in Docker
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make run-docker
|
make docker-run
|
||||||
```
|
```
|
||||||
|
|
||||||
will start IronFunctions inside a Docker container.
|
will start IronFunctions inside a Docker container.
|
||||||
@@ -65,7 +65,7 @@ will start IronFunctions inside a Docker container.
|
|||||||
## Tests in Docker
|
## Tests in Docker
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make test-docker
|
make docker-test
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
33
Makefile
33
Makefile
@@ -1,19 +1,12 @@
|
|||||||
# Just builds
|
# Just builds
|
||||||
.PHONY: all test dep build
|
.PHONY: all test dep build
|
||||||
|
|
||||||
DIR := ${CURDIR}
|
|
||||||
|
|
||||||
dep:
|
dep:
|
||||||
glide install --strip-vendor
|
glide install --strip-vendor
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -o functions
|
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:
|
test:
|
||||||
go test -v $(shell go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn)
|
go test -v $(shell go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn)
|
||||||
cd fn && $(MAKE) test
|
cd fn && $(MAKE) test
|
||||||
@@ -21,18 +14,24 @@ test:
|
|||||||
test-datastore:
|
test-datastore:
|
||||||
cd api/datastore && go test -v
|
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:
|
run:
|
||||||
./functions
|
./functions
|
||||||
|
|
||||||
run-docker: build-docker
|
docker-dep:
|
||||||
set -ex
|
docker run --rm -it -v ${CURDIR}:/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions treeder/glide install -v
|
||||||
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
|
|
||||||
|
docker-build:
|
||||||
|
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
|
||||||
|
docker build -t iron/functions:latest .
|
||||||
|
|
||||||
|
docker-run: build-docker
|
||||||
|
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
|
||||||
|
|
||||||
|
docker-test:
|
||||||
|
docker run -ti --privileged --rm -e LOG_LEVEL=debug \
|
||||||
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
|
-v ${CURDIR}:/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)
|
||||||
|
|
||||||
all: dep build
|
all: dep build
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ dependencies:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- make test-docker:
|
- make docker-test:
|
||||||
pwd: $GO_PROJECT
|
pwd: $GO_PROJECT
|
||||||
- make test-datastore:
|
- make test-datastore:
|
||||||
pwd: $GO_PROJECT
|
pwd: $GO_PROJECT
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ perl -i -pe 's/\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
|
|||||||
version=$(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file)
|
version=$(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file)
|
||||||
echo "Version: $version"
|
echo "Version: $version"
|
||||||
|
|
||||||
make build-docker
|
make docker-build
|
||||||
|
|
||||||
sed "s/release=.*/release=\"$version\"/g" fn/install.sh > fn/install.sh.tmp
|
sed "s/release=.*/release=\"$version\"/g" fn/install.sh > fn/install.sh.tmp
|
||||||
mv fn/install.sh.tmp fn/install.sh
|
mv fn/install.sh.tmp fn/install.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user