HTTP/1.1 200 OK Connection: close Date: Fri, 04 Dec 2009 17:46:01 GMT Content-Type: application/json Content-Length: 8901 [{"name":"stackfu-install","controls":[{"label":"Github User","name":"github_user","order":0,"_type":"Textbox","id":"4b0ded5be1054e48d4000001"},{"label":"Github Token","name":"github_token","order":1,"_type":"Textbox","id":"4b0ded5be1054e48d4000002"},{"label":"User Name","name":"user_name","order":2,"_type":"Textbox","id":"4b0ded5be1054e48d4000003"},{"label":"User Email","name":"user_email","order":3,"_type":"Textbox","id":"4b0ded5be1054e48d4000004"},{"label":"Ssh Passphrase","name":"ssh_passphrase","order":4,"_type":"Textbox","id":"4b0ded5be1054e48d4000005"}],"operating_system":"ubuntu_904","type":"stack","user_id":"4b08748de1054e1477000001","validations":[],"executions":[{"script":null,"data":"# \n# install_github.sh\n# Sun Nov 22 20:46:43 -0200 2009\n#\n\napt-get update\napt-get install -y git-core\n\nkey=\"$HOME/.ssh/id_rsa\"\npubkey=\"$key.pub\"\nif [ ! -f \"$pubkey\" ]; then\n ssh-keygen -t rsa -N \"\u003C%= ssh_passphrase %\u003E\" -f $key\nfi\n\ngitconfig=\"$HOME/.gitconfig\"\nif [ ! -f \"$gitconfig\" ]; then\n git config --global github.user \u003C%= github_user %\u003E\n git config --global github.token \u003C%= github_token %\u003E\n \n git config --global user.name \u003C%= user_name %\u003E\n git config --global user.email \u003C%= user_email %\u003E\nfi\n\nkey=\"$HOME/.ssh/id_rsa\"\npubkey=\"$key.pub\"\nkey_contents=`cat $pubkey`\n\ncurl --silent -F \"login=\u003C%= github_user %\u003E\" -F \"token=\u003C%= github_token %\u003E\" \\\n https://github.com/api/v2/json/user/key/add -F \"key=$key_contents\"\n\nssh -o \"StrictHostKeyChecking no\" git@github.com || true\n","file":"install_github","description":"GitHub Credentials Setup","id":"4b0ded5be1054e48d4000007"},{"script":null,"data":"# \n# install_dotfiles.sh\n# Sun Nov 22 20:46:43 -0200 2009\n#\n\nif ! which git\u003E/dev/null; then\n apt-get install -y git-core\nfi\n\napt-get install -y zsh\napt-get install -y ruby\napt-get install -y mercurial\napt-get install -y build-essential\napt-get install -y vim\n\ngit clone git@github.com:fcoury/dotfiles.git bin\n/root/bin/install-vcprompt\ncd /root/bin/dotfiles\n./install\n\nsed -i s:/bin/bash:/bin/zsh:g /etc/passwd \necho \"export PATH=/root/bin:$PATH\" \u003E /root/.private_profile","file":"install_dotfiles","description":"Dotfiles Installation","id":"4b0ded5be1054e48d4000008"},{"script":null,"data":"# \n# install_dotfiles.sh\n# Sun Nov 22 20:46:43 -0200 2009\n#\n\napt-get install -y build-essential\napt-get install -y ruby irb1.8 ruby1.8-dev libreadline-ruby1.8 libruby1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8\n\ncd /usr/src\nwget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz\ntar xvzf rubygems-1.3.5.tgz\ncd rubygems-1.3.5\nsudo ruby setup.rb\n\nsudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem\nsudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby\nsudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb\n\ngem install rake\nln -s /usr/lib/ruby/1.8/bin/rake /usr/local/bin/rake\n","file":"install_ruby_env","description":"Ruby Environment","id":"4b0ded5be1054e48d4000009"},{"script":null,"data":"# \n# install_redis.sh\n# Sun Nov 22 20:46:43 -0200 2009\n#\n\napt-get install -y cronolog\ngem install rspec\n\n# cd /usr/src\n# git clone git://github.com/ezmobius/redis-rb.git\n# cd redis-rb\n# rake redis:install\n# # rake install\n\ncd /usr/src\nwget -q http://redis.googlecode.com/files/redis-1.02.tar.gz\ntar xzvf redis-1.02.tar.gz\ncd redis-1.02/\nmake -j\ncp redis.conf /etc\nln -s /usr/src/redis-1.02/redis-server /usr/bin/redis-server\nln -s /usr/src/redis-1.02/redis-cli /usr/bin/redis-cli\n\necho \"\ndaemonize no\nlogfile stdout\" \u003E\u003E /etc/redis.conf\necho \"nohup /usr/bin/redis-server /etc/redis.conf | /usr/bin/cronolog /var/log/redis/redis.%Y-%m-%d.log 2\u003E\u00261 \u0026\" \u003E /etc/init.d/redis.sh\n\nchmod +x /etc/init.d/redis.sh\n\n#setsid bash -c \"nohup /usr/bin/redis-server /etc/redis.conf | /usr/bin/cronolog /var/log/redis/redis.%Y-%m-%d.log 2\u003E\u00261 \u0026\"\n\nsed -i \"s/loglevel debug/loglevel notice/g\" /etc/redis.conf","file":"install_redis","description":"Redis Installation","id":"4b0ded5be1054e48d400000a"},{"script":null,"data":"# \n# install_resque.sh\n# Sun Nov 22 20:46:43 -0200 2009\n#\n\ngem install redis redis-namespace yajl-ruby --source=http://gemcutter.org\ngem install resque --source=http://gemcutter.org\n","file":"install_resque","description":"Resque Installation","id":"4b0ded5be1054e48d400000b"},{"script":null,"data":"# \n# install_nginx_passenger.sh\n# Sun Nov 22 20:46:43 -0200 2009\n#\n\nexport PATH=/usr/lib/ruby/gems/1.8/gems/passenger-2.2.7/bin:$PATH\n\napt-get install -y zlib1g-dev libssl-dev\n\ngem install passenger\npassenger-install-nginx-module --auto --auto-download --prefix=/opt/nginx\n\necho '#! /bin/sh\n\n### BEGIN INIT INFO\n# Provides: nginx\n# Required-Start: $all\n# Required-Stop: $all\n# Default-Start: 2 3 4 5\n# Default-Stop: 0 1 6\n# Short-Description: starts the nginx web server\n# Description: starts nginx using start-stop-daemon\n### END INIT INFO\n\nPATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\nDAEMON=/opt/nginx/sbin/nginx\nNAME=nginx\nDESC=nginx\n\ntest -x $DAEMON || exit 0\n\n# Include nginx defaults if available\nif [ -f /etc/default/nginx ] ; then\n . /etc/default/nginx\nfi\n\nset -e\n\n. /lib/lsb/init-functions\n\ncase \"$1\" in\n start)\n echo -n \"Starting $DESC: \"\n start-stop-daemon --start --quiet --pidfile /opt/nginx/logs/$NAME.pid \\\n --exec $DAEMON -- $DAEMON_OPTS || true\n echo \"$NAME.\"\n ;;\n stop)\n echo -n \"Stopping $DESC: \"\n start-stop-daemon --stop --quiet --pidfile /opt/nginx/logs/$NAME.pid \\\n --exec $DAEMON || true\n echo \"$NAME.\"\n ;;\n restart|force-reload)\n echo -n \"Restarting $DESC: \"\n start-stop-daemon --stop --quiet --pidfile \\\n /opt/nginx/logs/$NAME.pid --exec $DAEMON || true\n sleep 1\n start-stop-daemon --start --quiet --pidfile \\\n /opt/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true\n echo \"$NAME.\"\n ;;\n reload)\n echo -n \"Reloading $DESC configuration: \"\n start-stop-daemon --stop --signal HUP --quiet --pidfile /opt/nginx/logs/$NAME.pid \\\n --exec $DAEMON || true\n echo \"$NAME.\"\n ;;\n status)\n status_of_proc -p /opt/nginx/logs/$NAME.pid \"$DAEMON\" nginx \u0026\u0026 exit 0 || exit $?\n ;;\n *)\n N=/etc/init.d/$NAME\n echo \"Usage: $N {start|stop|restart|reload|force-reload|status}\" \u003E\u00262\n exit 1\n ;;\nesac\n\nexit 0\n' \u003E /etc/init.d/nginx\n\nchmod +x /etc/init.d/nginx\n/etc/init.d/nginx start\n","file":"install_nginx_passenger","description":"Nginx and Passenger","id":"4b0ded5be1054e48d400000c"},{"script":null,"data":"# \n# install_stackfu.sh\n# Sun Nov 22 20:46:43 -0200 2009\n#\n\necho \"export RACK_ENV=production\" \u003E\u003E ~/.private_profile\n# echo \"export PATH=`gem env|grep \"EXECUTABLE DIRECTORY\"|sed \"s/ - EXECUTABLE DIRECTORY: //\"`:\\$PATH\" \u003E\u003E ~/.private_profile\n\nexport RACK_ENV=production\n# export PATH=`gem env|grep \"EXECUTABLE DIRECTORY\"|sed \"s/ - EXECUTABLE DIRECTORY: //\"`:$PATH\n\nmkdir -p /var\n\ngem install echoe \ngem install rcov\n\ncd /var\ngit clone git@github.com:fcoury/stackfu-core.git\n\ncd /var/stackfu-core\nrake install\n\ncd /var\ngit clone git@github.com:fcoury/stackfu.git\ncd /var/stackfu\nrake install\n\ncd /var\ngit clone git@github.com:fcoury/stackfu-api.git\n\ncd /var/stackfu-api\nrake install_dependencies\n\npassenger_version=`gem search -l passenger | cut -d ')' -f 1 - | cut -d '(' -f 2 -`\n\necho \"worker_processes 2;\n\nevents {\n worker_connections 1024;\n}\n\nhttp {\n passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7;\n passenger_ruby /usr/local/bin/ruby;\n\n include mime.types;\n default_type application/octet-stream;\n\n sendfile on;\n\n keepalive_timeout 65;\n\n server {\n listen 80;\n server_name api.stackfu.com;\n root /var/stackfu-api/public;\n passenger_enabled on;\n\n error_page 500 502 503 504 /50x.html;\n location = /50x.html {\n root html;\n }\n }\n}\n\" \u003E /opt/nginx/conf/nginx.conf\n\n/etc/init.d/nginx restart\n\ncd /var/stackfu-api\ngem install god\ngod -c /var/stackfu-api/script/stackfu-api-resque.god --log /var/log/stackfu-queue.log\n\necho \"nohup gem server | /usr/bin/cronolog /var/log/gemserver.%Y-%m-%d.log 2\u003E\u00261 \u0026\" \u003E /etc/init.d/gemserver\nchmod +x /etc/init.d/gemserver\n\n#setsid bash -c \"nohup /etc/init.d/gemserver \u003C /dev/null \u0026\"","file":"install_stackfu","description":"StackFu","id":"4b0ded5be1054e48d400000d"}],"requirements":[],"description":"Configures and deploy stackfu API server","id":"4b0ded5be1054e48d4000006"}]