| #!/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. | |
| # */ | |
| set -e | |
| shopt -s dotglob | |
| DISTRIBUTEDLOG_ROOT=$(git rev-parse --show-toplevel) | |
| GITSHA=$(git rev-parse HEAD) | |
| # clean the dist | |
| find . -name lib | xargs rm -r | |
| rm -rf dist/* | |
| # create the layout | |
| for module in distributedlog-proxy-server distributedlog-benchmark distributedlog-tutorials/distributedlog-basic distributedlog-tutorials/distributedlog-messaging; do | |
| mkdir -p "dist/release/${module}"/{bin,conf,lib} | |
| done | |
| # build the package | |
| mvn clean install -Ptwitter-ostrich-provider -DskipTests | |
| # build the distributedlog-proxy-server | |
| cp -rf distributedlog-proxy-server/bin/* dist/release/distributedlog-proxy-server/bin | |
| cp -rf distributedlog-proxy-server/conf/* dist/release/distributedlog-proxy-server/conf | |
| cp -rf distributedlog-proxy-server/lib/* dist/release/distributedlog-proxy-server/lib | |
| cp -rf distributedlog-proxy-server/target/distributedlog-proxy-server-*.jar dist/release/distributedlog-proxy-server/lib | |
| cp -rf vagrant dist/release/ | |
| cp -rf scripts dist/release/ | |
| # build the distributedlog-benchmark | |
| cp -rf distributedlog-benchmark/bin/* dist/release/distributedlog-benchmark/bin | |
| cp -rf distributedlog-benchmark/conf/* dist/release/distributedlog-benchmark/conf | |
| cp -rf distributedlog-benchmark/lib/* dist/release/distributedlog-benchmark/lib | |
| cp -rf distributedlog-benchmark/target/distributedlog-benchmark-*.jar dist/release/distributedlog-benchmark/lib | |
| # build the distributedlog-tutorial/basic | |
| cp -rf distributedlog-tutorials/distributedlog-basic/bin/* dist/release/distributedlog-tutorials/distributedlog-basic/bin | |
| cp -rf distributedlog-tutorials/distributedlog-basic/conf/* dist/release/distributedlog-tutorials/distributedlog-basic/conf | |
| cp -rf distributedlog-tutorials/distributedlog-basic/lib/* dist/release/distributedlog-tutorials/distributedlog-basic/lib | |
| cp -rf distributedlog-tutorials/distributedlog-basic/target/distributedlog-basic-*.jar dist/release/distributedlog-tutorials/distributedlog-basic/lib | |
| # build the distributedlog-tutorial/messaging | |
| cp -rf distributedlog-tutorials/distributedlog-messaging/bin/* dist/release/distributedlog-tutorials/distributedlog-messaging/bin | |
| cp -rf distributedlog-tutorials/distributedlog-messaging/conf/* dist/release/distributedlog-tutorials/distributedlog-messaging/conf | |
| cp -rf distributedlog-tutorials/distributedlog-messaging/lib/* dist/release/distributedlog-tutorials/distributedlog-messaging/lib | |
| cp -rf distributedlog-tutorials/distributedlog-messaging/target/distributedlog-messaging-*.jar dist/release/distributedlog-tutorials/distributedlog-messaging/lib | |
| # release | |
| cd dist/release | |
| zip -r "distributedlog-all-${GITSHA}.zip" distributedlog-proxy-server distributedlog-benchmark distributedlog-tutorials > /dev/null | |
| zip -r "distributedlog-proxy-server-${GITSHA}.zip" distributedlog-proxy-server >/dev/null | |
| zip -r "distributedlog-benchmark-${GITSHA}.zip" distributedlog-benchmark >/dev/null | |
| zip -r "distributedlog-tutorials-${GITSHA}.zip" distributedlog-tutorials >/dev/null |