build.sh 1.3 KB

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. # To setup cross build on a linux machine, do the following
  3. # 1. Install package arm-linux-gnu-gcc (yum) or gcc-arm-linux-gnueabihf (apt).
  4. # 2. Run `rustup target add armv7-unknown-linux-musleabihf`
  5. # 1. Add the following to ~/.cargo/config
  6. # [target.armv7-unknown-linux-musleabihf]
  7. # linker = "arm-linux-gnu-gcc"
  8. set -ex
  9. rsync -av /Users/ditsing/Code/ruaft ec2:~/compile/ --exclude 'ruaft/target' --exclude 'ruaft/.git' --exclude '.idea'
  10. ssh ec2 'cd ~/compile/ruaft/durio && cargo build --target=armv7-unknown-linux-musleabihf --release'
  11. mkdir -p /tmp/ruaft
  12. rsync -av 'ec2:~/compile/ruaft/target/armv7-unknown-linux-musleabihf/release/durio' '/tmp/ruaft/durio'
  13. ssh alice 'pkill -9 durio || echo nothing'
  14. rsync -av '/tmp/ruaft/durio' alice:/tmp/durio
  15. ssh alice '
  16. RUST_LOG=warp,tarpc=error,ruaft=debug,kvraft=debug,durio nohup /tmp/durio 1 1>>/tmp/durio.out 2>>/tmp/durio.err &
  17. '
  18. ssh bob 'pkill -9 durio || echo nothing'
  19. rsync -av '/tmp/ruaft/durio' bob:/tmp/durio
  20. ssh bob '
  21. RUST_LOG=warp,tarpc=error,ruaft=debug,kvraft=debug,durio nohup /tmp/durio 2 1>>/tmp/durio.out 2>>/tmp/durio.err &
  22. '
  23. RUST_LOG=warp,tarpc=error,ruaft=debug,kvraft=debug,durio cargo run 0 || echo "Done"
  24. ssh alice 'pkill -9 durio || echo nothing'
  25. ssh bob 'pkill -9 durio || echo nothing'