Created
February 16, 2020 22:29
-
-
Save denielchiang/fc4ba8441eed810aae89b33c2e4d8980 to your computer and use it in GitHub Desktop.
When server has been created do this first
This file contains hidden or 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
| useradd -m -s /bin/bash deploy | |
| "deploy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/10-app-deploy | |
| mkdir -p ~deploy/.ssh | |
| chown deploy:deploy ~deploy/.ssh | |
| chmod 700 ~deploy/.ssh | |
| cp ~root/.ssh/authorized_keys ~deploy/.ssh | |
| chown deploy:deploy ~deploy/.ssh/authorized_keys | |
| chmod 600 ~deploy/.ssh/authorized_keys | |
| # exit and connect again | |
| ssh -A deploy@${web-server} | |
| # make sure works | |
| sudo -s | |
| exit | |
| # create source folder | |
| mkdir -p ~/build | |
| cd ~/build | |
| git clone https://github.com/cogini/mix-deploy-example # or your app repo | |
| cd mix-deploy-example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment