Commit 646de543 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Be compatible with GOPATH

parent 285f47a7
......@@ -4,3 +4,4 @@ testdata/scratch
testdata/public
gitlab-zip-cat
gitlab-zip-metadata
_build
PREFIX=/usr/local
VERSION=$(shell git describe)-$(shell date -u +%Y%m%d.%H%M%S)
GOBUILD=go build -ldflags "-X main.Version=${VERSION}"
GOPATH=$(shell pwd)/_build
GOBUILD=GOPATH=${GOPATH} go build -ldflags "-X main.Version=${VERSION}"
PKG=gitlab.com/gitlab-org/gitlab-workhorse
all: gitlab-zip-cat gitlab-zip-metadata gitlab-workhorse
all: clean-build gitlab-zip-cat gitlab-zip-metadata gitlab-workhorse
gitlab-zip-cat: $(shell find cmd/gitlab-zip-cat/ -name '*.go')
${GOBUILD} -o $@ ./cmd/$@
gitlab-zip-cat: _build $(shell find cmd/gitlab-zip-cat/ -name '*.go')
${GOBUILD} -o $@ ${PKG}/cmd/$@
gitlab-zip-metadata: $(shell find cmd/gitlab-zip-metadata/ -name '*.go')
${GOBUILD} -o $@ ./cmd/$@
gitlab-zip-metadata: _build $(shell find cmd/gitlab-zip-metadata/ -name '*.go')
${GOBUILD} -o $@ ${PKG}/cmd/$@
gitlab-workhorse: $(shell find . -name '*.go')
${GOBUILD} -o $@
gitlab-workhorse: _build $(shell find . -name '*.go' | grep -v '^\./_')
${GOBUILD} -o $@ ${PKG}
install: gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
mkdir -p $(DESTDIR)${PREFIX}/bin/
install gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata ${DESTDIR}${PREFIX}/bin/
_build:
mkdir -p $@/src/${PKG}
tar -cf - --exclude src --exclude .git . | \
(cd $@/src/${PKG} && tar -xf -)
touch $@
.PHONY: test
test: testdata/data/group/test.git clean-workhorse all
go fmt ./... | awk '{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }'
support/path go test ./...
test: testdata/data/group/test.git clean-build clean-workhorse all
GOPATH=${GOPATH} go fmt ${PKG}/... | awk '{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }'
GOPATH=${GOPATH} support/path go test ${PKG}/...
@echo SUCCESS
coverage: testdata/data/group/test.git
......@@ -38,9 +46,13 @@ testdata/data:
mkdir -p $@
.PHONY: clean
clean: clean-workhorse
clean: clean-workhorse clean-build
rm -rf testdata/data testdata/scratch
.PHONY: clean-workhorse
clean-workhorse:
rm -f gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata
.PhONY: clean-build
clean-build:
rm -rf _build
\ No newline at end of file
package main
import (
"./internal/api"
"./internal/helper"
"./internal/testhelper"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"net/http"
"net/http/httptest"
"regexp"
......
package main
import (
"../../internal/zipartifacts"
"archive/zip"
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io"
"os"
)
......
package main
import (
"../../internal/zipartifacts"
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"os"
)
......
package api
import (
"../badgateway"
"../helper"
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io/ioutil"
"net/http"
......
package artifacts
import (
"../api"
"../helper"
"../zipartifacts"
"bufio"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io"
"mime"
"net/http"
......
package artifacts
import (
"../api"
"../helper"
"../testhelper"
"archive/zip"
"encoding/base64"
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
......
package artifacts
import (
"../api"
"../helper"
"../upload"
"../zipartifacts"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upload"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io/ioutil"
"mime/multipart"
"net/http"
......
package artifacts
import (
"../api"
"../helper"
"../proxy"
"../testhelper"
"../zipartifacts"
"archive/zip"
"bytes"
"compress/gzip"
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/proxy"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/zipartifacts"
"io"
"io/ioutil"
"mime/multipart"
......
package badgateway
import (
"../helper"
"bytes"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"net"
"net/http"
......
......@@ -5,9 +5,9 @@ In this file we handle 'git archive' downloads
package git
import (
"../helper"
"../senddata"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"io"
"io/ioutil"
"log"
......
package git
import (
"../helper"
"../senddata"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"io"
"log"
"net/http"
......
......@@ -5,11 +5,11 @@ In this file we handle the Git 'smart HTTP' protocol
package git
import (
"../api"
"../delay"
"../helper"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/delay"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"log"
"net/http"
......
......@@ -5,13 +5,13 @@ In this file we handle git lfs objects downloads and uploads
package lfs
import (
"../api"
"../helper"
"bytes"
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io/ioutil"
"net/http"
......
package proxy
import (
"../badgateway"
"../helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"net/http"
"net/http/httputil"
"net/url"
......
......@@ -7,7 +7,7 @@ via the X-Sendfile mechanism. All that is needed in the Rails code is the
package sendfile
import (
"../helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"log"
"net/http"
)
......
package staticpages
import (
"../helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"net/http"
"path/filepath"
......
package staticpages
import (
"../testhelper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
......
package staticpages
import (
"../helper"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io/ioutil"
"log"
"net/http"
......
package staticpages
import (
"../testhelper"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
......
package staticpages
import (
"../helper"
"../urlprefix"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/urlprefix"
"log"
"net/http"
"os"
......
package staticpages
import (
"../testhelper"
"bytes"
"compress/gzip"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
......
package upload
import (
"../helper"
"bytes"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"io/ioutil"
"mime/multipart"
......
package upload
import (
"../helper"
"../proxy"
"../testhelper"
"bytes"
"errors"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/proxy"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io"
"io/ioutil"
"mime/multipart"
......
package upstream
import (
"../testhelper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"net/http"
"net/http/httptest"
"testing"
......
package upstream
import (
"../helper"
"compress/gzip"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"io"
"net/http"
)
......
package upstream
import (
"../testhelper"
"bytes"
"compress/gzip"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io/ioutil"
"net/http"
"net/http/httptest"
......
package upstream
import (
apipkg "../api"
"../artifacts"
"../git"
"../lfs"
proxypkg "../proxy"
"../senddata"
"../sendfile"
"../staticpages"
apipkg "gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/artifacts"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/git"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/lfs"
proxypkg "gitlab.com/gitlab-org/gitlab-workhorse/internal/proxy"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/senddata"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/sendfile"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/staticpages"
"net/http"
"regexp"
)
......
......@@ -7,10 +7,10 @@ In this file we handle request routing and interaction with the authBackend.
package upstream
import (
"../badgateway"
"../helper"
"../urlprefix"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/urlprefix"
"net/http"
"net/url"
"strings"
......
......@@ -14,9 +14,9 @@ In this file we start the web server and hand off to the upstream type.
package main
import (
"./internal/upstream"
"flag"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream"
"log"
"net"
"net/http"
......
package main
import (
"./internal/api"
"./internal/helper"
"./internal/testhelper"
"./internal/upstream"
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/api"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/upstream"
"io"
"io/ioutil"
"log"
......
package main
import (
"./internal/badgateway"
"./internal/helper"
"./internal/proxy"
"./internal/testhelper"
"bytes"
"fmt"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/badgateway"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/proxy"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/testhelper"
"io"
"net"
"net/http"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment