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 CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
data/citrin.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{citrin}
8
- s.version = "0.0.7"
8
+ s.version = "0.0.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Mike}]
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 $proj_owner.www-data $svn_path
20
+ chown -R $USER.rails-dev $svn_path
14
21
 
15
- echo "svn co svn+ssh://root@$(hostname -f)$svn_path"
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
@@ -11,12 +11,12 @@ if [ -z $name ] ; then
11
11
  exit 1;
12
12
  fi
13
13
 
14
- rm $prod_path$name
15
- rm -r $dev_path$name
16
- rm -r $svn_path
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
- puts `#{File.dirname(__FILE__)}/../../commands/#{command} #{args.join(" ")}`
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).citrin.ch" -o /dev/null`
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
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citrin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mike