citrin 0.0.7 → 0.0.8
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/VERSION +1 -1
- data/citrin.gemspec +1 -1
- data/commands/create_svn +22 -4
- data/commands/remove_railsapp +5 -5
- data/lib/citrin/cli.rb +5 -1
- data/test/test_citrin.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
data/citrin.gemspec
CHANGED
data/commands/create_svn
CHANGED
@@ -1,18 +1,36 @@
|
|
1
1
|
#!/bin/bash
|
2
|
-
name=$1
|
3
2
|
|
3
|
+
name=$1
|
4
4
|
if [ -z $name ] ; then
|
5
|
-
echo "usage: $0 appname [env]"
|
5
|
+
echo "usage: $0 appname [env] [options]"
|
6
6
|
exit 1;
|
7
7
|
fi
|
8
|
+
|
9
|
+
env=$2
|
10
|
+
if [ -z $env ] ; then
|
11
|
+
env="prod"
|
12
|
+
fi
|
13
|
+
|
8
14
|
proj_owner=www-data
|
9
15
|
svn_path=/var/svn/$name/
|
16
|
+
|
10
17
|
function create_svn {
|
11
18
|
echo "CREATING SVN"
|
12
19
|
svnadmin create $svn_path
|
13
|
-
chown -R $
|
20
|
+
chown -R $USER.rails-dev $svn_path
|
14
21
|
|
15
|
-
echo "svn co svn+ssh
|
22
|
+
echo "svn co svn+ssh://$(hostname -f)$svn_path"
|
16
23
|
}
|
17
24
|
|
18
25
|
create_svn
|
26
|
+
|
27
|
+
for var1 in "$@"
|
28
|
+
do
|
29
|
+
case $var1 in
|
30
|
+
--with-rails)
|
31
|
+
cd /var/www/rails_apps/$env/
|
32
|
+
svn co svn+ssh://$(hostname -f)$svn_path $name/
|
33
|
+
rails new $name
|
34
|
+
;;
|
35
|
+
esac
|
36
|
+
done
|
data/commands/remove_railsapp
CHANGED
@@ -11,12 +11,12 @@ if [ -z $name ] ; then
|
|
11
11
|
exit 1;
|
12
12
|
fi
|
13
13
|
|
14
|
-
rm $prod_path$name
|
15
|
-
rm -
|
16
|
-
rm -
|
14
|
+
rm -rf $prod_path$name
|
15
|
+
rm -rf $dev_path$name
|
16
|
+
rm -rf $svn_path
|
17
17
|
|
18
18
|
|
19
|
-
rm /etc/apache2/sites-enabled/prod.$name.conf
|
20
|
-
rm /etc/apache2/sites-enabled/dev.$name.conf
|
19
|
+
rm -f /etc/apache2/sites-enabled/prod.$name.conf
|
20
|
+
rm -f /etc/apache2/sites-enabled/dev.$name.conf
|
21
21
|
|
22
22
|
sudo service apache2 reload
|
data/lib/citrin/cli.rb
CHANGED
@@ -4,7 +4,11 @@ class Citrin::CLI
|
|
4
4
|
|
5
5
|
def self.start(*args)
|
6
6
|
command = args.shift.strip rescue "help"
|
7
|
-
|
7
|
+
if command == "create_svn_rails"
|
8
|
+
puts `#{File.dirname(__FILE__)}/../../commands/create_svn #{args.join(" ")} --with-rails`
|
9
|
+
else
|
10
|
+
puts `#{File.dirname(__FILE__)}/../../commands/#{command} #{args.join(" ")}`
|
11
|
+
end
|
8
12
|
end
|
9
13
|
|
10
14
|
end
|
data/test/test_citrin.rb
CHANGED
@@ -16,7 +16,7 @@ class TestCitrin < Test::Unit::TestCase
|
|
16
16
|
Citrin::CLI.start("create_webserver", @appname)
|
17
17
|
assert File.exists?("/etc/apache2/sites-enabled/prod.#{@appname}.conf")
|
18
18
|
`cd /var/www/rails_apps/prod/ && rails new #{@appname}`
|
19
|
-
statuscode = `curl -sL -w "%{http_code}" "#{@appname}.$(hostname)
|
19
|
+
statuscode = `curl -sL -w "%{http_code}" "#{@appname}.$(hostname -f)" -o /dev/null`
|
20
20
|
assert_equal "200", statuscode
|
21
21
|
cleanup
|
22
22
|
end
|
metadata
CHANGED