Get rid of scripts folder and enhance Makefile

This commit is contained in:
Seif Lotfy
2016-10-15 16:23:49 +02:00
committed by Travis Reeder
parent 7963d5a12f
commit cdf4ba1f96
14 changed files with 21 additions and 53 deletions

View File

@@ -1,23 +1,33 @@
# Just builds
DIR := ${CURDIR}
dep:
@ glide install --strip-vendor
glide install --strip-vendor
build:
@ go build -o functions
go build -o functions
build-docker:
sh scripts/build-docker.sh
release:
sh scripts/release.sh
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:
sh scripts/test.sh
go test -v $(shell glide nv | grep -v examples | grep -v tool)
run-docker:
sh scripts/run-docker.sh
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 glide nv | grep -v examples | grep -v tool)
run-simple:
run:
./functions
run-docker: build-docker
set -ex
docker run --rm --privileged -it -e LOG_LEVEL=debug -e "DB=bolt:///app/data/bolt.db" -v $(DIR)/data:/app/data -p 8080:8080 iron/functions
all: dep build

View File

@@ -29,5 +29,5 @@ dependencies:
test:
override:
- scripts/test.sh:
- make test-docker:
pwd: $GO_PROJECT

View File

@@ -1,4 +0,0 @@
set -ex
docker run --rm -v "$PWD":/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 .

View File

@@ -1,30 +0,0 @@
#!/bin/bash
set -ex
user="iron"
service="functions"
version_file="api/server/version.go"
tag="latest"
if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then
echo "did not find semantic version in $version_file"
exit 1
fi
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)
echo "Version: $version"
./scripts/build-docker.sh
git add -u
git commit -m "$service: $version release"
git tag -a "$version" -m "version $version"
git push
git push --tags
# Finally tag and push docker images
docker tag $user/$service:$tag $user/$service:$version
docker push $user/$service:$version
docker push $user/$service:$tag

View File

@@ -1,5 +0,0 @@
set -ex
sh ./scripts/build-docker.sh
docker run --rm --privileged -it -e LOG_LEVEL=debug -e "DB=bolt:///app/data/bolt.db" -v $PWD/data:/app/data -p 8080:8080 iron/functions

View File

@@ -1,3 +0,0 @@
#!/bin/bash
docker run -ti --privileged --rm -e GIN_MODE=$GIN_MODE -e LOG_LEVEL=debug -v /var/run/docker.sock:/var/run/docker.sock -v "$PWD":/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions iron/go:dev go test -v $(glide nv | grep -v examples | grep -v tool)