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

Commit 2c053f6

Browse files
Denys Smirnovdennwc
Denys Smirnov
authored andcommitted
use the new build system
Signed-off-by: Denys Smirnov <[email protected]>
1 parent 43e7dfe commit 2c053f6

12 files changed

+1045
-21
lines changed

.travis.yml

+11-6
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

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Prerequisites:
2+
# dep ensure --vendor-only
3+
# bblfsh-sdk release
4+
5+
#==============================
6+
# Stage 1: Native Driver Build
7+
#==============================
8+
FROM node:8-alpine as native
9+
10+
ADD native /native
11+
WORKDIR /native
12+
13+
# build native driver
14+
RUN yarn && yarn build
15+
16+
17+
#================================
18+
# Stage 1.1: Native Driver Tests
19+
#================================
20+
FROM native as native_test
21+
# run native driver tests
22+
RUN yarn test
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/javascript-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 tests
39+
RUN go test -c -o /tmp/fixtures.test ./driver/fixtures/
40+
# build server binary
41+
RUN go build -o /tmp/driver ./driver/main.go
42+
43+
#=======================
44+
# Stage 3: Driver Build
45+
#=======================
46+
FROM node:8-alpine
47+
48+
LABEL maintainer="source{d}" \
49+
bblfsh.language="javascript"
50+
51+
WORKDIR /opt/driver
52+
53+
# copy driver manifest and static files
54+
ADD .manifest.release.toml ./etc/manifest.toml
55+
56+
# copy static files from driver source directory
57+
ADD ./native/native.sh ./bin/native
58+
59+
60+
# copy build artifacts for native driver
61+
COPY --from=native /native/lib/index.js ./bin/index.js
62+
COPY --from=native /native/node_modules ./bin/node_modules
63+
64+
65+
# copy tests binary
66+
COPY --from=driver /tmp/fixtures.test ./bin/
67+
# move stuff to make tests work
68+
RUN ln -s /opt/driver ../build
69+
VOLUME /opt/fixtures
70+
71+
# copy driver server binary
72+
COPY --from=driver /tmp/driver ./bin/
73+
74+
ENTRYPOINT ["/opt/driver/bin/driver"]

0 commit comments

Comments
 (0)