package.sh 826 B

123456789101112131415161718192021222324252627282930313233
  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/logs
  10. cp -rf $ROOT/insert-app/target/insert-app-0.0.1-SNAPSHOT.jar $ROOT/tmp/lib/
  11. cp -rf $ROOT/query-app/target/query-app-0.0.1-SNAPSHOT.jar $ROOT/tmp/lib/
  12. cp -rf $ROOT/probe/target/probe-0.0.1-SNAPSHOT-jar-with-dependencies.jar $ROOT/tmp/lib/
  13. cp -rf $ROOT/init/meta.db $ROOT/tmp/
  14. cp -rf $ROOT/tools $ROOT/tmp/
  15. cp -rf $ROOT/conf $ROOT/tmp/
  16. cp -rf $ROOT/shell $ROOT/tmp/
  17. chmod -R +x $ROOT/shell/
  18. cd $ROOT
  19. if [ ! -d "release" ]; then
  20. mkdir -p release
  21. fi
  22. mv $ROOT/tmp $ROOT/blackbox
  23. cd $ROOT
  24. tar -zcf $ROOT/release/blackbox-v${cur_date}.tar.gz ./blackbox
  25. rm -rf $ROOT/blackbox/*
  26. rmdir $ROOT/blackbox
  27. echo "打包成功"