Last active
May 21, 2019 13:49
-
-
Save dmytrostriletskyi/c02b5b3a5f0e0a0a22abb2d35d6a8f20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common make -y && \ | |
sudo sh -c "echo 'LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8' >> /etc/environment" && \ | |
echo "REMME_CORE_RELEASE=$2" >> ~/.bashrc && \ | |
echo "NODE_IP_ADDRESS=$1" >> ~/.bashrc && \ | |
cd /home/ && curl -L https://github.com/Remmeauth/remme-core/archive/v$2.tar.gz | sudo tar zx && \ | |
cd remme-core-$2 && \ | |
sudo -i sed -i "s@80@3333@" /home/remme-core-$2/docker/compose/admin.yml && \ | |
sudo -i sed -i "[email protected]@$1@" /home/remme-core-$2/config/network-config.env && \ | |
sudo -i sed -i '/ - GF_USERS_ALLOW_SIGN_UP=false/a \ - GF_SERVER_ROOT_URL=%(protocol)s:\/\/%(domain)s:\/monitoring\/' /home/remme-core-$2/docker/compose/mon.yml && \ | |
sudo apt update && sudo apt upgrade -y && \ | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add && \ | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \ | |
sudo apt-get update && sudo apt-get install docker-ce -y && \ | |
sudo apt update && sudo apt install nginx -y && \ | |
curl https://gist.githubusercontent.com/dmytrostriletskyi/70dda8c594e60be1e089586f2ee8c0a0/raw/d453465e337cf5052a94b1d961f8a82c392ecf21/http-nginx.conf| sudo tee /etc/nginx/nginx.conf > /dev/null && \ | |
sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" && \ | |
sudo chmod +x /usr/local/bin/docker-compose && \ | |
curl https://gist.githubusercontent.com/dmytrostriletskyi/9f525241acfc46799c65d5f010c43b5f/raw/3147860240613e7e2eab5e288d48a975934a260a/up-node-after-server-restart.sh > ~/up-node-after-server-restart.sh && \ | |
chmod +x ~/up-node-after-server-restart.sh && \ | |
curl https://gist.githubusercontent.com/dmytrostriletskyi/ddb0d8fc16512523f4942a2d60b57c63/raw/63de05cc7f68801bb6887fc07463422810276a10/upgrade-node.sh > ~/upgrade-node.sh && \ | |
chmod +x ~/upgrade-node.sh && \ | |
echo "@reboot $USER ~/./up-node-after-server-restart.sh $2" | sudo tee -a /etc/crontab > /dev/null && \ | |
curl https://gist.githubusercontent.com/dmytrostriletskyi/8c07b752f8efd52d6f69feddd62e3af9/raw/438a72324fe8bfcaf9f56a4023eeaa1fa18ddb9a/seeds-list.txt | sudo tee config/seeds-list.txt > /dev/null && \ | |
sudo systemctl restart nginx | |
sed -i -e "s/^ hostname: remme.validator/ hostname: $1/" /home/remme-core-$2/docker/compose/base.yml && \ | |
cat >> /home/remme-core-$2/config/sawtooth-validator-config.toml <<EOF | |
opentsdb_url = "http://18.196.152.173:8086" | |
opentsdb_db = "metrics" | |
opentsdb_username = "remme" | |
opentsdb_password = "3R0Of9%jT&9gB*fjoKGhpzkYnJVC8" | |
EOF | |
sudo make run_bg_user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment