Created
July 21, 2010 20:19
-
-
Save stepheneb/485053 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo " | |
*** generate the documentation for sproutcore and open in a browser: | |
cd $SPROUTCORE_DEV/sproutcore-git | |
sc-docs sproutcore | |
open tmp/docs/sproutcore/index.html | |
" | |
cd $SPROUTCORE_DEV/sproutcore-git | |
sc-docs sproutcore | |
open tmp/docs/sproutcore/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SproutCore development setup | |
# | |
# Setup a working directory for sproutcore development with the latest code. | |
# This setup is useful if you want to be able to easily view and/or edit the | |
# sproutcore libraries themselves while doing development. | |
# | |
# Stephen Bannasch, 2010 04 14 | |
# file: sproutcore-dev-setup.sh | |
# | |
# source sproutcore-dev-setup.sh | |
# | |
if [ -n "$1" ] | |
then | |
export SPROUTCORE_DEV=`pwd`/$1 | |
else | |
export SPROUTCORE_DEV=`pwd`/sc | |
fi | |
mkdir -p $SPROUTCORE_DEV; cd $SPROUTCORE_DEV | |
curl http://gist.github.com/raw/485053/update.rb -o update.rb | |
git clone git://github.com/sproutit/sproutcore.git sproutcore-git | |
git clone git://github.com/sproutit/sproutcore-abbot.git sproutcore-abbot-git | |
mkdir -p $SPROUTCORE_DEV/sproutcore-abbot-git/frameworks; cd $SPROUTCORE_DEV/sproutcore-abbot-git/frameworks | |
git clone $SPROUTCORE_DEV/sproutcore-git sproutcore | |
git clone git://github.com/sproutit/sproutcore-website.git sproutcore-website-git | |
# Add the path the abbot/bin to the beginning of your PATH to access the | |
# sproutcore development executables: sc-server, sc-gen, etc. | |
# Normally you'd put something this in your ~/.bash_profile or ~/.bash_rc | |
# export PATH=$SPROUTCORE_DEV/sproutcore-abbot-git/bin:$PATH | |
if ![[ "$PATH" =~ "$SPROUTCORE_DEV" ]] | |
then | |
export PATH=$SPROUTCORE_DEV/sproutcore-abbot-git/bin:$PATH | |
fi | |
# Entering: 'which sc-server' should now display the path to sc-server in sproutcore-abbot-git/bin | |
# | |
# If you are using RVM it adds itself to the beginning of the PATH so after switching | |
# a Ruby VM using rvm you'll need to add the abbot/bin to the beginning of the PATH again. | |
# external frameworks | |
# I should move scui | |
mkdir $SPROUTCORE_DEV/frameworks; cd $SPROUTCORE_DEV/frameworks | |
git clone git://github.com/etgryphon/sai.git sai-git | |
git clone git://github.com/etgryphon/sproutcore-ui.git sproutcore-ui-git | |
# CC apps and frameworks | |
mkdir -p $SPROUTCORE_DEV/cc/apps | |
mkdir -p $SPROUTCORE_DEV/cc/frameworks | |
mkdir -p $SPROUTCORE_DEV/cc/demos | |
# CC apps | |
cd $SPROUTCORE_DEV/cc/apps | |
git clone git@github.com:psndcsrv/Geniverse-SproutCore.git geniverse-sc-git | |
git clone git@github.com:knowuh/raclette.git raclette-git | |
git clone git://github.com/rklancer/raphael-views-demos.git raphael-views-demos-git | |
git clone git://github.com/scytacki/sc-portfolio.git sc-portfolio-git | |
git clone git@github.com:rklancer/Smartgraphs.git smartgraphs-git | |
# CC frameworks | |
cd $SPROUTCORE_DEV/cc/frameworks | |
git clone git@github.com:stepheneb/jsx_graph_test.git cc-jsxgraph-git | |
git clone git@github.com:sfentress/CC-SproutCore.git cc-sproutcore-git | |
git clone git://github.com/rklancer/RaphaelViews.git raphael-views-git | |
# CC demos | |
cd $SPROUTCORE_DEV/cc/demos | |
git clone git://github.com/stepheneb/smartgraph-demos.git smartgraph-demos-git | |
# demos | |
# In the sample and demo code below the README often asks you to use git to clone | |
# sproutcore or scui into the frameworks dir. In this script you are cloning from | |
# the repos initially cloned on your local computer -- makes install faster and | |
# take less space. | |
# | |
# After installing startup a server with: sc-server. | |
# The root of the SC system running the app will be be at: | |
# | |
# http://0.0.0.0:4020/ | |
# | |
# This will usually show a selection with one or more apps along with tests and docs. | |
# | |
# sc-server takes the same options as mongrel so you can start | |
# several different SC apps like this: | |
# | |
# cd demos/sproutcore-samples; sc-server --port=4021 | |
# cd demos/scui-samples; sc-server --port=4022 | |
mkdir -p $SPROUTCORE_DEV/demos | |
# demo: sproutcore-samples | |
cd $SPROUTCORE_DEV/demos | |
git clone git://github.com/sproutit/sproutcore-samples.git sproutcore-samples-git | |
cd sproutcore-samples-git | |
mkdir frameworks; cd frameworks | |
git clone $SPROUTCORE_DEV/sproutcore-git sproutcore | |
# fyi: generate the documentation for sproutcore itself: | |
# sc-docs sproutcore/desktop | |
# open tmp/docs/sproutcore/desktop/index.html | |
# demo: scui-samples | |
cd $SPROUTCORE_DEV/demos | |
git clone git://github.com/etgryphon/scui-samples.git scui-samples-git | |
cd scui-samples-git | |
mkdir frameworks; cd frameworks | |
git clone $SPROUTCORE_DEV/frameworks/sproutcore-ui-git scui | |
# demo: linkit | |
cd $SPROUTCORE_DEV/demos | |
git clone git://github.com/etgryphon/linkit-demo.git linkit-demo-git | |
cd linkit-demo-git | |
mkdir frameworks; cd frameworks | |
git clone $SPROUTCORE_DEV/sproutcore-git sproutcore | |
git clone $SPROUTCORE_DEV/frameworks/sproutcore-ui-git scui | |
# demo: tasks | |
cd $SPROUTCORE_DEV/demos | |
git clone git://github.com/suvajitgupta/Tasks.git tasks-git | |
cd tasks-git/frameworks | |
git clone $SPROUTCORE_DEV/frameworks/sproutcore-ui-git scui | |
git clone $SPROUTCORE_DEV/sproutcore-git sproutcore | |
# Tasks is using a specific version of sproutore | |
cd sproutcore | |
git reset --hard 725c490576519f26ab6f09195718750583920039 | |
# see README for updates and the rest of the setup | |
# demo: sai-samples (for the sai vector graphics framework) | |
cd $SPROUTCORE_DEV/demos | |
git clone git://github.com/etgryphon/sai-samples.git sai-samples-git | |
cd sai-samples-git | |
mkdir frameworks; cd frameworks | |
git clone $SPROUTCORE_DEV/sproutcore-git sproutcore | |
git clone $SPROUTCORE_DEV/sproutcore-ui-git/ scui | |
git clone $SPROUTCORE_DEV/frameworks/sai-git sai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# update sproutcore, abbot, scui, sai, cc apps and frameworks, and the demo apps | |
# | |
# running: | |
# | |
# cd /path/to/sc | |
# ruby update.rb | |
# | |
SPROUTCORE_DEV = ENV["SPROUTCORE_DEV"] | |
@repos_with_update_errors = [] | |
def do_commands(path, commands) | |
Dir.chdir File.expand_path(path) do | |
print sprintf("%-80s", path); STDOUT.flush | |
response = '' | |
commands.each do |command| | |
response += `#{command} 2>&1` | |
end | |
if response =~ /Already up-to-date|Current branch master is up to date/ | |
puts "up-to-date" | |
else | |
puts "\n\n#{response}\n" | |
end | |
if response =~/error: |RA layer request failed|: needs update/ | |
puts <<-HEREDOC | |
Error updating: #{path} | |
HEREDOC | |
@repos_with_update_errors << path | |
end | |
end | |
end | |
def checkout_master_and_pull(path, more_commands=nil) | |
commands = ['git checkout master', 'git pull'] | |
commands << more_commands if more_commands | |
commands.flatten! | |
do_commands("#{SPROUTCORE_DEV}/#{path}", commands) | |
end | |
def checkout_master_pull_and_update_submodules(path) | |
checkout_master_and_pull(path, 'git submodule update') | |
end | |
puts <<-HEREDOC | |
*** git checkout master and pull | |
HEREDOC | |
%w{ | |
sproutcore-git | |
sproutcore-abbot-git | |
sproutcore-abbot-git/frameworks/sproutcore | |
frameworks/sproutcore-ui-git | |
frameworks/sai-git | |
cc/frameworks/cc-sproutcore-git | |
cc/frameworks/cc-jsxgraph-git | |
cc/frameworks/raphael-views-git | |
cc/apps/geniverse-sc-git | |
cc/apps/smartgraphs-git | |
cc/apps/sc-portfolio-git | |
cc/apps/raclette-git | |
cc/demos/smartgraph-demos-git | |
demos/sproutcore-samples-git | |
demos/sproutcore-samples-git/frameworks/sproutcore | |
demos/scui-samples-git | |
demos/scui-samples-git/frameworks/scui | |
demos/linkit-demo-git | |
demos/linkit-demo-git/frameworks/sproutcore | |
demos/linkit-demo-git/frameworks/scui | |
demos/tasks-git | |
demos/tasks-git/frameworks/scui | |
demos/sai-samples-git | |
demos/sai-samples-git/frameworks/sproutcore | |
demos/sai-samples-git/frameworks/scui | |
demos/sai-samples-git/frameworks/sai | |
}.each { |repo| checkout_master_and_pull(repo) } | |
puts <<-HEREDOC | |
*** git checkout master, pull, and update git submodules | |
HEREDOC | |
%w{ | |
cc/apps/geniverse-sc-git | |
cc/apps/smartgraphs-git | |
cc/apps/sc-portfolio-git | |
}.each { |repo| checkout_master_pull_and_update_submodules(repo) } | |
puts | |
unless @repos_with_update_errors.empty? | |
puts <<-HEREDOC | |
======================================================================================= | |
Error summary: | |
The following git repositories were not updated because of errors: | |
#{@repos_with_update_errors.join("\n ")} | |
HEREDOC | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment