Skip to content

Commit a9e5245

Browse files
authored
Merge pull request #38 from juanjux/feature/semantic
Semantic
2 parents f5706ed + 70e923c commit a9e5245

File tree

84 files changed

+393097
-254203
lines changed

Some content is hidden

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

84 files changed

+393097
-254203
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ build
44
native/.gradle
55
native/build
66
native/vendor
7+
vendor/
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.9
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 gopkg.in/bblfsh/sdk.v1/...
11-
- bblfsh-sdk prepare-build .
12-
- go get -v -t ./driver/...
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 integration-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: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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-get update && apt-get install -y make bash wget gradle
12+
13+
14+
ADD native /native
15+
WORKDIR /native
16+
17+
# build native driver
18+
RUN make
19+
RUN gradle shadowJar
20+
21+
22+
#================================
23+
# Stage 1.1: Native Driver Tests
24+
#================================
25+
FROM native as native_test
26+
# run native driver tests
27+
RUN gradle test --info --stacktrace
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/bash-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="bash"
57+
58+
WORKDIR /opt/driver
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/build/libs/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"]

0 commit comments

Comments
 (0)