Skip to content

Instantly share code, notes, and snippets.

@yllus
Created November 8, 2012 21:16
Show Gist options
  • Save yllus/4041661 to your computer and use it in GitHub Desktop.
Save yllus/4041661 to your computer and use it in GitHub Desktop.
#!/bin/sh
webroot_symbolic_dir="webroot"
if [ $# != 1 ]; then
echo "This shell script deploys the specified build of this website by creating a symbolic link from the date-stamped build folder"
echo "to the new folder of ${webroot_symbolic_dir}/ . Please also note that this deployment script must be run within the directory"
echo "the symbolic link folder will be created in."
echo ""
echo "Usage: ./deploy.sh [folder to be deployed]"
echo ""
exit 0
fi
current_dir=`pwd`
webroot_dir=$1
if [ -d "${webroot_symbolic_dir}" ]; then
unlink ${webroot_symbolic_dir}
fi
ln -s $1 ${webroot_symbolic_dir}
if [ ! -d "uploads" ]; then
mkdir uploads
fi
if [ ! -d "${webroot_symbolic_dir}/wp-content/uploads" ]; then
ln -s ${current_dir}/uploads/ ${webroot_symbolic_dir}/wp-content/uploads
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment