Skip to content

Instantly share code, notes, and snippets.

@jasonsnider
Last active December 19, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonsnider/5980052 to your computer and use it in GitHub Desktop.
Save jasonsnider/5980052 to your computer and use it in GitHub Desktop.
This is the shell script I use for updating jasonsnider.com. I am building jasonsnider,com as three separate .git projects. Tinker (an MVC framework), Jsc (the jasonsnider.com plugin), JscTheme (the theme for jasonsnider.com). Rather than using submodules I'm treating each piece as it's own project. When new code gets pushed to the repository I …
#!/bin/sh
# Completely removes, rebuilds and reconfigures jasonsnider.com from it's git repositories
# Jason D Snider <jason@jasonsnider.com>
## Start by removing the entire website
rm -fR /var/www/jasonsnider.com/tinker
## Build the code base
cd /var/www/jasonsnider.com && git clone git@github.com:jasonsnider/tinker.git
cd /var/www/jasonsnider.com/tinker && git clone git@github.com:jasonsnider/jsc.git Jsc
cd /var/www/jasonsnider.com/tinker/themes && git clone git@github.com:jasonsnider/jsc-theme.git Jsc
## Build the documentation
cd /var/www/jasonsnider.com/tinker/webroot && git clone git@github.com:jasonsnider/jsc-docs.git
cd /var/www/jasonsnider.com/tinker/webroot && git clone git@github.com:jasonsnider/tinker-docs.git
## Update the code base
cd /var/www/jasonsnider.com/tinker/ && git pull origin master
cd /var/www/jasonsnider.com/tinker/Jsc && git pull origin master
cd /var/www/jasonsnider.com/tinker/themes/Jsc && git pull origin master
## Update documentation
cd /var/www/jasonsnider.com/tinker/webroot/jsc-docs && git pull origin master
cd /var/www/jasonsnider.com/tinker/webroot/tinker-docs && git pull origin master
# The Jsc Theme holds all of the webroot assets for jaosnsnider.com, here we will migrate those files from the theme
# and into our production environment
## Replace the exisiting Jsc themes
rm -fR /var/www/jasonsnider.com/tinker/webroot/themes/jsc
cp -R /var/www/jasonsnider.com/tinker/themes/Jsc/webroot /var/www/jasonsnider.com/tinker/webroot/themes/jsc
## Replace the robots.txt file
rm -f /var/www/jasonsnider.com/tinker/webroot/robots.txt
cp /var/www/jasonsnider.com/tinker/themes/Jsc/webroot/robots.txt /var/www/jasonsnider.com/tinker/webroot/robots.txt
# The Jsc Plugin holds all of the configuration files jaosnsnider.com, here we will migrate those files from the plugin
# and into our production environment
## Replace the main config file
rm -f /var/www/jasonsnider.com/tinker/config/Config.php
cp /var/www/jasonsnider.com/tinker/Jsc/config/Config.php /var/www/jasonsnider.com/tinker/config/Config.php
## Replace the main routing file
rm -f /var/www/jasonsnider.com/tinker/config/Routes.php
cp /var/www/jasonsnider.com/tinker/Jsc/config/Routes.php /var/www/jasonsnider.com/tinker/config/Routes.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment