I typically record my steps when deploying systems, and I often will duplicate the server during its initial testing. For example, if I get a little too far in the weeds while I'm testing, I simply prefer to scratch the server after I get success. So easily enough I can get back to that point minus the extra steps I previously took that were unnecessary. I can't sleep right if I feel like I have unnecessary dependencies sitting around.
I haven't ran into a limit yet, but is there a point where BASH will give up on me waiting for me to finish. For example, if I create a script
deploy.sh which contains a bunch of commands including editing files with nano, will bash endlessly wait for me to edit the file and save changes then continue the script? Like I can stop in the middle of script and get some sleep to return to it?
This is the equivalent of taking bash history and marking it up to be used later. Not really meant to take the place of an actual script with conditionals.
# Fix hosts file sudo nano /etc/hosts # Update System sudo apt-get update ; sudo apt-get -y dist-upgrade # Install Java from repo sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update sudo apt-get -y install oracle-java8-installer # Test JAVA java -version # Install build-essential, git sudo apt-get -y install build-essential git # Generate SSH key for github ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org" # Check on ssh-agent eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa # Add SSH to github keys cat ~/.ssh/id_rsa.pub # Verify SSH access to github ssh -T email@example.com # Elastic Search Install wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - echo "deb http://packages.elastic.co/elasticsearch/1.7/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-1.7.list sudo apt-get update sudo apt-get -y install elasticsearch # Edit elasticsearch config (adjust cluster name, node name, and data path) sudo nano /etc/elasticsearch/elasticsearch.yml # Change paths ownership to elasticsearch sudo chown -R elasticsearch:elasticsearch /mnt/data/elasticsearch # Restart elasticsearch sudo service elasticsearch restart # Add elasticsearch to boot sudo update-rc.d elasticsearch defaults 95 10 # Install Node 5.x curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - sudo apt-get install -y nodejs