Skip to content

Instantly share code, notes, and snippets.

@jonowells
Last active December 18, 2015 11:20
Show Gist options
  • Select an option

  • Save jonowells/5775390 to your computer and use it in GitHub Desktop.

Select an option

Save jonowells/5775390 to your computer and use it in GitHub Desktop.
Docpad-Middleman Beanstalk Deployment
# Variables referenced:
# [project-name]: a name you make up as your project folder on the server.
# [repository-name]: the short name of your beanstalk repository
# [git-branch]: the proper git branch for this particular environment
# Context set to:
# /var/www/[dev|qa|uat]/[project-name]
# Nginx Serves:
# /var/www/[dev|qa|uat]/[project-name]/build
DOCPAD
mkdir -p build/releases
mv build/releases releases
rm -rf [repository-name]
git clone --depth=1 -b [git-branch] [email protected]:/[repository-name].git
cd [repository-name]; npm install; docpad generate # you can add any build options or other code generation commands here
rm -rf build
mv [repository-name]/out build
rm -rf [repository-name]
ZIP_FILE='build_$(date "+%Y-%m-%d").zip'; eval "zip -r $ZIP_FILE build"
mv *.zip releases
mv releases build/releases
chmod -R 755 build
MIDDLEMAN
mkdir -p build/releases
mv build/releases releases
rm -rf [repository-name]
git clone --depth=1 -b [git-branch] [email protected]:/[repository-name].git
cd [repository-name]; bundle install; bundle exec middleman build --clean
rm -rf build
mv [repository-name]/build build #for zipping and serving
rm -rf [repository-name]
ZIP_FILE='build_$(date "+%Y-%m-%d").zip'; eval "zip -r $ZIP_FILE build"
mv *.zip releases
mv releases build/releases
chmod -R 755 build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment