2018-09-24 17:10:11 +00:00
#!/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 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# project.build.directory
BASEDIR=$1
#hdds.version
HDDS_VERSION=$2
## @audience private
## @stability evolving
function run()
{
declare res
echo "\$ ${*}"
"${@}"
res=$?
if [[ ${res} != 0 ]]; then
echo
echo "Failed!"
echo
exit "${res}"
fi
}
## @audience private
## @stability evolving
function findfileindir()
{
declare file="$1"
declare dir="${2:-./share}"
declare count
count=$(find "${dir}" -iname "${file}" | wc -l)
#shellcheck disable=SC2086
echo ${count}
}
# shellcheck disable=SC2164
ROOT=$(cd "${BASEDIR}"/../../..;pwd)
echo
echo "Current directory $(pwd)"
echo
run rm -rf "ozone-${HDDS_VERSION}"
run mkdir "ozone-${HDDS_VERSION}"
run cd "ozone-${HDDS_VERSION}"
2019-07-09 03:43:18 +00:00
# Concatenate root LICENSE.txt with Recon LICENSE
run cat "${ROOT}/LICENSE.txt" "${ROOT}/hadoop-ozone/ozone-recon/src/main/resources/webapps/recon/ozone-recon-web/LICENSE" >> ./LICENSE.txt
2018-09-24 17:10:11 +00:00
run cp -p "${ROOT}/NOTICE.txt" .
run cp -p "${ROOT}/README.txt" .
run mkdir -p ./share/hadoop/mapreduce
run mkdir -p ./share/hadoop/ozone
run mkdir -p ./share/hadoop/hdds
run mkdir -p ./share/hadoop/yarn
run mkdir -p ./share/hadoop/hdfs
run mkdir -p ./share/hadoop/common
2018-12-11 15:16:00 +00:00
touch ./share/hadoop/mapreduce/.keep
touch ./share/hadoop/yarn/.keep
touch ./share/hadoop/hdfs/.keep
touch ./share/hadoop/common/.keep
2018-09-24 17:10:11 +00:00
run mkdir -p ./share/ozone/web
run mkdir -p ./bin
run mkdir -p ./sbin
run mkdir -p ./etc
run mkdir -p ./libexec
2019-06-06 09:53:18 +00:00
run mkdir -p ./tests
2018-09-24 17:10:11 +00:00
run cp -r "${ROOT}/hadoop-common-project/hadoop-common/src/main/conf" "etc/hadoop"
2018-10-29 16:35:18 +00:00
run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/om-audit-log4j2.properties" "etc/hadoop"
2018-11-16 22:59:59 +00:00
run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/dn-audit-log4j2.properties" "etc/hadoop"
2018-12-17 23:40:22 +00:00
run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/scm-audit-log4j2.properties" "etc/hadoop"
2018-10-29 16:35:18 +00:00
run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/ozone-site.xml" "etc/hadoop"
run cp -f "${ROOT}/hadoop-ozone/dist/src/main/conf/log4j.properties" "etc/hadoop"
2019-03-17 09:07:57 +00:00
run cp "${ROOT}/hadoop-hdds/common/src/main/resources/network-topology-default.xml" "etc/hadoop"
run cp "${ROOT}/hadoop-hdds/common/src/main/resources/network-topology-nodegroup.xml" "etc/hadoop"
2018-09-24 17:10:11 +00:00
run cp "${ROOT}/hadoop-common-project/hadoop-common/src/main/bin/hadoop" "bin/"
run cp "${ROOT}/hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd" "bin/"
run cp "${ROOT}/hadoop-ozone/common/src/main/bin/ozone" "bin/"
2019-07-02 16:54:43 +00:00
run cp -r "${ROOT}/hadoop-ozone/dist/src/main/dockerbin" "bin/docker"
2018-09-24 17:10:11 +00:00
run cp "${ROOT}/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.sh" "libexec/"
run cp "${ROOT}/hadoop-common-project/hadoop-common/src/main/bin/hadoop-config.cmd" "libexec/"
run cp "${ROOT}/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh" "libexec/"
run cp "${ROOT}/hadoop-ozone/common/src/main/bin/ozone-config.sh" "libexec/"
run cp -r "${ROOT}/hadoop-ozone/common/src/main/shellprofile.d" "libexec/"
run cp "${ROOT}/hadoop-common-project/hadoop-common/src/main/bin/hadoop-daemons.sh" "sbin/"
run cp "${ROOT}/hadoop-common-project/hadoop-common/src/main/bin/workers.sh" "sbin/"
run cp "${ROOT}/hadoop-ozone/common/src/main/bin/start-ozone.sh" "sbin/"
run cp "${ROOT}/hadoop-ozone/common/src/main/bin/stop-ozone.sh" "sbin/"
2019-06-06 09:53:18 +00:00
# fault injection tests
run cp -r "${ROOT}/hadoop-ozone/fault-injection-test/network-tests/src/test/blockade" tests
2018-09-24 17:10:11 +00:00
#shaded datanode service
run mkdir -p "./share/hadoop/ozoneplugin"
run cp "${ROOT}/hadoop-ozone/objectstore-service/target/hadoop-ozone-objectstore-service-${HDDS_VERSION}-plugin.jar" "./share/hadoop/ozoneplugin/hadoop-ozone-datanode-plugin-${HDDS_VERSION}.jar"
# Optional documentation, could be missing
2018-11-12 23:21:31 +00:00
cp -r "${ROOT}/hadoop-hdds/docs/target/classes/docs" ./
2018-09-24 17:10:11 +00:00
#Copy docker compose files
2019-04-05 16:05:59 +00:00
#compose files are preprocessed: properties (eg. project.version) are replaced first by maven.
run cp -p -R "${ROOT}/hadoop-ozone/dist/target/compose" .
2018-09-24 17:10:11 +00:00
run cp -p -r "${ROOT}/hadoop-ozone/dist/src/main/smoketest" .
2019-05-02 09:10:06 +00:00
run cp -p -r "${ROOT}/hadoop-ozone/dist/target/k8s" kubernetes
2019-07-02 16:54:43 +00:00
run cp -p -r "${ROOT}/hadoop-ozone/dist/target/Dockerfile" .
2019-05-07 15:48:10 +00:00
#workaround for https://issues.apache.org/jira/browse/MRESOURCES-236
find ./compose -name "*.sh" -exec chmod 755 {} \;