Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 0195a7c

Browse files
Denys Smirnovdennwc
authored andcommitted
use the new build system
Signed-off-by: Denys Smirnov <denys@sourced.tech>
1 parent 913b7d1 commit 0195a7c

12 files changed

Lines changed: 649 additions & 24 deletions

.travis.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
language: go
22

33
go:
4-
- 1.9
4+
- '1.10'
55

66
services:
77
- docker
88

99
before_script:
10-
- go get -v gopkg.in/bblfsh/sdk.v2/...
11-
- bblfsh-sdk prepare-build .
12-
- go get -v -t ./driver/...
10+
- curl -L https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 > $GOPATH/bin/dep
11+
- chmod +x $GOPATH/bin/dep
12+
- dep ensure --vendor-only
13+
- go get ./vendor/gopkg.in/bblfsh/sdk.v2/cmd/...
14+
- go install ./vendor/gopkg.in/bblfsh/sdk.v2/cmd/...
15+
- docker pull bblfsh/bblfshd
1316

1417
script:
15-
- make test integration-test
18+
- bblfsh-sdk update --dry-run
19+
- bblfsh-sdk build ci-build
20+
- bblfsh-sdk test ci-build
1621

1722
after_success:
18-
- make push
23+
- bblfsh-sdk push ci-build

Dockerfile

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Prerequisites:
2+
# dep ensure --vendor-only
3+
# bblfsh-sdk release
4+
5+
#==============================
6+
# Stage 1: Native Driver Build
7+
#==============================
8+
FROM openjdk:8-slim as native
9+
10+
# install build dependencies
11+
RUN apt update && apt install -y maven
12+
13+
14+
ADD native /native
15+
WORKDIR /native
16+
17+
# build native driver
18+
RUN mvn package
19+
20+
21+
#================================
22+
# Stage 1.1: Native Driver Tests
23+
#================================
24+
FROM native as native_test
25+
# run native driver tests
26+
RUN mvn test
27+
28+
29+
#=================================
30+
# Stage 2: Go Driver Server Build
31+
#=================================
32+
FROM golang:1.10-alpine as driver
33+
34+
ENV DRIVER_REPO=github.com/bblfsh/java-driver
35+
ENV DRIVER_REPO_PATH=/go/src/$DRIVER_REPO
36+
37+
ADD vendor $DRIVER_REPO_PATH/vendor
38+
ADD driver $DRIVER_REPO_PATH/driver
39+
40+
WORKDIR $DRIVER_REPO_PATH/
41+
42+
# build tests
43+
RUN go test -c -o /tmp/fixtures.test ./driver/fixtures/
44+
# build server binary
45+
RUN go build -o /tmp/driver ./driver/main.go
46+
47+
#=======================
48+
# Stage 3: Driver Build
49+
#=======================
50+
FROM openjdk:8-jre-alpine
51+
52+
LABEL maintainer="source{d}" \
53+
bblfsh.language="java"
54+
55+
WORKDIR /opt/driver
56+
57+
# copy driver manifest and static files
58+
ADD .manifest.release.toml ./etc/manifest.toml
59+
60+
# copy static files from driver source directory
61+
ADD ./native/src/main/sh/native.sh ./bin/native
62+
63+
64+
# copy build artifacts for native driver
65+
COPY --from=native /native/target/native-jar-with-dependencies.jar ./bin/
66+
67+
68+
# copy tests binary
69+
COPY --from=driver /tmp/fixtures.test ./bin/
70+
# move stuff to make tests work
71+
RUN ln -s /opt/driver ../build
72+
VOLUME /opt/fixtures
73+
74+
# copy driver server binary
75+
COPY --from=driver /tmp/driver ./bin/
76+
77+
ENTRYPOINT ["/opt/driver/bin/driver"]

0 commit comments

Comments
 (0)