-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Dockerfile, normalize build/test process
- Loading branch information
Showing
5 changed files
with
54 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.git/ | ||
Makefile | ||
*.md | ||
LICENSE | ||
*.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# A Dockerfile that tries to simulate running in Travis CI, to make | ||
# debugging test failures easier. | ||
|
||
FROM ubuntu:12.04 | ||
|
||
RUN apt-get update -q | ||
RUN apt-get install -qq software-properties-common python-software-properties | ||
RUN add-apt-repository -y ppa:mercurial-ppa/releases | ||
RUN apt-get update -q | ||
RUN apt-get install -qq build-essential curl git mercurial cmake libssh2-1-dev libssl-dev pkg-config libgcrypt11-dev | ||
RUN apt-get install -qq python-setuptools | ||
RUN easy_install python-hglib | ||
|
||
# Install Go | ||
RUN curl -Ls https://golang.org/dl/go1.4.linux-amd64.tar.gz | tar -C /usr/local -xz | ||
ENV PATH /usr/local/go/bin:$PATH | ||
ENV GOBIN /usr/local/bin | ||
|
||
ENV GOPATH /opt | ||
ADD . /opt/src/sourcegraph.com/sourcegraph/go-vcs | ||
WORKDIR /opt/src/sourcegraph.com/sourcegraph/go-vcs | ||
RUN go get -v -t -d ./... | ||
RUN cd $GOPATH/src/github.com/libgit2/git2go && git submodule update --init | ||
RUN make -C $GOPATH/src/github.com/libgit2/git2go install | ||
|
||
CMD ["test", "-ldflags", "-extldflags=-L/opt/src/github.com/libgit2/git2go/vendor/libgit2/build", "./..."] | ||
ENTRYPOINT ["/usr/local/go/bin/go"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.PHONY: install test docker-test | ||
|
||
install: | ||
cd `go list -f '{{.Dir}}' github.com/libgit2/git2go` && make install | ||
|
||
test: | ||
go test -ldflags "-extldflags=-L"`go list -f '{{.Dir}}' github.com/libgit2/git2go`/vendor/libgit2/build ./... | ||
|
||
docker-test: | ||
docker build -t go-vcs . && docker run go-vcs |