Skip to content

Instantly share code, notes, and snippets.

@gnarl
Created May 31, 2013 18:27
Show Gist options
  • Save gnarl/5686931 to your computer and use it in GitHub Desktop.
Save gnarl/5686931 to your computer and use it in GitHub Desktop.
server build script
#!/usr/bin/ruby
require 'fileutils'
HOME_DIR = '/Users/cfouts/'
SNAP_DIR = HOME_DIR + 'Sandbox/snapcreator/'
FRAME_DIR = SNAP_DIR + 'SC-Framework/'
SERV_DIR = FRAME_DIR + 'server/'
GUI_DIR = FRAME_DIR + 'GUI/'
SC_SERV_DIR = SERV_DIR + 'scServer/'
SC_SERV_CONFIGS_DIR = SC_SERV_DIR + 'configs/'
BUILD_FILES_DIR = SNAP_DIR + 'build_files/'
CONFIG_DIR = BUILD_FILES_DIR + 'configs/'
def pre_build
puts "Pre Build"
puts "Deleting: #{SC_SERV_DIR}"
FileUtils.rm_rf SC_SERV_DIR
end
def post_build
puts "Post Build"
copy_configs
FileUtils.cp BUILD_FILES_DIR + 'snapcreator.properties', SC_SERV_DIR + 'etc/'
FileUtils.cp BUILD_FILES_DIR + 'snapcreator.properties', GUI_DIR + 'etc/'
FileUtils.cp BUILD_FILES_DIR + 'log_config/logback.xml', SC_SERV_DIR + 'etc/'
FileUtils.cp_r FRAME_DIR + 'agent/perl/test/plugins/SAMPLE', FRAME_DIR + 'agent/perl/plugins/'
end
def copy_configs
FileUtils.cd CONFIG_DIR
Dir['*'].each do |x|
if File.directory?(x)
FileUtils.cp_r x, SC_SERV_CONFIGS_DIR + x
end
end
end
#####################################################################
pre_build
opts = ARGV.shift
FileUtils.cd SERV_DIR
puts %x{ant clean}
if opts.eql?('-q')
puts "Building Quickly"
puts %x{ant buildQuick}
else
puts %x{ant buildWithoutUI}
end
post_build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment