Silverstripe Setup Script

We thought we had to improve our SilverStripe setup script for our development environment.
So Max and me rewrote it to add submodules and some other improvements.

Just run:

./ mynewproject tags/2.4.7

and you have

  • silverstripe project folder structure
  • the tutorial theme
  • a already filled git repository
  • sapphire as submodule
  • cms as submodule
  • Uploadify as submodule
  • DataObjectManager as submodule
  • UserForms as submodule

What you then still need to do is:

  • create the database
  • setup a local vhost
  • open your project url and run the install process
  • start to code

So here it is:

# install silverstripe + common modules from github
# usage sh <folder_name> <tag/branch>
# examples: 
# sh some_folder tags/2.4.5
# sh some_folder master

#set up project base folder
git clone $1
cd $1
git checkout $2
#we kill the .git because we want this repo just as starter and init our own repository (instead of export)
rm -rf .git

#set permissions for install
chmod 0777 assets assets/*
chmod 0666 .htaccess mysite/_config.php assets/*/*

git init

git submodule add cms
cd cms
git checkout $2
cd ..
git add cms
git commit -m "checked out submodule cms to $2"

git submodule add sapphire
cd sapphire
git checkout $2
cd ..
git add sapphire
git commit -m "checked out submodule sapphire to $2"

# add common modules
git submodule add git:// uploadify
git submodule add git:// dataobject_manager
git submodule add git:// userform

git submodule init
git submodule update

git add .
git commit -m "Initial Commit"