Skip to content

Commit

Permalink
Docker changes for building 32bit
Browse files Browse the repository at this point in the history
  • Loading branch information
smac89 committed Jun 25, 2019
1 parent ade941a commit 24e6cb3
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/.git
src/
99 changes: 99 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
language: java

git:
depth: false

matrix:
fast_finish: true
include:
- os: linux
dist: xenial
compiler: clang-8
jdk: openjdk8
env:
- ARCH_DIST=linux64
- CC=clang-8
- CXX=clang++-8
addons:
apt:
update: true
sources:
- llvm-toolchain-xenial-8 # https://docs.travis-ci.com/user/installing-dependencies/#adding-apt-sources
packages:
- ninja-build
- cmake
- clang-8
- build-essential
- libgtk2.0-dev

- os: osx
osx_image: xcode10.2
compiler: clang
env: ARCH_DIST=macosx64
addons:
homebrew:
packages:
- ninja
- ant
- pyenv
taps: AdoptOpenJDK/openjdk
casks: adoptopenjdk8-openj9
- os: linux
services: docker
env:
- ARCH_DIST=linux32
- CC=gcc
- CXX=g++
install:
- docker build --rm --tag travis-build .
- |
docker run --volume $PWD:$TRAVIS_BUILD_DIR --workdir $TRAVIS_BUILD_DIR \
--env ARCH_DIST --env CC --env CXX --env TRAVIS_OS_NAME \
--name travis-build --detach --tty --interactive travis-build
# see https://github.com/travis-ci/travis-ci/issues/8408
before_install:
- unset _JAVA_OPTIONS

before_script:
- export JCEF_DIR="$PWD/src"
- source ./prepare-build.sh

script:
- |
if [ $ARCH_DIST == 'linux32' ]; then
docker exec -e JCEF_DIR travis-build './build.sh'
else
./build.sh
fi
before_deploy:
- cd ./packaging && ../prepare-deploy.sh $JCEF_DIR/binary_distrib

after_deploy:
- cd ../

# for encryption, see https://docs.travis-ci.com/user/encryption-keys/
deploy:
- provider: releases
skip_cleanup: true
api_key: $GITHUB_RELEASE_TOKEN_PRIVATE
file_glob: true
file: build/distributions/*
on:
tags: true
repo: smac89/java-cef-build
- provider: pages
skip_cleanup: true
keep_history: true
committer_from_gh: true
github_token: $GITHUB_TOKEN_PRIVATE
local_dir: packaging/build/install/java-cef-build-docs
on:
tags: true
repo: smac89/java-cef-build
condition: $ARCH_DIST == 'linux64'

env:
global:
- secure: "WRaDo3ndQOR5ATmjE9+EDlYnIsanPB6ItvaRbahMt2WlzLYKIBMY+ASmNVoAABykOpBkoNeKS4cIEnNueCxHU0LNfZyMvTDkuRm0s0wovyKXaEwAgRgnP6xCmnZ6V8VjTWNSl43tTcF++5S3Yx+lJdLzKWx2v/hbN1/Vb7LK6guLGLvyKlg2n2N76v/3rK2C9w5haMIrDAqCPHNnxpVYPxR2Rzqs0OmkH3GFu7YUVdfQ48RWdivKIu8NPUzDZMI3IvwFm/Ba6Sdk8y0i/z21IlBMbPQwN2vQzM9kelvO3+ZLx46DaO2s1oGXvz7T2YDzsZxQz97PMms7DyMo4t6ejF9C6feQutCOuybOAWEPkxSVXQe9XvP4jQbn1JVfjK2evqFUU3OWIxiwJJYbT/QZ7Pdmp/4GqknPzCtHihE2pawzQn/B3B9mksz6/c28UoeWy2XFQ3RnipLDTBvaJo7NQm6RngbrWhFSQRHFVQqqzw3jR4LvJFX8L6+R5bueJiXExE408hu2UUXmxskQJAWmDaFsiB2QZLaILFXx9l/bUhi5pQGL4t2jp+fVSE8u3fwev16cH0kMpnr0JhN4/hA9Cviq+V8yfVs0bbjke6dCAIMxEUOl8OolJ/N2am4sekLSwITy4QUaaS4BEqkuqLne+rAEDtKER5rR6H3BhrQzDk4="
23 changes: 6 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
FROM i386/alpine

WORKDIR /src/app/jcef

# Copy everything from the context into the
# current directory of the container
COPY . .

# Upgrade all packages
RUN apk update && apk upgrade

# Install build tools
RUN apk add bash build-base && \
RUN apk add bash build-base git && \
apk add openjdk8 && \
apk add python2 && \
apk add ninja && \
apk add cmake

# # Before script
# RUN git clone https://github.com/chromiumembedded/java-cef.git src && \
# ./apply-patches.sh ./src && \
# source setup-jdk.sh
#
# # script
# RUN ./build.sh src



# Add java bin to the path
RUN export PATH="/usr/lib/jvm/java-1.8-openjdk/bin/:$PATH"

ENV JAVA_HOME '/usr/lib/jvm/java-1.8-openjdk'

CMD ["/bin/bash"]

# ENV BUILD_PACKAGES bash git openssh curl-dev ruby-dev build-base
# ENV RUBY_PACKAGES ruby ruby-io-console
Expand Down
12 changes: 3 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#!/bin/bash
#!/bin/bash +x

# $1 is the jcef repo
if [ -z $1 ]; then
echo "USAGE: $0 <jcef_repo_path>"
exit 1
fi

mkdir -p $1/jcef_build
cd $1/jcef_build
mkdir -p $JCEF_DIR/jcef_build
cd $JCEF_DIR/jcef_build

# Generate build script with cmake
if [[ "${TRAVIS_OS_NAME}" == 'osx' ]]; then
Expand Down
7 changes: 7 additions & 0 deletions prepare-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
git clone https://github.com/chromiumembedded/java-cef.git $JCEF_DIR
./apply-patches.sh $JCEF_DIR

# jdk stuff taken care of in docker image
if [ $ARCH_DIST != 'linux32' ]; then
source ./setup-jdk.sh
fi
6 changes: 4 additions & 2 deletions setup-deploy.sh → prepare-deploy.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

# Build the jars and native libraries
./gradlew -DBIN_ARTIFACT="$1" --info --no-daemon jcef
./gradlew -DBIN_ARTIFACT="$1" --info jcef

# Only build the pages if this is linux64
if [[ $ARCH_DIST == 'linux64' ]]; then
./gradlew -DBIN_ARTIFACT="$1" --info --no-daemon installDocsDist
./gradlew -DBIN_ARTIFACT="$1" --info installDocsDist
fi

0 comments on commit 24e6cb3

Please sign in to comment.