stackfu 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +24 -0
- data/Manifest +118 -0
- data/README +0 -0
- data/README.md +218 -0
- data/Rakefile +73 -0
- data/bin/stackfu +10 -0
- data/lib/stackfu/api_hooks.rb +17 -0
- data/lib/stackfu/app.rb +69 -0
- data/lib/stackfu/commands/command.rb +127 -0
- data/lib/stackfu/commands/config_command.rb +43 -0
- data/lib/stackfu/commands/deploy_command.rb +144 -0
- data/lib/stackfu/commands/dump_command.rb +101 -0
- data/lib/stackfu/commands/generate_command.rb +107 -0
- data/lib/stackfu/commands/help_command.rb +28 -0
- data/lib/stackfu/commands/list_command.rb +26 -0
- data/lib/stackfu/commands/publish_command.rb +108 -0
- data/lib/stackfu/commands/server_command.rb +124 -0
- data/lib/stackfu/helpers/providers_credentials.rb +82 -0
- data/lib/stackfu/helpers/rendering.rb +201 -0
- data/lib/stackfu/operating_systems.rb +30 -0
- data/lib/stackfu.rb +88 -0
- data/stackfu-installer/config/01-controls.yml +17 -0
- data/stackfu-installer/config/02-requirements.yml +3 -0
- data/stackfu-installer/config/03-scripts.yml +16 -0
- data/stackfu-installer/config/04-validations.yml +3 -0
- data/stackfu-installer/script/dotfiles_installation.sh.erb +22 -0
- data/stackfu-installer/script/github_credentials_setup.sh.erb +31 -0
- data/stackfu-installer/script/nginx_and_passenger.sh.erb +83 -0
- data/stackfu-installer/script/redis_installation.sh.erb +33 -0
- data/stackfu-installer/script/resque_installation.sh.erb +7 -0
- data/stackfu-installer/script/ruby_environment.sh.erb +20 -0
- data/stackfu-installer/script/stackfu.sh.erb +114 -0
- data/stackfu-installer/stack.yml +5 -0
- data/stackfu.gemspec +60 -0
- data/templates/01-controls.yml.erb +31 -0
- data/templates/02-requirements.yml.erb +26 -0
- data/templates/03-scripts.yml.erb +34 -0
- data/templates/04-validations.yml.erb +17 -0
- data/templates/script.sh.erb +7 -0
- data/templates/stack.yml.erb +17 -0
- data/test/fixtures/add_server_error +7 -0
- data/test/fixtures/deployment_add +7 -0
- data/test/fixtures/deployment_add_error +8 -0
- data/test/fixtures/deployments +7 -0
- data/test/fixtures/logs +7 -0
- data/test/fixtures/logs_partial +7 -0
- data/test/fixtures/plugin_add +6 -0
- data/test/fixtures/plugin_add_error +8 -0
- data/test/fixtures/plugin_deployment_add +7 -0
- data/test/fixtures/plugin_not_found +7 -0
- data/test/fixtures/plugin_unauthorized +8 -0
- data/test/fixtures/plugins +7 -0
- data/test/fixtures/plugins_by_name +7 -0
- data/test/fixtures/plugins_by_name_other +7 -0
- data/test/fixtures/plugins_empty +7 -0
- data/test/fixtures/plugins_multiple +7 -0
- data/test/fixtures/providers +7 -0
- data/test/fixtures/providers_servers +7 -0
- data/test/fixtures/server_add +6 -0
- data/test/fixtures/server_add_dupe +7 -0
- data/test/fixtures/server_add_error +7 -0
- data/test/fixtures/server_delete +7 -0
- data/test/fixtures/server_delete_error +7 -0
- data/test/fixtures/servers +7 -0
- data/test/fixtures/servers_by_name +7 -0
- data/test/fixtures/servers_empty +8 -0
- data/test/fixtures/servers_not_found +26 -0
- data/test/fixtures/servers_unauthorized +8 -0
- data/test/fixtures/servers_webbynode +7 -0
- data/test/fixtures/stack/stackfu-installer/config/01-controls.yml +22 -0
- data/test/fixtures/stack/stackfu-installer/config/02-requirements.yml +1 -0
- data/test/fixtures/stack/stackfu-installer/config/03-scripts.yml +23 -0
- data/test/fixtures/stack/stackfu-installer/config/04-validations.yml +1 -0
- data/test/fixtures/stack/stackfu-installer/script/dotfiles_installation.sh.erb +22 -0
- data/test/fixtures/stack/stackfu-installer/script/github_credentials_setup.sh.erb +31 -0
- data/test/fixtures/stack/stackfu-installer/script/nginx_and_passenger.sh.erb +83 -0
- data/test/fixtures/stack/stackfu-installer/script/redis_installation.sh.erb +33 -0
- data/test/fixtures/stack/stackfu-installer/script/resque_installation.sh.erb +7 -0
- data/test/fixtures/stack/stackfu-installer/script/ruby_environment.sh.erb +20 -0
- data/test/fixtures/stack/stackfu-installer/script/stackfu.sh.erb +76 -0
- data/test/fixtures/stack/stackfu-installer/stack.yml +5 -0
- data/test/fixtures/stack_add +6 -0
- data/test/fixtures/stack_add_error +8 -0
- data/test/fixtures/stack_add_error_dupe +8 -0
- data/test/fixtures/stack_adds_by_name +7 -0
- data/test/fixtures/stack_delete_not_found +7 -0
- data/test/fixtures/stacks +7 -0
- data/test/fixtures/stacks_by_name +7 -0
- data/test/fixtures/stacks_by_name_other +7 -0
- data/test/fixtures/stacks_empty +7 -0
- data/test/fixtures/stacks_multiple +7 -0
- data/test/fixtures/stacks_not_found +7 -0
- data/test/fixtures/stacks_realworld +7 -0
- data/test/fixtures/stacks_stackfu-installer +7 -0
- data/test/fixtures/stacks_unauthorized +8 -0
- data/test/fixtures/stacks_with_controls +0 -0
- data/test/fixtures/users +7 -0
- data/test/fixtures/users_no_credentials +7 -0
- data/test/fixtures/users_update +6 -0
- data/test/stack.yml +26 -0
- data/test/support/custom_matchers.rb +69 -0
- data/test/support/fixtures.rb +98 -0
- data/test/support/io_stub.rb +10 -0
- data/test/support/web_fixtures.rb +91 -0
- data/test/test_helper.rb +186 -0
- data/test/unit/commands/test_command.rb +112 -0
- data/test/unit/commands/test_config_command.rb +92 -0
- data/test/unit/commands/test_deploy_command.rb +303 -0
- data/test/unit/commands/test_dump_command.rb +155 -0
- data/test/unit/commands/test_generate_command.rb +112 -0
- data/test/unit/commands/test_help_command.rb +33 -0
- data/test/unit/commands/test_list_command.rb +63 -0
- data/test/unit/commands/test_publish_command.rb +265 -0
- data/test/unit/commands/test_server_command.rb +259 -0
- data/test/unit/helpers/test_rendering.rb +141 -0
- data/test/unit/test_array.rb +26 -0
- data/test/unit/test_provider.rb +14 -0
- data/test/unit/test_stackfu.rb +27 -0
- metadata +311 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Sat, 14 Nov 2009 01:24:42 GMT
|
|
4
|
+
Content-Type: application/json;charset=utf-8
|
|
5
|
+
Content-Length: 189
|
|
6
|
+
|
|
7
|
+
[{"provider_class":"Slicehost","nickname":"slicey","user_id":"4afe06b8e1054e1e00000001","ip":"174.143.145.37","hostname":"slicey","id":"4afe06b9e1054e1e00000002","status":["running", 100]}]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Sat, 21 Nov 2009 17:38:09 GMT
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
Content-Length: 181
|
|
6
|
+
|
|
7
|
+
[{"provider_class":"Slicehost","nickname":"slicey","user_id":{"data":[75,4,88,100,225,5,78,32,253,0,0,1]},"ip":"174.143.146.46","hostname":"slicey","id":"4b082516e1054e0d24000001"}]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
HTTP/1.1 404 Not Found
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Thu, 19 Nov 2009 16:51:08 GMT
|
|
4
|
+
Content-Type: text/html
|
|
5
|
+
Content-Length: 422
|
|
6
|
+
|
|
7
|
+
<!DOCTYPE html>
|
|
8
|
+
<html>
|
|
9
|
+
<head>
|
|
10
|
+
<style type="text/css">
|
|
11
|
+
body { text-align:center;font-family:helvetica,arial;font-size:22px;
|
|
12
|
+
color:#888;margin:20px}
|
|
13
|
+
#c {margin:0 auto;width:500px;text-align:left}
|
|
14
|
+
</style>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<h2>Sinatra doesn't know this ditty.</h2>
|
|
18
|
+
<img src='/__sinatra__/404.png'>
|
|
19
|
+
<div id="c">
|
|
20
|
+
Try this:
|
|
21
|
+
<pre>get '/servers1.json' do
|
|
22
|
+
"Hello World"
|
|
23
|
+
end</pre>
|
|
24
|
+
</div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Sat, 14 Nov 2009 01:24:42 GMT
|
|
4
|
+
Content-Type: application/json;charset=utf-8
|
|
5
|
+
Content-Length: 191
|
|
6
|
+
|
|
7
|
+
[{"provider_class":"Webbynode","nickname":"sandbox","user_id":"4afe06b8e1054e1e00000001","ip":"208.88.125.207","hostname":"sandbox","id":"4afe06b9e1054e1e00000002","status":["running", 100]}]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
controls:
|
|
2
|
+
|
|
3
|
+
- name: github_user
|
|
4
|
+
label: Github User
|
|
5
|
+
type: Textbox
|
|
6
|
+
|
|
7
|
+
- name: github_token
|
|
8
|
+
label: Github Token
|
|
9
|
+
type: Textbox
|
|
10
|
+
|
|
11
|
+
- name: user_name
|
|
12
|
+
label: User Name
|
|
13
|
+
type: Textbox
|
|
14
|
+
|
|
15
|
+
- name: user_email
|
|
16
|
+
label: User Email
|
|
17
|
+
type: Textbox
|
|
18
|
+
|
|
19
|
+
- name: ssh_passphrase
|
|
20
|
+
label: Ssh Passphrase
|
|
21
|
+
type: Textbox
|
|
22
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requirements: []
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
scripts:
|
|
2
|
+
|
|
3
|
+
- description: GitHub Credentials Setup
|
|
4
|
+
file: github_credentials_setup
|
|
5
|
+
|
|
6
|
+
- description: Dotfiles Installation
|
|
7
|
+
file: dotfiles_installation
|
|
8
|
+
|
|
9
|
+
- description: Ruby Environment
|
|
10
|
+
file: ruby_environment
|
|
11
|
+
|
|
12
|
+
- description: Redis Installation
|
|
13
|
+
file: redis_installation
|
|
14
|
+
|
|
15
|
+
- description: Resque Installation
|
|
16
|
+
file: resque_installation
|
|
17
|
+
|
|
18
|
+
- description: Nginx and Passenger
|
|
19
|
+
file: nginx_and_passenger
|
|
20
|
+
|
|
21
|
+
- description: StackFu
|
|
22
|
+
file: stackfu
|
|
23
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
validations: []
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#
|
|
2
|
+
# install_dotfiles.sh
|
|
3
|
+
# Sun Nov 22 20:46:43 -0200 2009
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
if ! which git>/dev/null; then
|
|
7
|
+
apt-get install -y git-core
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
apt-get install -y zsh
|
|
11
|
+
apt-get install -y ruby
|
|
12
|
+
apt-get install -y mercurial
|
|
13
|
+
apt-get install -y build-essential
|
|
14
|
+
apt-get install -y vim
|
|
15
|
+
|
|
16
|
+
git clone git@github.com:fcoury/dotfiles.git bin
|
|
17
|
+
/root/bin/install-vcprompt
|
|
18
|
+
cd /root/bin/dotfiles
|
|
19
|
+
./install
|
|
20
|
+
|
|
21
|
+
sed -i s:/bin/bash:/bin/zsh:g /etc/passwd
|
|
22
|
+
echo "export PATH=/root/bin:$PATH" > /root/.private_profile
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#
|
|
2
|
+
# install_github.sh
|
|
3
|
+
# Sun Nov 22 20:46:43 -0200 2009
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
apt-get update
|
|
7
|
+
apt-get install -y git-core
|
|
8
|
+
|
|
9
|
+
key="$HOME/.ssh/id_rsa"
|
|
10
|
+
pubkey="$key.pub"
|
|
11
|
+
if [ ! -f "$pubkey" ]; then
|
|
12
|
+
ssh-keygen -t rsa -N "<%= ssh_passphrase %>" -f $key
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
gitconfig="$HOME/.gitconfig"
|
|
16
|
+
if [ ! -f "$gitconfig" ]; then
|
|
17
|
+
git config --global github.user <%= github_user %>
|
|
18
|
+
git config --global github.token <%= github_token %>
|
|
19
|
+
|
|
20
|
+
git config --global user.name <%= user_name %>
|
|
21
|
+
git config --global user.email <%= user_email %>
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
key="$HOME/.ssh/id_rsa"
|
|
25
|
+
pubkey="$key.pub"
|
|
26
|
+
key_contents=`cat $pubkey`
|
|
27
|
+
|
|
28
|
+
curl --silent -F "login=<%= github_user %>" -F "token=<%= github_token %>" \
|
|
29
|
+
https://github.com/api/v2/json/user/key/add -F "key=$key_contents"
|
|
30
|
+
|
|
31
|
+
ssh -o "StrictHostKeyChecking no" git@github.com || true
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#
|
|
2
|
+
# install_nginx_passenger.sh
|
|
3
|
+
# Sun Nov 22 20:46:43 -0200 2009
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
export PATH=/usr/lib/ruby/gems/1.8/gems/passenger-2.2.7/bin:$PATH
|
|
7
|
+
|
|
8
|
+
apt-get install -y zlib1g-dev libssl-dev
|
|
9
|
+
|
|
10
|
+
gem install passenger
|
|
11
|
+
passenger-install-nginx-module --auto --auto-download --prefix=/opt/nginx
|
|
12
|
+
|
|
13
|
+
echo '#! /bin/sh
|
|
14
|
+
|
|
15
|
+
### BEGIN INIT INFO
|
|
16
|
+
# Provides: nginx
|
|
17
|
+
# Required-Start: $all
|
|
18
|
+
# Required-Stop: $all
|
|
19
|
+
# Default-Start: 2 3 4 5
|
|
20
|
+
# Default-Stop: 0 1 6
|
|
21
|
+
# Short-Description: starts the nginx web server
|
|
22
|
+
# Description: starts nginx using start-stop-daemon
|
|
23
|
+
### END INIT INFO
|
|
24
|
+
|
|
25
|
+
PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
26
|
+
DAEMON=/opt/nginx/sbin/nginx
|
|
27
|
+
NAME=nginx
|
|
28
|
+
DESC=nginx
|
|
29
|
+
|
|
30
|
+
test -x $DAEMON || exit 0
|
|
31
|
+
|
|
32
|
+
# Include nginx defaults if available
|
|
33
|
+
if [ -f /etc/default/nginx ] ; then
|
|
34
|
+
. /etc/default/nginx
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
set -e
|
|
38
|
+
|
|
39
|
+
. /lib/lsb/init-functions
|
|
40
|
+
|
|
41
|
+
case "$1" in
|
|
42
|
+
start)
|
|
43
|
+
echo -n "Starting $DESC: "
|
|
44
|
+
start-stop-daemon --start --quiet --pidfile /opt/nginx/logs/$NAME.pid \
|
|
45
|
+
--exec $DAEMON -- $DAEMON_OPTS || true
|
|
46
|
+
echo "$NAME."
|
|
47
|
+
;;
|
|
48
|
+
stop)
|
|
49
|
+
echo -n "Stopping $DESC: "
|
|
50
|
+
start-stop-daemon --stop --quiet --pidfile /opt/nginx/logs/$NAME.pid \
|
|
51
|
+
--exec $DAEMON || true
|
|
52
|
+
echo "$NAME."
|
|
53
|
+
;;
|
|
54
|
+
restart|force-reload)
|
|
55
|
+
echo -n "Restarting $DESC: "
|
|
56
|
+
start-stop-daemon --stop --quiet --pidfile \
|
|
57
|
+
/opt/nginx/logs/$NAME.pid --exec $DAEMON || true
|
|
58
|
+
sleep 1
|
|
59
|
+
start-stop-daemon --start --quiet --pidfile \
|
|
60
|
+
/opt/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true
|
|
61
|
+
echo "$NAME."
|
|
62
|
+
;;
|
|
63
|
+
reload)
|
|
64
|
+
echo -n "Reloading $DESC configuration: "
|
|
65
|
+
start-stop-daemon --stop --signal HUP --quiet --pidfile /opt/nginx/logs/$NAME.pid \
|
|
66
|
+
--exec $DAEMON || true
|
|
67
|
+
echo "$NAME."
|
|
68
|
+
;;
|
|
69
|
+
status)
|
|
70
|
+
status_of_proc -p /opt/nginx/logs/$NAME.pid "$DAEMON" nginx && exit 0 || exit $?
|
|
71
|
+
;;
|
|
72
|
+
*)
|
|
73
|
+
N=/etc/init.d/$NAME
|
|
74
|
+
echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
|
|
75
|
+
exit 1
|
|
76
|
+
;;
|
|
77
|
+
esac
|
|
78
|
+
|
|
79
|
+
exit 0
|
|
80
|
+
' > /etc/init.d/nginx
|
|
81
|
+
|
|
82
|
+
chmod +x /etc/init.d/nginx
|
|
83
|
+
/etc/init.d/nginx start
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#
|
|
2
|
+
# install_redis.sh
|
|
3
|
+
# Sun Nov 22 20:46:43 -0200 2009
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
apt-get install -y cronolog
|
|
7
|
+
gem install rspec
|
|
8
|
+
|
|
9
|
+
# cd /usr/src
|
|
10
|
+
# git clone git://github.com/ezmobius/redis-rb.git
|
|
11
|
+
# cd redis-rb
|
|
12
|
+
# rake redis:install
|
|
13
|
+
# # rake install
|
|
14
|
+
|
|
15
|
+
cd /usr/src
|
|
16
|
+
wget -q http://redis.googlecode.com/files/redis-1.02.tar.gz
|
|
17
|
+
tar xzvf redis-1.02.tar.gz
|
|
18
|
+
cd redis-1.02/
|
|
19
|
+
make -j
|
|
20
|
+
cp redis.conf /etc
|
|
21
|
+
ln -s /usr/src/redis-1.02/redis-server /usr/bin/redis-server
|
|
22
|
+
ln -s /usr/src/redis-1.02/redis-cli /usr/bin/redis-cli
|
|
23
|
+
|
|
24
|
+
echo "
|
|
25
|
+
daemonize no
|
|
26
|
+
logfile stdout" >> /etc/redis.conf
|
|
27
|
+
echo "nohup /usr/bin/redis-server /etc/redis.conf | /usr/bin/cronolog /var/log/redis/redis.%Y-%m-%d.log 2>&1 &" > /etc/init.d/redis.sh
|
|
28
|
+
|
|
29
|
+
chmod +x /etc/init.d/redis.sh
|
|
30
|
+
|
|
31
|
+
#setsid bash -c "nohup /usr/bin/redis-server /etc/redis.conf | /usr/bin/cronolog /var/log/redis/redis.%Y-%m-%d.log 2>&1 &"
|
|
32
|
+
|
|
33
|
+
sed -i "s/loglevel debug/loglevel notice/g" /etc/redis.conf
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#
|
|
2
|
+
# install_dotfiles.sh
|
|
3
|
+
# Sun Nov 22 20:46:43 -0200 2009
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
apt-get install -y build-essential
|
|
7
|
+
apt-get install -y ruby irb1.8 ruby1.8-dev libreadline-ruby1.8 libruby1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8
|
|
8
|
+
|
|
9
|
+
cd /usr/src
|
|
10
|
+
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
|
|
11
|
+
tar xvzf rubygems-1.3.5.tgz
|
|
12
|
+
cd rubygems-1.3.5
|
|
13
|
+
sudo ruby setup.rb
|
|
14
|
+
|
|
15
|
+
sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem
|
|
16
|
+
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
|
|
17
|
+
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb
|
|
18
|
+
|
|
19
|
+
gem install rake
|
|
20
|
+
ln -s /usr/lib/ruby/1.8/bin/rake /usr/local/bin/rake
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#
|
|
2
|
+
# install_stackfu.sh
|
|
3
|
+
# Sun Nov 22 20:46:43 -0200 2009
|
|
4
|
+
#
|
|
5
|
+
|
|
6
|
+
echo "export RACK_ENV=production" >> ~/.private_profile
|
|
7
|
+
# echo "export PATH=`gem env|grep "EXECUTABLE DIRECTORY"|sed "s/ - EXECUTABLE DIRECTORY: //"`:\$PATH" >> ~/.private_profile
|
|
8
|
+
|
|
9
|
+
export RACK_ENV=production
|
|
10
|
+
# export PATH=`gem env|grep "EXECUTABLE DIRECTORY"|sed "s/ - EXECUTABLE DIRECTORY: //"`:$PATH
|
|
11
|
+
|
|
12
|
+
mkdir -p /var
|
|
13
|
+
|
|
14
|
+
gem install echoe
|
|
15
|
+
gem install rcov
|
|
16
|
+
|
|
17
|
+
cd /var
|
|
18
|
+
git clone git@github.com:fcoury/stackfu-core.git
|
|
19
|
+
|
|
20
|
+
cd /var/stackfu-core
|
|
21
|
+
rake install
|
|
22
|
+
|
|
23
|
+
cd /var
|
|
24
|
+
git clone git@github.com:fcoury/stackfu.git
|
|
25
|
+
cd /var/stackfu
|
|
26
|
+
rake install
|
|
27
|
+
|
|
28
|
+
cd /var
|
|
29
|
+
git clone git@github.com:fcoury/stackfu-api.git
|
|
30
|
+
|
|
31
|
+
cd /var/stackfu-api
|
|
32
|
+
rake install_dependencies
|
|
33
|
+
|
|
34
|
+
passenger_version=`gem search -l passenger | cut -d ')' -f 1 - | cut -d '(' -f 2 -`
|
|
35
|
+
|
|
36
|
+
echo "worker_processes 2;
|
|
37
|
+
|
|
38
|
+
events {
|
|
39
|
+
worker_connections 1024;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
http {
|
|
43
|
+
passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-2.2.7;
|
|
44
|
+
passenger_ruby /usr/local/bin/ruby;
|
|
45
|
+
|
|
46
|
+
include mime.types;
|
|
47
|
+
default_type application/octet-stream;
|
|
48
|
+
|
|
49
|
+
sendfile on;
|
|
50
|
+
|
|
51
|
+
keepalive_timeout 65;
|
|
52
|
+
|
|
53
|
+
server {
|
|
54
|
+
listen 80;
|
|
55
|
+
server_name api.stackfu.com;
|
|
56
|
+
root /var/stackfu-api/public;
|
|
57
|
+
passenger_enabled on;
|
|
58
|
+
|
|
59
|
+
error_page 500 502 503 504 /50x.html;
|
|
60
|
+
location = /50x.html {
|
|
61
|
+
root html;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
" > /opt/nginx/conf/nginx.conf
|
|
66
|
+
|
|
67
|
+
/etc/init.d/nginx restart
|
|
68
|
+
|
|
69
|
+
cd /var/stackfu-api
|
|
70
|
+
gem install god
|
|
71
|
+
god -c /var/stackfu-api/script/stackfu-api-resque.god --log /var/log/stackfu-queue.log
|
|
72
|
+
|
|
73
|
+
echo "nohup gem server | /usr/bin/cronolog /var/log/gemserver.%Y-%m-%d.log 2>&1 &" > /etc/init.d/gemserver
|
|
74
|
+
chmod +x /etc/init.d/gemserver
|
|
75
|
+
|
|
76
|
+
#setsid bash -c "nohup /etc/init.d/gemserver < /dev/null &"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
HTTP/1.1 422
|
|
2
|
+
Connection: Keep-Alive
|
|
3
|
+
Content-Type: application/xml
|
|
4
|
+
Date: Wed, 18 Nov 2009 06:36:24 GMT
|
|
5
|
+
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-06-12)
|
|
6
|
+
Content-Length: 101
|
|
7
|
+
|
|
8
|
+
<?xml version="1.0" encoding="UTF-8"?><errors><error>Operating system can't be empty</error></errors>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
HTTP/1.1 422
|
|
2
|
+
Connection: Keep-Alive
|
|
3
|
+
Content-Type: application/xml
|
|
4
|
+
Date: Wed, 18 Nov 2009 06:36:24 GMT
|
|
5
|
+
Server: WEBrick/1.3.1 (Ruby/1.8.7/2009-06-12)
|
|
6
|
+
Content-Length: 101
|
|
7
|
+
|
|
8
|
+
<?xml version="1.0" encoding="UTF-8"?><errors><error>Name already been taken</error></errors>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Sat, 21 Nov 2009 23:16:16 GMT
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
Content-Length: 943
|
|
6
|
+
|
|
7
|
+
[{"name":"my_stack","controls":[{"label":"Nome","name":"nome","order":0,"_type":"Textbox","id":"4b08748de1054e1477000002"},{"label":"Idade","name":"idade","order":1,"_type":"Numericbox","id":"4b08748de1054e1477000003"}],"operating_system":"ubuntu_810","tags":["mine","stack","is","nice"],"type":"stack","user_id":{"data":[75,8,116,141,225,5,78,20,119,0,0,1]},"validations":[{"data":"/etc/apache2","attrs":{},"type":"directory","id":"4b08748de1054e1477000005","error":"Apache was not installed properly"}],"executions":[{"script":null,"data":"#\n# echoe.sh\n# Echoes a variable\n#\n\necho \"\u003C%= nome %\u003E is \u003C%= age %\u003E years old\"\n","file":"echoer","description":"Echoer","id":"4b08748de1054e1477000007"}],"requirements":[{"data":"/var","attrs":{},"type":"directory","id":"4b08748de1054e1477000004","error":"You need /var folder before installing"}],"description":"This will deploy my stack","id":"4b08748de1054e1477000006"}]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Wed, 18 Nov 2009 17:54:51 GMT
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
Content-Length: 155
|
|
6
|
+
|
|
7
|
+
[{"name":"my_stack","controls":[],"operating_system":"ubuntu_810","user_id":"4b0433ebe1054e12da000001","description":null,"id":"4b0433ebe1054e12da000002"}]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Sat, 21 Nov 2009 23:16:16 GMT
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
Content-Length: 943
|
|
6
|
+
|
|
7
|
+
[{"name":"my_stack","controls":[{"label":"Nome","name":"nome","order":0,"_type":"Textbox","id":"4b08748de1054e1477000002"},{"label":"Idade","name":"idade","order":1,"_type":"Numericbox","id":"4b08748de1054e1477000003"}],"operating_system":"ubuntu_810","tags":["mine","stack","is","nice"],"type":"stack","user_id":{"data":[75,8,116,141,225,5,78,20,119,0,0,1]},"validations":[{"data":"/etc/apache2","attrs":{},"type":"directory","id":"4b08748de1054e1477000005","error":"Apache was not installed properly"}],"executions":[{"script":null,"data":"#\n# echoe.sh\n# Echoes a variable\n#\n\necho \"\u003C%= nome %\u003E is \u003C%= age %\u003E years old\"\n","file":"echoer","description":"Echoer","id":"4b08748de1054e1477000007"}],"requirements":[{"data":"/var","attrs":{},"type":"directory","id":"4b08748de1054e1477000004","error":"You need /var folder before installing"}],"description":"This will deploy my stack","id":"4b08748de1054e1477000006"}]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Sat, 21 Nov 2009 23:16:16 GMT
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
Content-Length: 943
|
|
6
|
+
|
|
7
|
+
[{"name":"blistack","controls":[{"label":"Nome","name":"nome","order":0,"_type":"Textbox","id":"4b08748de1054e1477000002"},{"label":"Idade","name":"idade","order":1,"_type":"Numericbox","id":"4b08748de1054e1477000003"}],"operating_system":"ubuntu_810","tags":["mine","stack","is","nice"],"type":"stack","user_id":{"data":[75,8,116,141,225,5,78,20,119,0,0,1]},"validations":[{"data":"/etc/apache2","attrs":{},"type":"directory","id":"4b08748de1054e1477000005","error":"Apache was not installed properly"}],"executions":[{"script":null,"data":"#\n# echoe.sh\n# Echoes a variable\n#\n\necho \"\u003C%= nome %\u003E is \u003C%= age %\u003E years old\"\n","file":"echoer","description":"Echoer","id":"4b08748de1054e1477000007"}],"requirements":[{"data":"/var","attrs":{},"type":"directory","id":"4b08748de1054e1477000004","error":"You need /var folder before installing"}],"description":"This will deploy my stack","id":"4b08748de1054e1477000006"}]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Wed, 18 Nov 2009 17:52:21 GMT
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
Content-Length: 314
|
|
6
|
+
|
|
7
|
+
[{"name":"my_stack","controls":[],"operating_system":"ubuntu_810","user_id":"4b0433ebe1054e12da000001","description":null,"id":"4b0433ebe1054e12da000002"},{"name":"another_stack","controls":[],"operating_system":"ubuntu_810","user_id":"4b0433ebe1054e12da000002","description":null,"id":"4b0433ebe1054e12da000002"}]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Fri, 04 Dec 2009 17:46:01 GMT
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
Content-Length: 13374
|
|
6
|
+
|
|
7
|
+
[{"name":"try","controls":[{"label":"Path","name":"path","order":0,"_type":"Textbox","id":"4b08a218e1054e1cf3000001"},{"label":"Port","name":"port","order":1,"_type":"Numericbox","id":"4b08a218e1054e1cf3000002"}],"operating_system":"ubuntu_810","_type":"stack","user_id":"4b08748de1054e1477000001","validations":[],"executions":[{"script":null,"data":"# \n# install.sh\n# Sun Nov 22 00:27:58 -0200 2009\n#\n\necho Installing \u003C%= path %\u003E at port \u003C%= port %\u003E\n","file":"install","description":"Install","id":"4b08a218e1054e1cf3000004"}],"requirements":[],"description":"Installs Try file system and automates the deployment using Fujitsu(tm) filters","id":"4b08a218e1054e1cf3000003"},{"name":"try_again","controls":[{"label":"Path","name":"path","order":0,"_type":"Textbox","id":"4b099c86e1054e1540000001"},{"label":"Port","name":"port","order":1,"_type":"Numericbox","id":"4b099c86e1054e1540000002"}],"operating_system":"ubuntu_904","_type":"stack","user_id":"4b08748de1054e1477000001","validations":[],"executions":[{"script":null,"data":"# \n# install.sh\n# Sun Nov 22 18:15:43 -0200 2009\n#\n\n# TODO: Replace the contents of this file with \"Install\"\necho \"Making path: \u003C%=path%\u003E ...\"\nmkdir -p \u003C%= path %\u003E\n\necho \"Port: \u003C%=port%\u003E ...\"\necho \"Port: \u003C%=port%\u003E ...\" \u003E \u003C%= path %\u003E/here.txt","file":"install","description":"Install","id":"4b099c86e1054e1540000004"}],"requirements":[],"description":null,"id":"4b099c86e1054e1540000003"},{"name":"dotfiles","controls":[{"label":"Github User","name":"github_user","order":0,"_type":"Textbox","id":"4b0c3e60e1054e1d66000001"},{"label":"Github Token","name":"github_token","order":1,"_type":"Textbox","id":"4b0c3e60e1054e1d66000002"},{"label":"User Name","name":"user_name","order":2,"_type":"Textbox","id":"4b0c3e60e1054e1d66000003"},{"label":"User Email","name":"user_email","order":3,"_type":"Textbox","id":"4b0c3e60e1054e1d66000004"},{"label":"Ssh Passphrase","name":"ssh_passphrase","order":4,"_type":"Textbox","id":"4b0c3e60e1054e1d66000005"}],"operating_system":"ubuntu_810","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":"4b0c3e60e1054e1d66000007"},{"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":"4b0c3e60e1054e1d66000008"}],"requirements":[],"description":"Installs GitHub support and my super Dotfiles to a server","id":"4b0c3e60e1054e1d66000006"},{"name":"lockme","controls":[],"operating_system":"ubuntu_904","type":"stack","user_id":"4b08748de1054e1477000001","validations":[],"executions":[{"script":null,"data":"# \n# lock.sh\n# Thu Nov 26 11:31:11 -0200 2009\n#\n\n# TODO: Replace the contents of this file with \"Lock\"\necho [\u003C%= Time.now %\u003E] Installing -- Lock\napt-get install apache2","file":"lock","description":"Lock","id":"4b0e83dae1054e08c5000002"}],"requirements":[],"description":null,"id":"4b0e83dae1054e08c5000001"},{"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"}]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Fri, 04 Dec 2009 17:46:01 GMT
|
|
4
|
+
Content-Type: application/json
|
|
5
|
+
Content-Length: 8901
|
|
6
|
+
|
|
7
|
+
[{"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"}]
|
|
File without changes
|
data/test/fixtures/users
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
HTTP/1.1 200 OK
|
|
2
|
+
Connection: close
|
|
3
|
+
Date: Sat, 14 Nov 2009 01:24:37 GMT
|
|
4
|
+
Content-Type: application/json;charset=utf-8
|
|
5
|
+
Content-Length: 245
|
|
6
|
+
|
|
7
|
+
[{"id":"4afe06b8e1054e1e00000001","_id":"4afe06b8e1054e1e00000001","settings":{"slicehost_token":"6ed05e7521dfb6a19c98a84f2d0a28fdffc1bf00e050fe7114a66d3049e9715e","webbynode_token":"abc123","webbynode_login":"fcoury@me.com"},"login":"flipper"}]
|