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 # This script generates the build info for spark and places it into the spark-version-info.properties file.
0021 # Arguments:
0022 #   build_tgt_directory - The target directory where properties file would be created. [./core/target/extra-resources]
0023 #   spark_version - The current version of spark
0024 
0025 RESOURCE_DIR="$1"
0026 mkdir -p "$RESOURCE_DIR"
0027 SPARK_BUILD_INFO="${RESOURCE_DIR}"/spark-version-info.properties
0028 
0029 echo_build_properties() {
0030   echo version=$1
0031   echo user=$USER
0032   echo revision=$(git rev-parse HEAD)
0033   echo branch=$(git rev-parse --abbrev-ref HEAD)
0034   echo date=$(date -u +%Y-%m-%dT%H:%M:%SZ)
0035   echo url=$(git config --get remote.origin.url)
0036 }
0037 
0038 echo_build_properties $2 > "$SPARK_BUILD_INFO"