syncwrap 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.rdoc CHANGED
@@ -1,2 +1,10 @@
1
+ === 1.1.0 (2012-9-13)
2
+ * Add (boxed-)geminabox provisions and deploy task
3
+ * Upgrade to (default) jdk-ora-1.7.0_05-x64
4
+ * RHEL version of test Rakefile, init.d/iyyov
5
+ * Fix RHEL yum args
6
+ * Silence user_exist? id command output
7
+ * iyyov_install_rundir as user_run
8
+
1
9
  === 1.0.0 (2012-7-15)
2
10
  * Initial release.
data/Manifest.txt CHANGED
@@ -15,6 +15,7 @@ lib/syncwrap.rb
15
15
  lib/syncwrap/common.rb
16
16
  lib/syncwrap/distro.rb
17
17
  lib/syncwrap/ec2.rb
18
+ lib/syncwrap/geminabox.rb
18
19
  lib/syncwrap/hashdot.rb
19
20
  lib/syncwrap/iyyov.rb
20
21
  lib/syncwrap/java.rb
@@ -26,3 +27,4 @@ lib/syncwrap/ubuntu.rb
26
27
  lib/syncwrap/user_run.rb
27
28
  test/test_syncwrap.rb
28
29
  usr/local/bin/jgem
30
+ var/iyyov/jobs.rb
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ require 'syncwrap/java'
11
11
  require 'syncwrap/hashdot'
12
12
  require 'syncwrap/jruby'
13
13
  require 'syncwrap/iyyov'
14
- require 'syncwrap/ubuntu'
14
+ require 'syncwrap/rhel'
15
15
  require 'syncwrap/postgresql'
16
16
  require 'syncwrap/remote_task'
17
17
 
@@ -20,8 +20,8 @@ class SyncWrapper
20
20
  include SyncWrap::Hashdot
21
21
  include SyncWrap::JRuby
22
22
  include SyncWrap::Iyyov
23
- include SyncWrap::Ubuntu
24
- include SyncWrap::PostgreSQL::Ubuntu
23
+ include SyncWrap::RHEL
24
+ include SyncWrap::PostgreSQL
25
25
 
26
26
  include SyncWrap::RemoteTask
27
27
 
@@ -48,6 +48,13 @@ class SyncWrapper
48
48
  iyyov_install
49
49
  end
50
50
 
51
+ desc "Deploy Geminabox Daemon"
52
+ remote_task :geminabox_deploy do
53
+ iyyov_install_jobs do
54
+ geminabox_install
55
+ end
56
+ end
57
+
51
58
  desc "Deploy PostgreSQL"
52
59
  remote_task :pg_deploy do
53
60
  pg_install
data/etc/init.d/iyyov CHANGED
@@ -1,19 +1,13 @@
1
- #!/bin/sh
1
+ #!/bin/bash
2
+ #
3
+ # iyyov Startup script for Iyyov monitoring daemon
4
+ #
5
+ # chkconfig: 2345 88 12
6
+ # description: Iyyov monitoring daemon
7
+ # processname: iyyov
8
+ # config: /opt/var/iyyov/jobs.rb
2
9
 
3
- ### BEGIN INIT INFO
4
- # Provides: iyyov
5
- # Required-Start: $remote_fs $syslog
6
- # Required-Stop: $remote_fs $syslog
7
- # Should-Start: $named
8
- # Default-Start: 2 3 4 5
9
- # Default-Stop:
10
- # Short-Description: Iyyov jruby monitor
11
- # Description: Iyyov jruby monitoring and job control daemon
12
- ### END INIT INFO
13
-
14
- set -e
15
-
16
- . /lib/lsb/init-functions
10
+ . /etc/rc.d/init.d/functions
17
11
 
18
12
  # Gem home directory
19
13
  # Set to match system "jgem environment path"
@@ -28,6 +22,9 @@ user="runr"
28
22
  # Running directory (for jobs.rb config, log, and pid file)
29
23
  rundir="/var/local/runr/iyyov"
30
24
 
25
+ # Add PATH to jruby if non-standard
26
+ export PATH=$PATH:/usr/local/bin
27
+
31
28
  prog="iyyov"
32
29
  daemon="${gem_home}/gems/iyyov-${version}-java/init/${prog}"
