hive-runner 2.1.16 → 2.1.17

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hive_setup +38 -37
  3. data/bin/init.d.hived +73 -0
  4. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f93f7c3be523ef297bac9808d5005863be39f8ef
4
- data.tar.gz: 8f3fd2329e720825c3653f600060535309adb5f5
3
+ metadata.gz: d4704758c41182147429e0d686f6aac6f9fbfbde
4
+ data.tar.gz: 4b53978303fb1d7a890b26b642a090d30af50f6a
5
5
  SHA512:
6
- metadata.gz: 68e9a34d1acd84fd7b7dc2b37f1318d7053373e4e2726b39b2e6671dfbc073d69b141c721f1aa8ec1b88e5e50611faaa37e0b5b53238682c5adf26ba38caf8c2
7
- data.tar.gz: a5ea8cf63bfcc12f76f82c41a3831538223db8e2bda3a2a36c10576acfe7bc087bf73f95573514ef6fbe94672922d18f50edb35934e15a19439570b6903eb4f6
6
+ metadata.gz: f272540c420ddd01528d609cf746219032a5137ca4263f9a7dfa554e48f60130da34ad53784b8e6069985cee3eab99de963c7c72c98ac217726095acfed4ff0a
7
+ data.tar.gz: 5d33248ba5945404a8097e1e091cda6fa400d0dd1feedc9437bb2387943d6afa42a836a51d434b918009f98f6729c8af3540a0335c7bd041896605ce3e8b03e3
@@ -98,7 +98,7 @@ def gather_options
98
98
  opt = ''
99
99
  mods = []
100
100
  ruby, nrubies = find_ruby true
101
- daemons = ( os != 'Unknown' )
101
+ daemons = false
102
102
 
103
103
  while opt.upcase != 'X'
104
104
  table = Terminal::Table.new headings: ['Device', 'Module', 'Source']
@@ -123,7 +123,7 @@ def gather_options
123
123
  puts '1) Add module'
124
124
  puts '2) Change ruby version'
125
125
  if os != 'Unknown'
126
- puts "3) #{ daemons ? 'Do not s' : 'S'}et up daemon script"
126
+ puts "3) #{ daemons ? 'Do not s' : 'S'}et up daemon script (experimental)"
127
127
  end
128
128
  puts 'X) Continue'
129
129
  puts ''
@@ -241,38 +241,38 @@ def setup_hive(options)
241
241
  end
242
242
  print "SUCCESS\n"
243
243
 
244
- print "Creating daemon startup script..."
245
- if os == 'Linux'
246
- startup_script = "#{dir}/hived.init"
247
- config_file = "#{dir}/hived.conf"
248
- write_logs = '> $LOG_DIRECTORY/hived.out 2> $LOG_DIRECTORY/hived.err'
249
- File.open("#{dir}/start_hive.sh", 'w', 0755) do |f|
250
- f.write "#!/bin/bash -li\n"
251
-
252
- f.write "if [ -f /etc/hived.conf ]\n"
253
- f.write "then\n"
254
- f.write " . /etc/hived.conf\n"
255
- f.write "else\n"
256
- f.write " . #{config_file}\n"
257
- f.write "fi\n"
258
-
259
- f.write "cd $HIVE_HOME #{write_logs}\n"
260
- f.write "start_hive -p $PIDFILE #{write_logs} &\n"
261
- f.write "echo $!\n"
262
- end
244
+ print "Creating daemon startup script ... "
245
+ if daemons
246
+ if os == 'Linux'
247
+ startup_script = "#{dir}/hived.init"
248
+ config_file = "#{dir}/hived.conf"
249
+ write_logs = '> $LOG_DIRECTORY/hived.out 2> $LOG_DIRECTORY/hived.err'
250
+ File.open("#{dir}/start_hive.sh", 'w', 0755) do |f|
251
+ f.write "#!/bin/bash -li\n"
252
+
253
+ f.write "if [ -f /etc/hived.conf ]\n"
254
+ f.write "then\n"
255
+ f.write " . /etc/hived.conf\n"
256
+ f.write "else\n"
257
+ f.write " . #{config_file}\n"
258
+ f.write "fi\n"
259
+
260
+ f.write "cd $HIVE_HOME #{write_logs}\n"
261
+ f.write "start_hive -p $PIDFILE #{write_logs} &\n"
262
+ f.write "echo $!\n"
263
+ end
263
264
 
264
- FileUtils.cp(File.expand_path('../init.d.hived', __FILE__), startup_script)
265
+ FileUtils.cp(File.expand_path('../init.d.hived', __FILE__), startup_script)
265
266
 
266
- File.open(config_file, 'w') do |conf|
267
- conf.write "HIVE_HOME=#{dir}\n"
268
- conf.write "USER=#{Etc.getlogin}\n"
269
- conf.write "LOG_DIRECTORY=#{dir}/log\n"
270
- conf.write "PIDFILE=#{dir}/hived.pid\n"
271
- end
272
- print "SUCCESS\n"
267
+ File.open(config_file, 'w') do |conf|
268
+ conf.write "HIVE_HOME=#{dir}\n"
269
+ conf.write "USER=#{Etc.getlogin}\n"
270
+ conf.write "LOG_DIRECTORY=#{dir}/log\n"
271
+ conf.write "PIDFILE=#{dir}/hived.pid\n"
272
+ end
273
+ print "SUCCESS\n"
273
274
 
