casper 0.0.1
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/README.md +85 -0
- data/lib/casper.rb +115 -0
- data/lib/libxdo.rb +256 -0
- data/test/Vagrantfile +20 -0
- data/test/casper_test.rb +116 -0
- data/test/cookbooks/application/recipes/default.rb +6 -0
- data/test/cookbooks/application/recipes/vagrant.rb +1 -0
- data/test/cookbooks/application/templates/default/application.erb +11 -0
- data/test/cookbooks/apt/README.md +44 -0
- data/test/cookbooks/apt/files/default/apt-cacher +9 -0
- data/test/cookbooks/apt/files/default/apt-cacher.conf +144 -0
- data/test/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/test/cookbooks/apt/metadata.json +38 -0
- data/test/cookbooks/apt/metadata.rb +12 -0
- data/test/cookbooks/apt/recipes/cacher.rb +42 -0
- data/test/cookbooks/apt/recipes/default.rb +33 -0
- data/test/cookbooks/apt/recipes/proxy.rb +34 -0
- data/test/cookbooks/rvm/files/default/rvm-install-system-wide +99 -0
- data/test/cookbooks/rvm/files/default/source-rvm +1 -0
- data/test/cookbooks/rvm/recipes/default.rb +47 -0
- data/test/cookbooks/testing/files/default/Xwrapper.config +14 -0
- data/test/cookbooks/testing/files/default/xorg.conf +58 -0
- data/test/cookbooks/testing/recipes/default.rb +59 -0
- data/test/lib/public/jquery-ui.js +1012 -0
- data/test/lib/public/jquery.js +6240 -0
- data/test/lib/public/rxin_test.js +7 -0
- data/test/lib/server.rb +34 -0
- data/test/lib/test_helper.rb +69 -0
- metadata +166 -0
@@ -0,0 +1,144 @@
|
|
1
|
+
# This file has been modified by ./apt-proxy-to-apt-cacher
|
2
|
+
# Some lines may have been appended at the bottom of this file
|
3
|
+
# This file has been modified by /usr/share/apt-cacher/apt-proxy-to-apt-cacher
|
4
|
+
# Some lines may have been appended at the bottom of this file
|
5
|
+
#################################################################
|
6
|
+
# This is the config file for apt-cacher. On most Debian systems
|
7
|
+
# you can safely leave the defaults alone.
|
8
|
+
#################################################################
|
9
|
+
|
10
|
+
# cache_dir is used to set the location of the local cache. This can
|
11
|
+
# become quite large, so make sure it is somewhere with plenty of space.
|
12
|
+
cache_dir=/var/cache/apt-cacher
|
13
|
+
|
14
|
+
# The email address of the administrator is displayed in the info page
|
15
|
+
# and traffic reports.
|
16
|
+
admin_email=root@localhost
|
17
|
+
|
18
|
+
# For the daemon startup settings please edit the file /etc/default/apt-cacher.
|
19
|
+
|
20
|
+
# Daemon port setting, only useful in stand-alone mode. You need to run the
|
21
|
+
# daemon as root to use privileged ports (<1024).
|
22
|
+
daemon_port = 3142
|
23
|
+
|
24
|
+
# optional settings, user and group to run the daemon as. Make sure they have
|
25
|
+
# sufficient permissions on the cache and log directories. Comment the settings
|
26
|
+
# to run apt-cacher as the native user.
|
27
|
+
group=www-data
|
28
|
+
user=www-data
|
29
|
+
|
30
|
+
# optional setting, binds the listening daemon to one specified IP. Use IP
|
31
|
+
# ranges for more advanced configuration, see below.
|
32
|
+
# daemon_addr=localhost
|
33
|
+
|
34
|
+
# If your apt-cacher machine is directly exposed to the Internet and you are
|
35
|
+
# worried about unauthorised machines fetching packages through it, you can
|
36
|
+
# specify a list of IPv4 addresses which are allowed to use it and another
|
37
|
+
# list of IPv4 addresses which aren't.
|
38
|
+
# Localhost (127.0.0.1) is always allowed. Other addresses must be matched
|
39
|
+
# by allowed_hosts and not by denied_hosts to be permitted to use the cache.
|
40
|
+
# Setting allowed_hosts to "*" means "allow all".
|
41
|
+
# Otherwise the format is a comma-separated list containing addresses,
|
42
|
+
# optionally with masks (like 10.0.0.0/22), or ranges of addresses (two
|
43
|
+
# addresses separated by a hyphen, no masks, like '192.168.0.3-192.168.0.56').
|
44
|
+
allowed_hosts=*
|
45
|
+
denied_hosts=
|
46
|
+
|
47
|
+
# And similiarly for IPv6 with allowed_hosts_6 and denied_hosts_6.
|
48
|
+
# Note that IPv4-mapped IPv6 addresses (::ffff:w.x.y.z) are truncated to
|
49
|
+
# w.x.y.z and are handled as IPv4.
|
50
|
+
allowed_hosts_6=fec0::/16
|
51
|
+
denied_hosts_6=
|
52
|
+
|
53
|
+
# This thing can be done by Apache but is much simplier here - limit access to
|
54
|
+
# Debian mirrors based on server names in the URLs
|
55
|
+
#allowed_locations=ftp.uni-kl.de,ftp.nerim.net,debian.tu-bs.de
|
56
|
+
|
57
|
+
# Apt-cacher can generate usage reports every 24 hours if you set this
|
58
|
+
# directive to 1. You can view the reports in a web browser by pointing
|
59
|
+
# to your cache machine with '/apt-cacher/report' on the end, like this:
|
60
|
+
# http://yourcache.example.com/apt-cacher/report
|
61
|
+
# Generating reports is very fast even with many thousands of logfile
|
62
|
+
# lines, so you can safely turn this on without creating much
|
63
|
+
# additional system load.
|
64
|
+
generate_reports=1
|
65
|
+
|
66
|
+
# Apt-cacher can clean up its cache directory every 24 hours if you set
|
67
|
+
# this directive to 1. Cleaning the cache can take some time to run
|
68
|
+
# (generally in the order of a few minutes) and removes all package
|
69
|
+
# files that are not mentioned in any existing 'Packages' lists. This
|
70
|
+
# has the effect of deleting packages that have been superseded by an
|
71
|
+
# updated 'Packages' list.
|
72
|
+
clean_cache=1
|
73
|
+
|
74
|
+
# The directory to use for apt-cacher access and error logs.
|
75
|
+
# The access log records every request in the format:
|
76
|
+
# date-time|client ip address|HIT/MISS/EXPIRED|object size|object name
|
77
|
+
# The error log is slightly more free-form, and is also used for debug
|
78
|
+
# messages if debug mode is turned on.
|
79
|
+
# Note that the old 'logfile' and 'errorfile' directives are
|
80
|
+
# deprecated: if you set them explicitly they will be honoured, but it's
|
81
|
+
# better to just get rid of them from old config files.
|
82
|
+
logdir=/var/log/apt-cacher
|
83
|
+
|
84
|
+
# apt-cacher can use different methods to decide whether package lists need to
|
85
|
+
# be updated,
|
86
|
+
# A) looking at the age of the cached files
|
87
|
+
# B) getting HTTP header from server and comparing that with cached data. This
|
88
|
+
# method is more reliable and avoids desynchronisation of data and index files
|
89
|
+
# but needs to transfer few bytes from the server every time somebody requests
|
90
|
+
# the files ("apt-get update")
|
91
|
+
# Set the following value to the maximum age (in hours) for method A or to 0
|
92
|
+
# for method B
|
93
|
+
expire_hours=0
|
94
|
+
|
95
|
+
# Apt-cacher can pass all its requests to an external http proxy like
|
96
|
+
# Squid, which could be very useful if you are using an ISP that blocks
|
97
|
+
# port 80 and requires all web traffic to go through its proxy. The
|
98
|
+
# format is 'hostname:port', eg: 'proxy.example.com:8080'.
|
99
|
+
http_proxy=proxy.example.com:8080
|
100
|
+
|
101
|
+
# Use of an external proxy can be turned on or off with this flag.
|
102
|
+
# Value should be either 0 (off) or 1 (on).
|
103
|
+
use_proxy=0
|
104
|
+
|
105
|
+
# External http proxy sometimes need authentication to get full access. The
|
106
|
+
# format is 'username:password'.
|
107
|
+
http_proxy_auth=proxyuser:proxypass
|
108
|
+
|
109
|
+
# Use of external proxy authentication can be turned on or off with this flag.
|
110
|
+
# Value should be either 0 (off) or 1 (on).
|
111
|
+
use_proxy_auth=0
|
112
|
+
|
113
|
+
# Rate limiting sets the maximum bandwidth in bytes per second to use
|
114
|
+
# for fetching packages. Syntax is fully defined in 'man wget'.
|
115
|
+
# Use 'k' or 'm' to use kilobits or megabits / second: eg, 'limit=25k'.
|
116
|
+
# Use 0 or a negative value for no rate limiting.
|
117
|
+
limit=0
|
118
|
+
|
119
|
+
# Debug mode makes apt-cacher spew a lot of extra debug junk to the
|
120
|
+
# error log (whose location is defined with the 'logdir' directive).
|
121
|
+
# Leave this off unless you need it, or your error log will get very
|
122
|
+
# big. Acceptable values are 0 or 1.
|
123
|
+
debug=0
|
124
|
+
|
125
|
+
# Adapt the line in the usage info web page to match your server configuration
|
126
|
+
# example_sources_line=deb http://<b>my.cacher.server:3142/</b>ftp.au.debian.org/debian unstable main contrib non-free
|
127
|
+
|
128
|
+
# Print a 410 (Gone) HTTP message with the specified text when accessed via
|
129
|
+
# CGI. Useful to tell users to adapt their sources.list files when the
|
130
|
+
# apt-cacher server is beeing relocated (via apt-get's error messages while
|
131
|
+
# running "update")
|
132
|
+
#cgi_advise_to_use = Please use http://cacheserver:3142/ as apt-cacher access URL
|
133
|
+
#cgi_advise_to_use = Server relocated. To change sources.list, run perl -pe "s,/apt-cacher\??,:3142," -i /etc/apt/sources.list
|
134
|
+
|
135
|
+
# Server mapping - this allows to hide real server names behind virtual paths
|
136
|
+
# that appear in the access URL. This method is known from apt-proxy. This is
|
137
|
+
# also the only method to use FTP access to the target hosts. The syntax is simple, the part of the beginning to replace, followed by a list of mirror urls, all space separated. Multiple profile are separated by semicolons
|
138
|
+
# path_map = debian ftp.uni-kl.de/pub/linux/debian ftp2.de.debian.org/debian ; ubuntu archive.ubuntu.com/ubuntu ; security security.debian.org/debian-security ftp2.de.debian.org/debian-security
|
139
|
+
# Note that you need to specify all target servers in the allowed_locations
|
140
|
+
# options if you make use of it. Also note that the paths should not overlap
|
141
|
+
# each other. FTP access method not supported yet, maybe in the future.
|
142
|
+
|
143
|
+
# extra setting from apt-proxy configuration
|
144
|
+
path_map = ubuntu us.archive.ubuntu.com/ubuntu ; ubuntu-security security.ubuntu.com/ubuntu ; debian debian.osuosl.org/debian/ ; security security.debian.org/debian-security
|
@@ -0,0 +1,50 @@
|
|
1
|
+
[DEFAULT]
|
2
|
+
;; All times are in seconds, but you can add a suffix
|
3
|
+
;; for minutes(m), hours(h) or days(d)
|
4
|
+
|
5
|
+
;; commented out address so apt-proxy will listen on all IPs
|
6
|
+
;; address = 127.0.0.1
|
7
|
+
port = 9999
|
8
|
+
cache_dir = /var/cache/apt-proxy
|
9
|
+
|
10
|
+
;; Control files (Packages/Sources/Contents) refresh rate
|
11
|
+
min_refresh_delay = 1s
|
12
|
+
complete_clientless_downloads = 1
|
13
|
+
|
14
|
+
;; Debugging settings.
|
15
|
+
debug = all:4 db:0
|
16
|
+
|
17
|
+
time = 30
|
18
|
+
passive_ftp = on
|
19
|
+
|
20
|
+
;;--------------------------------------------------------------
|
21
|
+
;; Cache housekeeping
|
22
|
+
|
23
|
+
cleanup_freq = 1d
|
24
|
+
max_age = 120d
|
25
|
+
max_versions = 3
|
26
|
+
|
27
|
+
;;---------------------------------------------------------------
|
28
|
+
;; Backend servers
|
29
|
+
;;
|
30
|
+
;; Place each server in its own [section]
|
31
|
+
|
32
|
+
[ubuntu]
|
33
|
+
; Ubuntu archive
|
34
|
+
backends =
|
35
|
+
http://us.archive.ubuntu.com/ubuntu
|
36
|
+
|
37
|
+
[ubuntu-security]
|
38
|
+
; Ubuntu security updates
|
39
|
+
backends = http://security.ubuntu.com/ubuntu
|
40
|
+
|
41
|
+
[debian]
|
42
|
+
;; Backend servers, in order of preference
|
43
|
+
backends =
|
44
|
+
http://debian.osuosl.org/debian/
|
45
|
+
|
46
|
+
[security]
|
47
|
+
;; Debian security archive
|
48
|
+
backends =
|
49
|
+
http://security.debian.org/debian-security
|
50
|
+
http://ftp2.de.debian.org/debian-security
|
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"recommendations": {
|
3
|
+
},
|
4
|
+
"attributes": {
|
5
|
+
},
|
6
|
+
"maintainer": "Opscode, Inc.",
|
7
|
+
"suggestions": {
|
8
|
+
},
|
9
|
+
"dependencies": {
|
10
|
+
},
|
11
|
+
"maintainer_email": "cookbooks@opscode.com",
|
12
|
+
"conflicting": {
|
13
|
+
},
|
14
|
+
"platforms": {
|
15
|
+
"debian": [
|
16
|
+
|
17
|
+
],
|
18
|
+
"ubuntu": [
|
19
|
+
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"license": "Apache 2.0",
|
23
|
+
"version": "0.9.1",
|
24
|
+
"providing": {
|
25
|
+
},
|
26
|
+
"recipes": {
|
27
|
+
"apt::proxy": "Set up an APT proxy",
|
28
|
+
"apt": "Runs apt-get update during compile phase and sets up preseed directories",
|
29
|
+
"apt::cacher": "Set up an APT cache"
|
30
|
+
},
|
31
|
+
"replacing": {
|
32
|
+
},
|
33
|
+
"name": "apt",
|
34
|
+
"description": "Configures apt and apt services",
|
35
|
+
"groupings": {
|
36
|
+
},
|
37
|
+
"long_description": ""
|
38
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
maintainer "Opscode, Inc."
|
2
|
+
maintainer_email "cookbooks@opscode.com"
|
3
|
+
license "Apache 2.0"
|
4
|
+
description "Configures apt and apt services"
|
5
|
+
version "0.9.1"
|
6
|
+
recipe "apt", "Runs apt-get update during compile phase and sets up preseed directories"
|
7
|
+
recipe "apt::cacher", "Set up an APT cache"
|
8
|
+
recipe "apt::proxy", "Set up an APT proxy"
|
9
|
+
|
10
|
+
%w{ ubuntu debian }.each do |os|
|
11
|
+
supports os
|
12
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt
|
3
|
+
# Recipe:: cacher
|
4
|
+
#
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
package "apt-cacher" do
|
20
|
+
action :install
|
21
|
+
end
|
22
|
+
|
23
|
+
service "apt-cacher" do
|
24
|
+
supports :restart => true, :status => false
|
25
|
+
action [ :enable, :start ]
|
26
|
+
end
|
27
|
+
|
28
|
+
cookbook_file "/etc/apt-cacher/apt-cacher.conf" do
|
29
|
+
source "apt-cacher.conf"
|
30
|
+
owner "root"
|
31
|
+
group "root"
|
32
|
+
mode 0644
|
33
|
+
notifies :restart, resources(:service => "apt-cacher")
|
34
|
+
end
|
35
|
+
|
36
|
+
cookbook_file "/etc/default/apt-cacher" do
|
37
|
+
source "apt-cacher"
|
38
|
+
owner "root"
|
39
|
+
group "root"
|
40
|
+
mode 0644
|
41
|
+
notifies :restart, resources(:service => "apt-cacher")
|
42
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
e = execute "apt-get update" do
|
21
|
+
action :nothing
|
22
|
+
end
|
23
|
+
|
24
|
+
e.run_action(:run)
|
25
|
+
|
26
|
+
%w{/var/cache/local /var/cache/local/preseeding}.each do |dirname|
|
27
|
+
directory dirname do
|
28
|
+
owner "root"
|
29
|
+
group "root"
|
30
|
+
mode 0755
|
31
|
+
action :create
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt
|
3
|
+
# Recipe:: proxy
|
4
|
+
#
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
package "apt-proxy" do
|
20
|
+
action :install
|
21
|
+
end
|
22
|
+
|
23
|
+
service "apt-proxy" do
|
24
|
+
supports :restart => true, :status => false
|
25
|
+
action [ :enable, :start ]
|
26
|
+
end
|
27
|
+
|
28
|
+
cookbook_file "/etc/apt-proxy/apt-proxy-v2.conf" do
|
29
|
+
source "apt-proxy-v2.conf"
|
30
|
+
owner "root"
|
31
|
+
group "root"
|
32
|
+
mode 0644
|
33
|
+
notifies :restart, resources(:service => "apt-proxy")
|
34
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
__rvm_system_wide_permissions() {
|
4
|
+
[[ -z "$1" ]] && return 1
|
5
|
+
chown -R root:"$rvm_group_name" "$1"
|
6
|
+
chmod -R g+w "$1"
|
7
|
+
[[ -d "$1" ]] && find "$1" -type d | xargs -n1 chmod g+s
|
8
|
+
}
|
9
|
+
|
10
|
+
# Require root to install it.
|
11
|
+
if [[ "$(whoami)" != "root" ]]; then
|
12
|
+
echo "Please rerun this installer as root." >&2
|
13
|
+
exit 1
|
14
|
+
# Check for the presence of git.
|
15
|
+
elif ! command -v git >/dev/null 2>&1 ; then
|
16
|
+
echo "Please ensure git is installed and available in PATH to continue." >&2
|
17
|
+
exit 1
|
18
|
+
elif [[ "$(uname)" != "Linux" ]]; then
|
19
|
+
echo "The rvm system wide installer is currently Linux only." >&2
|
20
|
+
exit 1
|
21
|
+
fi
|
22
|
+
|
23
|
+
# Load the rvm config.
|
24
|
+
if [[ -z "$rvm_ignore_rvmrc" ]]; then
|
25
|
+
[[ -s /etc/rvmrc ]] && source /etc/rvmrc
|
26
|
+
[[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
|
27
|
+
fi
|
28
|
+
|
29
|
+
rvm_path="${rvm_path:-"/usr/local/rvm"}"
|
30
|
+
export rvm_selfcontained=0
|
31
|
+
|
32
|
+
rvm_group_name="${rvm_group_name:-"rvm"}"
|
33
|
+
if cat /etc/group | cut -d: -f1 | \grep -q "^${rvm_group_name}$"; then
|
34
|
+
echo "Group exists, proceeding with installation."
|
35
|
+
else
|
36
|
+
echo "Creating the group '$rvm_group_name'"
|
37
|
+
groupadd -f "$rvm_group_name"
|
38
|
+
fi
|
39
|
+
echo "Adding $(whoami) the '$rvm_group_name'"
|
40
|
+
usermod -a -G "$rvm_group_name" "$(whoami)"
|
41
|
+
|
42
|
+
echo "Creating the destination dir and making sure the permissions are correct"
|
43
|
+
\mkdir -p "$rvm_path"
|
44
|
+
__rvm_system_wide_permissions "$rvm_path"
|
45
|
+
|
46
|
+
\mkdir -p "$rvm_path/src/"
|
47
|
+
builtin cd "$rvm_path/src"
|
48
|
+
|
49
|
+
\rm -rf ./rvm/
|
50
|
+
|
51
|
+
git clone --depth 1 git://github.com/wayneeseguin/rvm.git || git clone http://github.com/wayneeseguin/rvm.git
|
52
|
+
|
53
|
+
builtin cd rvm
|
54
|
+
|
55
|
+
echo "Running the install script."
|
56
|
+
bash ./scripts/install "$@"
|
57
|
+
|
58
|
+
__rvm_system_wide_permissions "$rvm_path"
|
59
|
+
|
60
|
+
echo "Setting up group permissions"
|
61
|
+
rvm_parent_dir="$(dirname "$rvm_path")"
|
62
|
+
for dir in bin share/man; do
|
63
|
+
__rvm_system_wide_permissions "$rvm_parent_dir/$dir"
|
64
|
+
done; unset dir
|
65
|
+
|
66
|
+
echo "Generating system wide rvmrc"
|
67
|
+
\rm -f /etc/rvmrc
|
68
|
+
\touch /etc/rvmrc
|
69
|
+
cat > /etc/rvmrc <<END_OF_RVMRC
|
70
|
+
# Setup default configuration for rvm.
|
71
|
+
# If an rvm install exists in the home directory, don't load this.'
|
72
|
+
if [[ ! -s "\$HOME/.rvm/scripts/rvm" ]]; then
|
73
|
+
umask g+w
|
74
|
+
export rvm_selfcontained=0
|
75
|
+
export rvm_prefix="$rvm_parent_dir/"
|
76
|
+
fi
|
77
|
+
END_OF_RVMRC
|
78
|
+
|
79
|
+
echo "Generating $rvm_parent_dir/lib/rvm to load rvm"
|
80
|
+
\rm -f "$rvm_parent_dir/lib/rvm"
|
81
|
+
\touch "$rvm_parent_dir/lib/rvm"
|
82
|
+
cat > "$rvm_parent_dir/lib/rvm" <<END_OF_RVM_SH
|
83
|
+
# Automatically source rvm
|
84
|
+
if [[ -s "\$HOME/.rvm/scripts/rvm" ]]; then
|
85
|
+
source "\$HOME/.rvm/scripts/rvm"
|
86
|
+
elif [[ -s "/usr/local/rvm/scripts/rvm" ]]; then
|
87
|
+
source "/usr/local/rvm/scripts/rvm"
|
88
|
+
fi
|
89
|
+
END_OF_RVM_SH
|
90
|
+
|
91
|
+
echo "Correct permissions on rvmrc and the rvm loader"
|
92
|
+
# Finally, ensure the rvmrc is owned by the group.
|
93
|
+
for file in /etc/rvmrc "$rvm_parent_dir/lib/rvm" ; do
|
94
|
+
__rvm_system_wide_permissions "$file"
|
95
|
+
done; unset file
|
96
|
+
|
97
|
+
echo "RVM is now installed. To use, source '$rvm_parent_dir/lib/rvm' to your shell profile."
|
98
|
+
|
99
|
+
unset rvm_parent_dir
|
@@ -0,0 +1 @@
|
|
1
|
+
[[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" # This loads RVM into a shell session.
|
@@ -0,0 +1,47 @@
|
|
1
|
+
package 'zlib1g'
|
2
|
+
package 'zlib1g-dev'
|
3
|
+
package 'libssl-dev'
|
4
|
+
package "curl"
|
5
|
+
|
6
|
+
cookbook_file '/tmp/rvm-install-system-wide' do
|
7
|
+
source 'rvm-install-system-wide'
|
8
|
+
mode 0644
|
9
|
+
end
|
10
|
+
|
11
|
+
cookbook_file '/tmp/source-rvm' do
|
12
|
+
source 'source-rvm'
|
13
|
+
mode 0644
|
14
|
+
end
|
15
|
+
|
16
|
+
bash "install rvm" do
|
17
|
+
environment "HOME"=>"/root"
|
18
|
+
code <<-BASH
|
19
|
+
bash < /tmp/rvm-install-system-wide
|
20
|
+
BASH
|
21
|
+
not_if { ::FileTest.exists?("/usr/local/rvm") }
|
22
|
+
end
|
23
|
+
|
24
|
+
bash "install ruby 1.9.2" do
|
25
|
+
environment "HOME"=>"/root"
|
26
|
+
code <<-BASH
|
27
|
+
source '/usr/local/rvm/scripts/rvm'
|
28
|
+
rvm package install readline
|
29
|
+
rvm install ruby-1.9.2 -C --with-readline-dir=$HOME/.rvm/usr
|
30
|
+
BASH
|
31
|
+
not_if { ::FileTest.exists?("/usr/local/rvm/rubies/ruby-1.9.2") }
|
32
|
+
end
|
33
|
+
|
34
|
+
bash "source rvm in bashrc" do
|
35
|
+
code <<-BASH
|
36
|
+
cat /tmp/source-rvm >> ~/.bashrc
|
37
|
+
BASH
|
38
|
+
not_if "type rvm | head -n 1 | grep 'is a function'"
|
39
|
+
end
|
40
|
+
|
41
|
+
bash "source rvm in bashrc for root" do
|
42
|
+
user "root"
|
43
|
+
code <<-BASH
|
44
|
+
cat /tmp/source-rvm >> ~/.bashrc
|
45
|
+
BASH
|
46
|
+
not_if "type rvm | head -n 1 | grep 'is a function'"
|
47
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Xwrapper.config (Debian X Window System server wrapper configuration file)
|
2
|
+
#
|
3
|
+
# This file was generated by the post-installation script of the x11-common
|
4
|
+
# package using values from the debconf database.
|
5
|
+
#
|
6
|
+
# See the Xwrapper.config(5) manual page for more information.
|
7
|
+
#
|
8
|
+
# This file is automatically updated on upgrades of the x11-common package
|
9
|
+
# *only* if it has not been modified since the last upgrade of that package.
|
10
|
+
#
|
11
|
+
# If you have edited this file but would like it to be automatically updated
|
12
|
+
# again, run the following command as root:
|
13
|
+
# dpkg-reconfigure x11-common
|
14
|
+
allowed_users=anybody
|
@@ -0,0 +1,58 @@
|
|
1
|
+
Section "Device"
|
2
|
+
Identifier "VESA Framebuffer"
|
3
|
+
Driver "vesa"
|
4
|
+
EndSection
|
5
|
+
|
6
|
+
Section "Monitor"
|
7
|
+
Identifier "My Monitor"
|
8
|
+
HorizSync 31.5 - 150.0
|
9
|
+
VertRefresh 75-85
|
10
|
+
EndSection
|
11
|
+
|
12
|
+
Section "Screen"
|
13
|
+
Identifier "Screen 1"
|
14
|
+
Device "VESA Framebuffer"
|
15
|
+
Monitor "My Monitor"
|
16
|
+
|
17
|
+
# If your card can handle it, a higher default color depth (like 24 or 32)
|
18
|
+
# is highly recommended.
|
19
|
+
# DefaultDepth 8
|
20
|
+
# DefaultDepth 16
|
21
|
+
DefaultDepth 24
|
22
|
+
# DefaultDepth 32
|
23
|
+
|
24
|
+
# "1024x768" is also a conservative usable default resolution. If you
|
25
|
+
# have a better monitor, feel free to try resolutions such as
|
26
|
+
# "1152x864", "1280x1024", "1600x1200", and "1800x1400" (or whatever your
|
27
|
+
# card/monitor can produce)
|
28
|
+
Subsection "Display"
|
29
|
+
Depth 8
|
30
|
+
Modes "1024x768" "800x600" "640x480"
|
31
|
+
EndSubsection
|
32
|
+
|
33
|
+
Subsection "Display"
|
34
|
+
Depth 16
|
35
|
+
Modes "1024x768" "800x600" "640x480"
|
36
|
+
EndSubsection
|
37
|
+
|
38
|
+
Subsection "Display"
|
39
|
+
Depth 24
|
40
|
+
Modes "1024x768" "800x600" "640x480"
|
41
|
+
EndSubsection
|
42
|
+
|
43
|
+
Subsection "Display"
|
44
|
+
Depth 32
|
45
|
+
Modes "1024x768" "800x600" "640x480"
|
46
|
+
EndSubsection
|
47
|
+
EndSection
|
48
|
+
|
49
|
+
Section "ServerLayout"
|
50
|
+
# The Identifier line must be present
|
51
|
+
Identifier "Simple Layout"
|
52
|
+
# Each Screen line specifies a Screen section name, and optionally
|
53
|
+
# the relative position of other screens. The four names after
|
54
|
+
# primary screen name are the screens to the top, bottom, left and right
|
55
|
+
# of the primary screen. In this example, screen 2 is located to the
|
56
|
+
# right of screen 1.
|
57
|
+
Screen "Screen 1"
|
58
|
+
EndSection
|
@@ -0,0 +1,59 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: testing
|
3
|
+
# Recipe:: default
|
4
|
+
#
|
5
|
+
%w( contest stories capybara sinatra haml nokogiri rubyzip ffi ).each do |dep|
|
6
|
+
gem_package dep
|
7
|
+
|
8
|
+
execute "install #{dep} for 1.9.2" do
|
9
|
+
user "root"
|
10
|
+
command %Q(rvm 1.9.2 gem install #{dep} --no-ri --no-rdoc)
|
11
|
+
not_if "rvm 1.9.2 gem list | grep #{dep}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
gem_package "ruby-debug"
|
16
|
+
execute "install ruby-debug for 1.9.2" do
|
17
|
+
user "root"
|
18
|
+
command %Q(rvm 1.9.2 gem install ruby-debug19 --no-ri --no-rdoc)
|
19
|
+
not_if "rvm 1.9.2 gem list | grep ruby-debug"
|
20
|
+
end
|
21
|
+
|
22
|
+
package "xinit"
|
23
|
+
package "x11-xserver-utils"
|
24
|
+
package "firefox"
|
25
|
+
|
26
|
+
# TODO: install from source for --sync option on mouseevents if needed,
|
27
|
+
# requires xorg-dev which is heavy
|
28
|
+
package "xorg-dev"
|
29
|
+
script "xdotool_from_source" do
|
30
|
+
not_if "test -x /usr/local/bin/xdotool"
|
31
|
+
interpreter "bash"
|
32
|
+
user "root"
|
33
|
+
cwd "/tmp"
|
34
|
+
code <<-BASH
|
35
|
+
wget http://semicomplete.googlecode.com/files/xdotool-2.20100818.3004.tar.gz
|
36
|
+
tar xzvf xdotool-2.20100818.3004.tar.gz
|
37
|
+
cd xdotool-2.20100818.3004
|
38
|
+
make all install
|
39
|
+
BASH
|
40
|
+
end
|
41
|
+
|
42
|
+
# Allows anybody to access the X session (so you can remote it from SSH)
|
43
|
+
cookbook_file "/etc/X11/Xwrapper.config" do
|
44
|
+
source "Xwrapper.config"
|
45
|
+
mode "0600"
|
46
|
+
end
|
47
|
+
|
48
|
+
# Sets vagrant user's X display to the one on the VM
|
49
|
+
execute "export DISPLAY in profile" do
|
50
|
+
not_if "cat ~/.profile | grep DISPLAY"
|
51
|
+
user "vagrant"
|
52
|
+
command %Q{echo "export DISPLAY=:0.0" >> ~/.profile}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Sets VM to 1024x768 @ 24-bit color depth
|
56
|
+
cookbook_file "/etc/X11/xorg.conf" do
|
57
|
+
source "xorg.conf"
|
58
|
+
mode "0644"
|
59
|
+
end
|