33
30
  config="${rundir}/jobs.rb"
@@ -40,16 +37,16 @@ start() {
40
37
  [ -f "$config" ] || exit 6
41
38
  [ -d "$rundir" ] || exit 7
42
39
 
43
- log_daemon_msg "Starting Iyyov Daemon" "iyyov"
44
- start-stop-daemon --start -d $rundir -c $user --exec $daemon -- $config
40
+ echo -n $"Starting $prog: "
41
+ runuser -c "cd $rundir && $daemon $config" $user
45
42
  RETVAL=$?
46
- log_end_msg $RETVAL
43
+ [ $RETVAL -eq 0 ] && success $"$prog startup" || failure $"$prog startup"
44
+ echo
47
45
  }
48
46
 
49
47
  status() {
50
48
  if [ -f "$pidfile" ]; then
51
- pid=`cat $pidfile`
52
- echo "Status $prog: running pid $pid"
49
+ echo "Status $prog: running pid $(<$pidfile)"
53
50
  else
54
51
  echo "Status $prog: not running"
55
52
  fi
@@ -62,10 +59,12 @@ reload() {
62
59
  }
63
60
 
64
61
  stop() {
65
- log_daemon_msg "Stopping iyyov daemon" "iyyov"
66
- start-stop-daemon --stop --quiet --oknodo --pidfile $pidfile
62
+ echo -n $"Shutting down $prog: "
63
+ killproc -p $pidfile $prog
67
64
  RETVAL=$?
68
- log_end_msg $RETVAL
65
+ [ $RETVAL -eq 0 ] && success || failure
66
+ echo
67
+ return $RETVAL
69
68
  }
70
69
 
71
70
  case "$1" in
data/lib/syncwrap/base.rb CHANGED
@@ -15,5 +15,5 @@
15
15
  #++
16
16
 
17
17
  module SyncWrap
18
- VERSION='1.0.0'
18
+ VERSION='1.1.0'
19
19
  end
@@ -0,0 +1,39 @@
1
+ #--
2
+ # Copyright (c) 2011-2012 David Kellum
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License"); you
5
+ # may not use this file except in compliance with the License. You may
6
+ # obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
+ # implied. See the License for the specific language governing
14
+ # permissions and limitations under the License.
15
+ #++
16
+
17
+ require 'syncwrap/user_run'
18
+ require 'syncwrap/jruby'
19
+
20
+ # Provisions the
21
+ # {boxed-geminabox}[https://github.com/dekellum/boxed-geminabox/]
22
+ # gem server.
23
+ module SyncWrap::Geminabox
24
+ include SyncWrap::UserRun
25
+ include SyncWrap::JRuby
26
+
27
+ attr_accessor :geminabox_version
28
+
29
+ def initialize
30
+ super
31
+ @geminabox_version = '1.0.0'
32
+ end
33
+
34
+ def geminabox_install
35
+ jruby_install_gem( 'boxed-geminabox', :version => "=#{geminabox_version}" )
36
+ user_run_service_dir_setup( 'boxed-geminabox' )
37
+ end
38
+
39
+ end
@@ -85,7 +85,7 @@ module SyncWrap::Iyyov
85
85
  # Create iyyov rundir and make sure there is at minimum an empty
86
86
  # jobs file. Avoid touching it if already present
87
87
  def iyyov_install_rundir
88
- run <<-SH
88
+ sudo( <<-"SH", :user => user_run )
89
89
  mkdir -p #{iyyov_run_dir}
90
90
  if [ ! -e #{iyyov_run_dir}/jobs.rb ]; then
91
91
  touch #{iyyov_run_dir}/jobs.rb
data/lib/syncwrap/java.rb CHANGED
@@ -35,7 +35,7 @@ module SyncWrap::Java
35
35
  super
36
36
 
37
37
  @java_repo_base_url = 'http://localhost/repo'
38
- @java_jdk_name = 'jdk-ora-1.7.0_04-x64'
38
+ @java_jdk_name = 'jdk-ora-1.7.0_05-x64'
39
39
  end
40
40
 
41
41
  def java_jdk_url
data/lib/syncwrap/rhel.rb CHANGED
@@ -36,12 +36,12 @@ module SyncWrap::RHEL
36
36
 
37
37
  def dist_install( *pkgs )
38
38
  pkgs = dist_map_packages( pkgs )
39
- sudo "yum install -qy #{pkgs.join( ' ' )}"
39
+ sudo "yum install -q -y #{pkgs.join( ' ' )}"
40
40
  end
41
41
 
42
42
  def dist_uninstall( *pkgs )
43
43
  pkgs = dist_map_packages( pkgs )
44
- sudo "yum remove -qy #{pkgs.join( ' ' )}"
44
+ sudo "yum remove -q -y #{pkgs.join( ' ' )}"
45
45
  end
46
46
 
47
47
  def dist_install_init_service( name )
@@ -81,7 +81,7 @@ module SyncWrap::UserRun
81
81
  end
82
82
 
83
83
  def user_exist?
84
- exec_conditional { run "id #{user_run}" } == 0
84
+ exec_conditional { run "id #{user_run} >/dev/null" } == 0
85
85
  end
86
86
 
87
87
  def user_create
@@ -27,6 +27,7 @@ require 'syncwrap/java'
27
27
  require 'syncwrap/hashdot'
28
28
  require 'syncwrap/jruby'
29
29
  require 'syncwrap/iyyov'
30
+ require 'syncwrap/geminabox'
30
31
  require 'syncwrap/ec2'
31
32
  require 'syncwrap/ubuntu'
32
33
  require 'syncwrap/rhel'
@@ -40,6 +41,7 @@ class TestSyncWrap < MiniTest::Unit::TestCase
40
41
  include SyncWrap::Hashdot
41
42
  include SyncWrap::JRuby
42
43
  include SyncWrap::Iyyov
44
+ include SyncWrap::Geminabox
43
45
 
44
46
  include SyncWrap::RHEL
45
47
  include SyncWrap::Ubuntu # Not a recomendated combo
data/var/iyyov/jobs.rb ADDED
@@ -0,0 +1,11 @@
1
+ Iyyov.context do |c|
2
+
3
+ c.base_dir = '/var/local/runr'
4
+
5
+ c.define_daemon do |d|
6
+ d.name = "boxed-geminabox"
7
+ d.version = "~> 1.0.0"
8
+ d.log_rotate
9
+ end
10
+
11
+ end
metadata CHANGED
@@ -1,111 +1,118 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: syncwrap
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 1.1.0
6
6
  platform: ruby
7
- authors:
8
- - David Kellum
9
- autorequire:
7
+ authors:
8
+ - David Kellum
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-07-16 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: minitest
17
- version_requirements: &id001 !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - ~>
21
- - !ruby/object:Gem::Version
22
- version: 3.2.0
23
- requirement: *id001
24
- prerelease: false
25
- type: :development
26
- - !ruby/object:Gem::Dependency
27
- name: rjack-tarpit
28
- version_requirements: &id002 !ruby/object:Gem::Requirement
29
- none: false
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: "2.0"
34
- requirement: *id002
35
- prerelease: false
36
- type: :development
12
+ date: 2012-09-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: minitest
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: 3.2.0
21
+ none: false
22
+ requirement: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.0
27
+ none: false
28
+ prerelease: false
29
+ type: :development
30
+ - !ruby/object:Gem::Dependency
31
+ name: rjack-tarpit
32
+ version_requirements: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ~>
35
+ - !ruby/object:Gem::Version
36
+ version: '2.0'
37
+ none: false
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ version: '2.0'
43
+ none: false
44
+ prerelease: false
45
+ type: :development
37
46
  description: A generalized and modular set of provisioning and deployment routines. The Rake-centric Vlad and not-actually-Rake Capistrano both suffer from lack of objects, e.g. the ability to customize and mix-in behavior. SyncWrap offers an Object/Module system that can be used with either. Known to work with Vlad/rake-remote_task but could also be integrated with Capistrano, or others.
38
- email:
39
- - dek-oss@gravitext.com
47
+ email:
48
+ - dek-oss@gravitext.com
40
49
  executables: []
41
-
42
50
  extensions: []
43
-
44
- extra_rdoc_files:
45
- - History.rdoc
46
- - README.rdoc
47
- files:
48
- - History.rdoc
49
- - Manifest.txt
50
- - README.rdoc
51
- - Rakefile
52
- - etc/init.d/iyyov
53
- - etc/postgresql/9.1/main/environment
54
- - etc/postgresql/9.1/main/pg_ctl.conf
55
- - etc/postgresql/9.1/main/pg_hba.conf
56
- - etc/postgresql/9.1/main/pg_ident.conf
57
- - etc/postgresql/9.1/main/postgresql.conf
58
- - etc/postgresql/9.1/main/start.conf
59
- - etc/sysctl.d/61-postgresql-shm.conf
60
- - lib/syncwrap/base.rb
61
- - lib/syncwrap.rb
62
- - lib/syncwrap/common.rb
63
- - lib/syncwrap/distro.rb
64
- - lib/syncwrap/ec2.rb
65
- - lib/syncwrap/hashdot.rb
66
- - lib/syncwrap/iyyov.rb
67
- - lib/syncwrap/java.rb
68
- - lib/syncwrap/jruby.rb
69
- - lib/syncwrap/postgresql.rb
70
- - lib/syncwrap/remote_task.rb
71
- - lib/syncwrap/rhel.rb
72
- - lib/syncwrap/ubuntu.rb
73
- - lib/syncwrap/user_run.rb
74
- - test/test_syncwrap.rb
75
- - usr/local/bin/jgem
51
+ extra_rdoc_files:
52
+ - History.rdoc
53
+ - README.rdoc
54
+ files:
55
+ - History.rdoc
56
+ - Manifest.txt
57
+ - README.rdoc
58
+ - Rakefile
59
+ - etc/init.d/iyyov
60
+ - etc/postgresql/9.1/main/environment
61
+ - etc/postgresql/9.1/main/pg_ctl.conf
62
+ - etc/postgresql/9.1/main/pg_hba.conf
63
+ - etc/postgresql/9.1/main/pg_ident.conf
64
+ - etc/postgresql/9.1/main/postgresql.conf
65
+ - etc/postgresql/9.1/main/start.conf
66
+ - etc/sysctl.d/61-postgresql-shm.conf
67
+ - lib/syncwrap/base.rb
68
+ - lib/syncwrap.rb
69
+ - lib/syncwrap/common.rb
70
+ - lib/syncwrap/distro.rb
71
+ - lib/syncwrap/ec2.rb
72
+ - lib/syncwrap/geminabox.rb
73
+ - lib/syncwrap/hashdot.rb
74
+ - lib/syncwrap/iyyov.rb
75
+ - lib/syncwrap/java.rb
76
+ - lib/syncwrap/jruby.rb
77
+ - lib/syncwrap/postgresql.rb
78
+ - lib/syncwrap/remote_task.rb
79
+ - lib/syncwrap/rhel.rb
80
+ - lib/syncwrap/ubuntu.rb
81
+ - lib/syncwrap/user_run.rb
82
+ - test/test_syncwrap.rb
83
+ - usr/local/bin/jgem
84
+ - var/iyyov/jobs.rb
76
85
  homepage: http://github.com/dekellum/syncwrap
77
86
  licenses: []
78
-
79
- post_install_message:
80
- rdoc_options:
81
- - --main
82
- - README.rdoc
83
- require_paths:
84
- - lib
85
- required_ruby_version: !ruby/object:Gem::Requirement
87
+ post_install_message:
88
+ rdoc_options:
89
+ - --main
90
+ - README.rdoc
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ segments:
99
+ - 0
100
+ hash: 2
86
101
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- hash: 2
91
- segments:
92
- - 0
93
- version: "0"
94
- required_rubygems_version: !ruby/object:Gem::Requirement
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ! '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ segments:
108
+ - 0
109
+ hash: 2
95
110
  none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- hash: 2
100
- segments:
101
- - 0
102
- version: "0"
103
111
  requirements: []
104
-
105
- rubyforge_project:
106
- rubygems_version: 1.8.15
107
- signing_key:
112
+ rubyforge_project:
113
+ rubygems_version: 1.8.24
114
+ signing_key:
108
115
  specification_version: 3
109
116
  summary: A generalized and modular set of provisioning and deployment routines. The Rake-centric Vlad and not-actually-Rake Capistrano both suffer from lack of objects, e.g. the ability to customize and mix-in behavior. SyncWrap offers an Object/Module system that can be used with either.
110
117
  test_files: []
111
-
118
+ ...