274
- print "Moving daemon startup script... "
275
- if daemons
275
+ print "Moving daemon startup script ... "
276
276
  if system("sudo cp #{startup_script} /etc/init.d/hived") && system("sudo chmod 755 /etc/init.d/hived") && system("sudo cp #{config_file} /etc/hived.conf")
277
277
  print "SUCCESS\n"
278
278
  else
@@ -280,14 +280,15 @@ def setup_hive(options)
280
280
  print "FAILED\n"
281
281
  end
282
282
  else
283
- print "SKIPPED\n"
283
+ #startup_script = '??'
284
+ print "SKIPPED (not available on #{os})\n"
285
+ startup_script = false
286
+ daemons = false
287
+ #print "FAILED\n"
288
+ #puts " Cannot set up daemons for '#{os}'"
284
289
  end
285
290
  else
286
- #startup_script = '??'
287
- startup_script = false
288
- daemons = false
289
- #print "FAILED\n"
290
- #puts " Cannot set up daemons for '#{os}'"
291
+ print "SKIPPED\n"
291
292
  end
292
293
 
293
294
  print "Executing 'bundle install' ... "
@@ -0,0 +1,73 @@
1
+ #!/bin/sh
2
+ ### BEGIN INIT INFO
3
+ # Provides: hived
4
+ # Required-Start: $remote_fs $syslog
5
+ # Required-Stop: $remote_fs $syslog
6
+ # Default-Start: 2 3 4 5
7
+ # Default-Stop: 0 1 6
8
+ # Short-Description: Start the Hive Runner
9
+ # Description: The Hive Runner is part of the Hive CI test
10
+ # automation framework. For more details see
11
+ # https://bbc.github.io/hive-ci/
12
+ ### END INIT INFO
13
+
14
+ # Author: Joe Haig <joe.haig@bbc.co.uk>
15
+
16
+ . /etc/hived.conf
17
+
18
+ PATH=/bin:/usr/bin:/sbin:/usr/sbin:$HIVE_HOME
19
+ DAEMON=$HIVE_HOME/start_hive.sh
20
+ NAME=hived
21
+ DESC="Hive Runner"
22
+ SCRIPTNAME=/etc/init.d/"$NAME"
23
+ . /lib/lsb/init-functions
24
+
25
+ LOG_DIRECTORY=/var/log/hived
26
+ SCRIPT=$HIVE_HOME/start_hive.sh
27
+ if [ ! -d $LOG_DIRECTORY ]
28
+ then
29
+ mkdir -p $LOG_DIRECTORY
30
+ chown $USER $LOG_DIRECTORY
31
+ fi
32
+
33
+ case "$1" in
34
+ start)
35
+ log_daemon_msg "Starting Hive Runner" "hived" || true
36
+ /sbin/start-stop-daemon --background --start --nicelevel 10 --quiet --oknodo --chdir $HIVE_HOME --startas $DAEMON --pidfile $PIDFILE --chuid $USER -- $DAEMON -p $PIDFILE
37
+ log_end_msg $?
38
+ ;;
39
+ stop)
40
+ log_daemon_msg "Stopping Hive Runner" "hived" || true
41
+ /sbin/start-stop-daemon --stop --pidfile $PIDFILE
42
+ RETVAL=$?
43
+ [ $RETVAL -eq 0 ] && [ -e "$PIDFILE" ] && rm -f $PIDFILE
44
+ log_end_msg $RETVAL
45
+ ;;
46
+ #reload)
47
+ # echo "TODO: reload"
48
+ # ;;
49
+ restart)
50
+ log_daemon_msg "Stopping Hive Runner" "hived" || true
51
+ /sbin/start-stop-daemon --stop --pidfile $PIDFILE
52
+ log_daemon_msg "Starting Hive Runner" "hived" || true
53
+ /sbin/start-stop-daemon --background --start --nicelevel 10 --quiet --oknodo --chdir $HIVE_HOME --startas $DAEMON --pidfile $PIDFILE --chuid $USER -- $DAEMON -p $PIDFILE
54
+ ;;
55
+ status)
56
+ if sig "USR1"
57
+ then
58
+ telnet localhost 9999 2> /dev/null
59
+ log_daemon_msg "Status: running ("`cat $PID`")"
60
+ exit 1
61
+ else
62
+ log_daemon_msg "Status: not running"
63
+ exit 0
64
+ fi
65
+ #sig "USR1" && telnet localhost 9999 && log_daemon_msg "Status: running ("`cat $PID`")" && exit 1
66
+ #log_daemon_msg "Status: not running" && exit 0
67
+ ;;
68
+ *)
69
+ log_action_msg "Usage: /etc/init.d/hived {start|stop|restart|status}" || true
70
+ exit 1
71
+ esac
72
+
73
+ exit 0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hive-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.16
4
+ version: 2.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Haig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-24 00:00:00.000000000 Z
11
+ date: 2016-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chamber
@@ -266,6 +266,7 @@ files:
266
266
  - README.md
267
267
  - bin/hive_setup
268
268
  - bin/hived
269
+ - bin/init.d.hived
269
270
  - bin/start_hive
270
271
  - lib/hive.rb
271
272
  - lib/hive/controller.rb
@@ -304,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
305
  version: '0'
305
306
  requirements: []
306
307
  rubyforge_project:
307
- rubygems_version: 2.5.1
308
+ rubygems_version: 2.6.7
308
309
  signing_key:
309
310
  specification_version: 4
310
311
  summary: Hive Runner