Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,27 @@ do
GROUP_ID=50
fi
docker build -t avro-build-${USER_NAME} - <<UserSpecificDocker
FROM avro-build
FROM docker.io/surajacharya/avro-build-test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presumably this will be an image from the project before we start using this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Once there is a general consensus that the base image being used is good enough I intend to move it to a more central location (apache docker hub) and point it to that.

RUN groupadd -g ${GROUP_ID} ${USER_NAME} || true
RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME} || true
ENV HOME /home/${USER_NAME}
RUN apt-get update && apt-get install --no-install-recommends -y \
git subversion curl ant make maven \
gcc cmake libjansson-dev asciidoc source-highlight \
g++ flex bison libboost-all-dev doxygen \
mono-devel mono-gmcs nunit \
nodejs \
perl \
php5 phpunit php5-gmp bzip2 \
python python-setuptools python3-setuptools \
ruby ruby-dev rake \
libsnappy1 libsnappy-dev
UserSpecificDocker

docker build -t avro-build-test - <<UserSpecificDocker
FROM docker.io/surajacharya/avro-build-test
RUN apt-get install -y gem
RUN gem install ruby-lint rubocop
UserSpecificDocker
# By mapping the .m2 directory you can do an mvn install from
# within the container and use the result on your normal
Expand Down
27 changes: 1 addition & 26 deletions share/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
# Dockerfile for installing the necessary dependencies for building Avro.
# See BUILD.txt.

FROM java:7-jdk
FROM docker.io/surajacharya/avro-build-test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presumably this will be an image from the project before we start using this?


WORKDIR /root

# Add the repository for node.js 4.x
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash -

# Install dependencies from packages
RUN apt-get update && apt-get install --no-install-recommends -y \
Expand All @@ -36,26 +34,3 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
python python-setuptools python3-setuptools \
ruby ruby-dev rake \
libsnappy1 libsnappy-dev

# Install Forrest
RUN mkdir -p /usr/local/apache-forrest
RUN curl -O http://archive.apache.org/dist/forrest/0.8/apache-forrest-0.8.tar.gz
RUN tar xzf *forrest* --strip-components 1 -C /usr/local/apache-forrest
RUN echo 'forrest.home=/usr/local/apache-forrest' > build.properties
RUN chmod -R 0777 /usr/local/apache-forrest/build /usr/local/apache-forrest/main \
/usr/local/apache-forrest/plugins
ENV FORREST_HOME /usr/local/apache-forrest

# Install Perl modules
RUN curl -L http://cpanmin.us | perl - --self-upgrade # non-interactive cpan
RUN cpanm install Module::Install Module::Install::ReadmeFromPod \
Module::Install::Repository \
Math::BigInt JSON::XS Try::Tiny Regexp::Common Encode \
IO::String Object::Tiny Compress::Zlib Test::More \
Test::Exception Test::Pod

# Install Ruby modules
RUN gem install echoe yajl-ruby multi_json snappy

# Install global Node modules
RUN npm install -g grunt-cli
129 changes: 129 additions & 0 deletions share/pre_commit/build_plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRCMAKEIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_build_tool build
add_test_type buildtest

BUILDFILE="build.sh"
BUILD="./build.sh"


## @description get the name of the build filename
## @audience private
## @stability evolving
## @replaceable no
## @return make build file
function build_buildfile
{
echo "${BUILDFILE}"
}

## @description get the name of the build binary
## @audience private
## @stability evolving
## @replaceable no
## @return filename
## @param testname
function build_executor
{
echo "${BUILD}"
}

## @description build worker
## @audience private
## @stability evolving
## @replaceable no
## @return status
## @param repostatus
## @param test
function build_modules_worker
{
case "$2" in
'distclean')
modules_workers "dist clean"
;;
*)
echo "${BUILD}"
modules_workers $2
;;
esac
}

### @description build module queuer
### @audience private
### @stability evolving
### @replaceable no
function build_builtin_personality_modules
{
declare repostatus=$1
declare testtype=$2

declare module

yetus_debug "Using builtin personality_modules"
yetus_debug "Personality: ${repostatus} ${testtype}"

clear_personality_queue

for module in "${CHANGED_MODULES[@]}"; do
personality_enqueue_module "${module}"
done
}

### @description build test determiner
### @audience private
### @stability evolving
### @replaceable no
### @param filename
function build_builtin_personality_file_tests
{
declare filename=$1
yetus_debug "Using builtin build personality_file_tests"
add_test buildtest
}

function buildtest_filefilter
{
local filename=$1

if [[ ${BUILDTOOL} = build ]]; then
yetus_debug "run the tests ${filename}"
add_test buildtest
fi
}

function buildtest_postcompile
{
declare repostatus=$1
declare result=0
if [[ ${BUILDTOOL} != build ]]; then
return 0
fi
#
if [[ "${repostatus}" = branch ]]; then
big_console_header "build test : ${PATCH_BRANCH}"
else
big_console_header "build test : ${BUILDMODE}"
fi

modules_workers "test"
result=$?
modules_messages "${repostatus}" buildtest true
if [[ ${result} != 0 ]]; then
return 1
fi
return 0
}