Skip to content

Commit

Permalink
Merge pull request #159 from bolinfest/nicks/circleci
Browse files Browse the repository at this point in the history
add instructions on how to build plovr in a docker container
  • Loading branch information
nicks authored Aug 20, 2018
2 parents 7bea111 + ba31bb7 commit 952e2b1
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
.buckd
buck-out
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nicks/plovr-deps

ADD . /plovr

WORKDIR /plovr

RUN buck fetch //third-party/...

RUN buck test :test
16 changes: 16 additions & 0 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Builds the image nicks/plovr-base
FROM java:8

# Install deps
RUN apt update && apt install -y \
git \
ant \
gcc \
python \
python-dev

# Build BUCK
RUN git clone https://github.com/facebook/buck.git /buck/
WORKDIR /buck
RUN ant
RUN ln -sf /buck/bin/buck /usr/bin/
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@ buck build plovr

The output of the build will be in `buck-out/gen/plovr.jar`.

### Building Plovr inside a Docker container

If you want to build plovr without installing Buck on your local machine,
we have a Docker container with Buck installed.

The Plovr build is split into two Dockerfiles:

- [Dockerfile](Dockerfile) builds and tests Plovr
- [Dockerfile.base](Dockerfile.base) builds Buck and Plovr's dependencies

To test:

```
docker build .
```

downloads the plovr-deps container from docker, adds Plovr source, and runs all the Plovr tests.

If you want to build `plovr-deps` yourself:

```
docker build -t nicks/plovr-deps -f Dockerfile.base .
```

### To Upgrade Closure Library

To upgrade one of Closure Library, go to the official repo and find the SHA digest
Expand Down
2 changes: 1 addition & 1 deletion tools/imports/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ genrule(
name = 'rev-plovr',
srcs = [],
out = 'rev-plovr.txt',
cmd = 'git rev-parse HEAD > $OUT')
cmd = 'git rev-parse HEAD > $OUT || echo "head" > $OUT')

java_library(
name = 'revs',
Expand Down

0 comments on commit 952e2b1

Please sign in to comment.