From 4dbf3dc7303b379b742fc9dd5c5d3b742297a085 Mon Sep 17 00:00:00 2001 From: sacharya Date: Mon, 10 Oct 2016 16:56:40 -0500 Subject: [PATCH 1/3] AVRO-1887 Setup precommit checks via Apache Yetus Signed-off-by: sacharya --- share/pre_commit/build_plugin.sh | 129 +++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 share/pre_commit/build_plugin.sh diff --git a/share/pre_commit/build_plugin.sh b/share/pre_commit/build_plugin.sh new file mode 100644 index 00000000000..a2e934f28eb --- /dev/null +++ b/share/pre_commit/build_plugin.sh @@ -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 +} From 5cedf25884649cf26a93bfd296bf2e5b867ac87b Mon Sep 17 00:00:00 2001 From: sacharya Date: Sun, 5 Feb 2017 18:28:04 -0600 Subject: [PATCH 2/3] Update Docket to read from the new docker image --- build.sh | 21 +++++++++++++++++++-- share/docker/Dockerfile | 21 +-------------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/build.sh b/build.sh index 255e46af78c..7e3d6011da2 100755 --- a/build.sh +++ b/build.sh @@ -208,10 +208,27 @@ do GROUP_ID=50 fi docker build -t avro-build-${USER_NAME} - < 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 From a12ce6ace51b53fe876a7d4a592c577bed7447c8 Mon Sep 17 00:00:00 2001 From: sacharya Date: Sun, 5 Feb 2017 18:41:57 -0600 Subject: [PATCH 3/3] removing unwanted installs --- share/docker/Dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/share/docker/Dockerfile b/share/docker/Dockerfile index 3c2ac596f96..1b39f0bad57 100644 --- a/share/docker/Dockerfile +++ b/share/docker/Dockerfile @@ -34,9 +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 Ruby modules -RUN gem install echoe yajl-ruby multi_json snappy - -# Install global Node modules -RUN npm install -g grunt-cli