Usually, web hosting services offer the possibility to manage the webspace via a browser interface. Mostly, ftp access is provided as well.
Earlier versions of this website were deployed with a simple python script to copy the local build of the site to the web server. I used ftp commands in that script.
During the website redesign, I also reviewed the deployment process and stumbled upon rclone
.
Several remotes can be configured in the configuration file rclone.conf
.
rclone config
can be used interactively to generate and manage these. The result looks like that:
[name_of_the_remote]
type = ftp
url = ftp.yourdomain.net
user = your_ftp_user
pass = cryptedpassword
host = ftp.yourdomain.net
explicit_tls = true
After the Hugo website was built locally (hugo --gc --minify
), I am using the following command
to sync the static sites in public
with the remote.
The interactive
mode is helpful in the beginning, potential overwrite or delete activities will be double-checked.
rclone sync --interactive public/ name_of_the_remote:deployment_folder
This is an easy way to deploy builds from the command line without using a browser or a ftp client. Obsolete pages in the remote will be easily removed.