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 | |
projectfolder=$1 | |
# setup docker environment | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -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 edge" | |
sudo apt-get update |
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 | |
projectfolder=$1 | |
if [ -z "$projectfolder" ]; then | |
exit 1 | |
fi | |
./terraform apply -auto-approve | |
ssh -i ~/.ssh/<aws-ssh-pem-file> -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ubuntu@<new-instance-private-ip> "mkdir -p /home/ubuntu/\"$projectfolder\"" | |
scp -i ~/.ssh/<aws-ssh-pem-file> -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r /var/www/$projectfolder ubuntu@<new-instance-private-ip>:/home/ubuntu |