package.sh 917 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. cur_date="`date +%Y-%m-%d`"
  3. ROOT=$(cd `dirname $0`; pwd)
  4. mkdir -p $ROOT/tmp
  5. rm -rf $ROOT/tmp/*
  6. mkdir -p $ROOT/tmp/lib
  7. mkdir -p $ROOT/tmp/pid
  8. mkdir -p $ROOT/tmp/data
  9. mkdir -p $ROOT/tmp/data/wal
  10. mkdir -p $ROOT/tmp/logs
  11. cp -rf $ROOT/insert-app/target/insert-app-0.0.1-SNAPSHOT.jar $ROOT/tmp/lib/
  12. cp -rf $ROOT/query-app/target/query-app-0.0.1-SNAPSHOT.jar $ROOT/tmp/lib/
  13. cp -rf $ROOT/probe/target/probe-0.0.1-SNAPSHOT-jar-with-dependencies.jar $ROOT/tmp/lib/
  14. cp -rf $ROOT/init/meta.db $ROOT/tmp/
  15. cp -rf $ROOT/init $ROOT/tmp/
  16. cp -rf $ROOT/tools $ROOT/tmp/
  17. rm -rf $ROOT/tmp/tools/localDebug
  18. cp -rf $ROOT/conf $ROOT/tmp/
  19. cp -rf $ROOT/shell $ROOT/tmp/
  20. chmod -R +x $ROOT/shell/
  21. cd $ROOT
  22. if [ ! -d "release" ]; then
  23. mkdir -p release
  24. fi
  25. mv $ROOT/tmp $ROOT/blackbox
  26. cd $ROOT
  27. tar -zcf $ROOT/release/blackbox-v${cur_date}.tar.gz ./blackbox
  28. rm -rf $ROOT/blackbox/*
  29. rmdir $ROOT/blackbox
  30. echo "打包成功"