Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-12-07 19:32:50 +0300
committerAhmad Sherif <me@ahmadsherif.com>2016-12-08 18:00:58 +0300
commitebc6f22795841278dcde08877ec12d782e0f79a1 (patch)
tree9539f23052c124be4ee484b9d50cc6c7ef223c85
parentb0b823ec44c112834e0fe930e13fdaa5b1929535 (diff)
Adapt Makefile test recipe to work on CI
Mostly copied from gitlab-workhorse Makefile, kudos to the authors!
-rw-r--r--.gitignore1
-rw-r--r--Makefile20
2 files changed, 18 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index e65d5acfc..0c79371f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
client/testdata/data
+_build
diff --git a/Makefile b/Makefile
index 5d224fbb6..1b10aa5b9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,23 @@
+PKG=gitlab.com/gitlab-org/git-access-daemon
+BUILD_DIR = $(shell pwd)
+
+export GOPATH:=$(GOPATH):${BUILD_DIR}/_build
+
all: test build
build:
go build -o git-daemon-server cmd/server/main.go
go build -o git-daemon-client cmd/client/main.go
-test:
- cd server && go test
- cd client && go test
+${BUILD_DIR}/_build:
+ mkdir -p $@/src/${PKG}
+ tar -cf - --exclude _build --exclude .git . | (cd $@/src/${PKG} && tar -xf -)
+ touch $@
+
+test: ${BUILD_DIR}/_build
+ cd ${BUILD_DIR}/_build/src/${PKG}/server && go test
+ cd ${BUILD_DIR}/_build/src/${PKG}/client && go test
+
+clean:
+ rm -rf ${BUILD_DIR}/_build
+ rm -rf client/testdata