setup.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. set -e
  3. if [[ "$OSTYPE" == "linux-gnu" ]]; then
  4. # code build tools
  5. sudo apt-get update
  6. sudo apt-get install -y coreutils clang llvm jq curl gcc xz-utils sudo pkg-config unzip libc6-dev make libssl-dev python
  7. # docker
  8. sudo apt-get install -y docker.io docker-compose containerd runc
  9. elif [[ "$OSTYPE" == "darwin"* ]]; then
  10. # install brew package manager
  11. if ! which brew >/dev/null 2>&1; then
  12. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  13. fi
  14. # install additional packages
  15. brew update
  16. brew install coreutils gnu-tar jq curl
  17. echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
  18. fi
  19. # If OS is supported will install build tools for rust and substrate.
  20. # Skips installation of substrate and subkey
  21. curl https://getsubstrate.io -sSf | bash -s -- --fast
  22. source ~/.cargo/env
  23. rustup install nightly-2021-03-24
  24. rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
  25. rustup default nightly-2021-03-24
  26. rustup component add rustfmt clippy
  27. # Volta nodejs, npm, yarn tools manager
  28. curl https://get.volta.sh | bash
  29. # source env variables added by Volta
  30. source ~/.bash_profile || source ~/.profile || source ~/.bashrc || :
  31. volta install node@14
  32. volta install yarn
  33. volta install npx
  34. echo "You may need to open a new terminal/shell session to make newly installed tools available."