Skip to main content
100%

DocPad: rsync Deploy Script

✓ Published0🌍 Public
HHypercubed
Last edited Jun 18, 2013
Created on Jun 18, 2013

This example shows a shell script that automates deploying a static website via rsync to a remote server. It defines environment variables for the source directory, destination directory, server, and account, then runs `docpad generate` to build the site before syncing files. The script supports a dry-run mode with the `-n` flag and excludes specified patterns like `.git` and `.svn` using a `.deployignore` file. It relies on the `rsync` command-line tool and the `docpad` static site generator, with the deployment target specified as a user@host:path.

AI-generated description

DocPad: rsync Deploy Script

  • Place deploy.sh in {docpad folder}/bin/
  • Create (or edit) a .env file in your docpad folder with the following values:
#!/bin/bash
DEPLOY_SOURCE_DIR="out/"
DEPLOY_DEST_DIR="~/public_html/"
DEPLOY_SERVER=deploy-server-name
DEPLOY_ACCOUNT=deploy-login-name
  • Create a .deployignore file in docpad folder with the following values:
**.svn
.git
.gitignore
  • Test with ./bin/deploy.sh -n deploy with./bin/deploy.sh

Similar vizzes