lib/llt/cli.rb in llt-0.0.2 vs lib/llt/cli.rb in llt-0.0.3
- old
+ new
@@ -10,15 +10,18 @@
desc 'deploy', 'deploys llt as war after updating all llt gems'
method_option :tomcat, aliases: '-t',
desc: 'path to Tomcat directory to copy the war file to'
method_option :restart_server, type: :boolean, aliases: '-r',
desc: 'Works only when -t is given'
+ method_option :seed, aliases: '-s',
+ desc: 'Reseeds the prometheus stem database'
def deploy
inside BASE_DIR do
update_gems(llt_gems)
run_warbler
deploy_to_tomcat(options)
+ reseed_prometheus_stems(options)
end
end
no_commands do
def llt_gems
@@ -52,9 +55,16 @@
def restart(tomcat)
bin_dir = File.join(tomcat, 'bin')
say_status(:restarting, '')
system("#{bin_dir}/shutdown.sh")
system("#{bin_dir}/startup.sh")
+ end
+
+ def reseed_prometheus_stems(options)
+ if options[:seed]
+ say_status(:seeding, 'Prometheus stem database')
+ system('rake db:prometheus:seed')
+ end
end
end
end
end