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

Commit 295eb2f

Browse files
authored
Merge pull request #157 from juanjux/feature/semantic
Semantic objects
2 parents 19ec088 + bfb5604 commit 295eb2f

File tree

335 files changed

+180528
-115972
lines changed

Some content is hidden

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

335 files changed

+180528
-115972
lines changed

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

0 commit comments

Comments
 (0)