Back to home page

OSCL-LXR

 
 

    


0001 #!/usr/bin/env bash
0002 
0003 #
0004 # Licensed to the Apache Software Foundation (ASF) under one or more
0005 # contributor license agreements.  See the NOTICE file distributed with
0006 # this work for additional information regarding copyright ownership.
0007 # The ASF licenses this file to You under the Apache License, Version 2.0
0008 # (the "License"); you may not use this file except in compliance with
0009 # the License.  You may obtain a copy of the License at
0010 #
0011 #    http://www.apache.org/licenses/LICENSE-2.0
0012 #
0013 # Unless required by applicable law or agreed to in writing, software
0014 # distributed under the License is distributed on an "AS IS" BASIS,
0015 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0016 # See the License for the specific language governing permissions and
0017 # limitations under the License.
0018 #
0019 
0020 SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive"}
0021 
0022 # NOTE: echo "q" is needed because SBT prompts the user for input on encountering a build file
0023 # with failure (either resolution or compilation); the "q" makes SBT quit.
0024 ERRORS=$(echo -e "q\n" \
0025     | build/sbt \
0026         ${SPARK_PROFILES} \
0027         -Pdocker-integration-tests \
0028         -Pkubernetes-integration-tests \
0029         scalastyle test:scalastyle \
0030     | awk '{if($1~/error/)print}' \
0031 )
0032 
0033 if test ! -z "$ERRORS"; then
0034     echo -e "Scalastyle checks failed at following occurrences:\n$ERRORS"
0035     exit 1
0036 else
0037     echo -e "Scalastyle checks passed."
0038 fi