Skip to content

Commit 90cb5cc

Browse files
authored
Merge pull request #2 from kwonoj/feat-protobuf-31
feat(protobuf): enable matrix for protobuf 3.1
2 parents 58ecb3d + 91ae7fc commit 90cb5cc

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

.travis.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ sudo: required
44
services:
55
- docker
66

7+
env:
8+
global:
9+
- DOCKER_REPO='ojkwon/arch-emscripten'
10+
matrix:
11+
- BUILD_TARGET='base'
12+
- BUILD_TARGET='protobuf'
13+
714
matrix:
815
# let whole build fails if one of matrix build config fails
916
fast_finish: true
1017

11-
include:
12-
- env:
13-
- DOCKER_REPO='ojkwon/arch-emscripten'
14-
1518
script:
1619
- COMMIT=${TRAVIS_COMMIT::8}
1720
# set docker tag based on last commit short sha.
18-
- DOCKER_TAG=$DOCKER_REPO:${COMMIT}
21+
- DOCKER_TAG=$DOCKER_REPO:${COMMIT}-$BUILD_TARGET
1922
- tput setaf 2; echo building docker image tagged as $DOCKER_TAG
20-
- sudo docker build --tag $DOCKER_TAG .
23+
- sudo docker build --tag $DOCKER_TAG --build-arg BUILD_TARGET=$BUILD_TARGET .
2124
- |
2225
if [[ ! -z "${TRAVIS_TAG}" ]]; then
2326
tput setaf 2; echo this build is tagged versioned build, pushing into registry

Dockerfile

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
FROM ojkwon/arch-nvm-node:4032238-node7.9-npm4
22
MAINTAINER OJ Kwon <[email protected]>
33

4+
# Build time args
5+
ARG BUILD_TARGET=""
6+
47
# Install dependencies
58
RUN pacman --noconfirm -Syu \
69
emscripten \
7-
python \
810
unzip \
11+
python \
912
python-setuptools \
1013
python2-setuptools \
1114
jre8-openjdk
@@ -15,4 +18,24 @@ SHELL ["/bin/bash", "-l", "-c"]
1518

1619
# Initialize emcc
1720
RUN emcc
21+
22+
USER builder
23+
24+
# Install 3.1 version of protobuf via makepkg instead of latest, to align with
25+
# protobuf-emscripten. Also build emscripten-protobuf as well, place build under
26+
# /home/builder/temp/.libs
27+
RUN if [[ "${BUILD_TARGET}" == "protobuf" ]]; then \
28+
echo "installing protobuf 3.1 dependency" && \
29+
mkdir $TMPDIR/proto31 && cd $TMPDIR/proto31 && \
30+
curl "https://git.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/protobuf&id=fa8b9da391b26b6ace1941e9871a6416db74d67b" > ./PKGBUILD && \
31+
makepkg && sudo pacman --noconfirm -U *.pkg.tar.xz && \
32+
cd $TMPDIR && git clone https://github.com/kwonoj/protobuf-emscripten && \
33+
cd $TMPDIR/protobuf-emscripten/3.1.0 && \
34+
sh autogen.sh && emconfigure ./configure && emmake make && \
35+
cp -r ./src/.libs $TMPDIR/ && \
36+
ls $TMPDIR/.libs; \
37+
fi
38+
39+
USER root
40+
1841
CMD emcc --version

0 commit comments

Comments
 (0)