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

Commit e7a25c8

Browse files
authored
Merge pull request #5 from juanjux/alpha
Alpha
2 parents 6186671 + d9feeda commit e7a25c8

File tree

297 files changed

+171486
-532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+171486
-532
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ target
55
.m2
66
native/.idea/*
77
native/src/main/java/tech/sourced/babelfish/j2cpp/*
8+
fixtures/*_got

.travis.yml

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

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

66
services:
77
- docker
88

9+
env:
10+
- BBLFSHD_VERSION=v2.6.1
11+
912
before_script:
10-
- go get -v github.com/bblfsh/sdk/...
11-
- bblfsh-sdk prepare-build .
12-
- go get -v -t ./...
13+
- curl -L https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 > $GOPATH/bin/dep
14+
- chmod +x $GOPATH/bin/dep
15+
- dep ensure --vendor-only
16+
- go get ./vendor/gopkg.in/bblfsh/sdk.v2/cmd/...
17+
- go install ./vendor/gopkg.in/bblfsh/sdk.v2/cmd/...
18+
- docker pull bblfsh/bblfshd:$BBLFSHD_VERSION
1319

1420
script:
15-
- make test
21+
- bblfsh-sdk update --dry-run
22+
- bblfsh-sdk build ci-build
23+
- bblfsh-sdk test --bblfshd $BBLFSHD_VERSION ci-build
1624

1725
after_success:
18-
- make push
26+
- bblfsh-sdk push ci-build

Dockerfile

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,80 @@
1-
FROM alpine:3.5
1+
# Prerequisites:
2+
# dep ensure --vendor-only
3+
# bblfsh-sdk release
24

3-
ARG RUNTIME_NATIVE_VERSION
4-
ENV RUNTIME_NATIVE_VERSION $RUNTIME_NATIVE_VERSION
5+
#==============================
6+
# Stage 1: Native Driver Build
7+
#==============================
8+
FROM openjdk:8-slim as native
59

6-
RUN apk add --no-cache openjdk8-jre="$RUNTIME_NATIVE_VERSION"
10+
# install build dependencies
11+
RUN apt update && apt install -y maven
712

8-
ADD build /opt/driver/bin
9-
CMD /opt/driver/bin/driver
13+
14+
ADD native /native
15+
WORKDIR /native
16+
17+
# build native driver
18+
RUN mvn install:install-file -Dfile=lib/org.eclipse.cdt.core_6.5.0.201807181141.jar -DgroupId=org.eclipse.cdt.core -DartifactId=cdtcore -Dversion=6.5.0 -Dpackaging=jar
19+
RUN mvn package
20+
21+
22+
#================================
23+
# Stage 1.1: Native Driver Tests
24+
#================================
25+
FROM native as native_test
26+
# run native driver tests
27+
RUN mvn test
28+
29+
30+
#=================================
31+
# Stage 2: Go Driver Server Build
32+
#=================================
33+
FROM golang:1.10-alpine as driver
34+
35+
ENV DRIVER_REPO=github.com/bblfsh/cpp-driver
36+
ENV DRIVER_REPO_PATH=/go/src/$DRIVER_REPO
37+
38+
ADD vendor $DRIVER_REPO_PATH/vendor
39+
ADD driver $DRIVER_REPO_PATH/driver
40+
41+
WORKDIR $DRIVER_REPO_PATH/
42+
43+
# build server binary
44+
RUN go build -o /tmp/driver ./driver/main.go
45+
# build tests
46+
RUN go test -c -o /tmp/fixtures.test ./driver/fixtures/
47+
48+
#=======================
49+
# Stage 3: Driver Build
50+
#=======================
51+
FROM openjdk:8-jre-alpine
52+
53+
54+
55+
LABEL maintainer="source{d}" \
56+
bblfsh.language="cpp"
57+
58+
WORKDIR /opt/driver
59+
60+
# copy static files from driver source directory
61+
ADD ./native/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 driver server binary
69+
COPY --from=driver /tmp/driver ./bin/
70+
71+
# copy tests binary
72+
COPY --from=driver /tmp/fixtures.test ./bin/
73+
# move stuff to make tests work
74+
RUN ln -s /opt/driver ../build
75+
VOLUME /opt/fixtures
76+
77+
# copy driver manifest and static files
78+
ADD .manifest.release.toml ./etc/manifest.toml
79+
80+
ENTRYPOINT ["/opt/driver/bin/driver"]

Dockerfile.build

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)