From 774f13bd5d67b7dcb5b256ed861e8757af85df14 Mon Sep 17 00:00:00 2001 From: Adrien Poupin Date: Tue, 1 Nov 2016 23:04:12 +0100 Subject: [PATCH] doc: Add a "Deployment with rsync" tutorial page This is kind of a generic process and not so difficult. It seems important to me that it should be documented. --- .../tutorials/deployment-with-rsync.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 docs/content/tutorials/deployment-with-rsync.md diff --git a/docs/content/tutorials/deployment-with-rsync.md b/docs/content/tutorials/deployment-with-rsync.md new file mode 100644 index 000000000..7bc516650 --- /dev/null +++ b/docs/content/tutorials/deployment-with-rsync.md @@ -0,0 +1,125 @@ +--- +authors: +- Adrien Poupin +date: 2016-11-01 +linktitle: Deployment with rsync +toc: true +menu: + main: + parent: tutorials +next: /tutorials/creating-a-new-theme +prev: /tutorials/automated-deployments +title: Easy deployments with rsync +weight: 11 + +--- + +# How to build and deploy with hugo and rsync +We assume here that you have an access to your web host with SSH. In that case, as you will see, deployment is very simple. We also assume that you have a functional static site with hugo installed. + +The spoil is, you can deploy your entire site with a command that looks like this: + +```bash +hugo && rsync -avz --delete public/ www-data@ftp.topologix.fr:~/www/ +``` + +As you will see, we put it in a shell script file, which makes building and deployment as easy as executing `./deploy`. + +## Installing SSH Key + +If it is not done yet, we will make an automated way to SSH to your server. If you have already installed an SSH key, switch to the next section. + +First, install the ssh client. On Debian/Ubuntu/derivates, enter `sudo apt-get install openssh-client`. + +Then generate your ssh key by entering the following commands: +``` +~$ cd && mkdir .ssh & cd .ssh +~/.ssh/$ ssh-keygen -t rsa -q -C "For SSH" -f rsa_id +~/.ssh/$ cat >> config <