Sha256: 95d3e89a0a99d66e89d6ce01dfae4702640fe6a9efd7c70494a62c9d1d3ff82e
Contents?: true
Size: 1.86 KB
Versions: 2
Compression:
Stored size: 1.86 KB
Contents
#require_relative('./commandarray.rb') require_relative('./environment.rb') require_relative('./console.rb') class Publish #< CommandArray def initialize #if(Environment.scm=='git') # artifacts=Artifacts.new # artifacts.each {|artifact| # dest_dir = Environment.dev_root + "/dep/" + Environment.relative_directory + '/' + Environment.branch # dest = dest_dir + "/" + artifact # dest_dir=File.dirname(dest) # self.add "<%FileUtils.mkdir_p('#{dest_dir}')%>" if (!Dir.exists?(dest_dir)) # self.add "<%FileUtils.cp('#{artifact}','#{dest}')%>" # } #end end def update Console.debug "Publish.update" if(defined?(DEV_TASKS)) if(DEV_TASKS).has_key?(:publish_path) if(DEV_TASKS[:publish_path].include?('svn://') || DEV_TASKS[:publish_path].include?('file:///')) latestRev=Environment.svn_latest_revision svn_publish_uri="#{DEV_TASKS[:publish_path]}/#{DEV_TASKS[:relative_directory]}-#{latestRev}" local_dir="#{Environment.dev_root}/tmp/#{DEV_TASKS[:relative_directory]}@#{latestRev}" FileUtils.mkdir_p(File.dirname(local_dir)) if(!File.exists?(File.dirname(local_dir))) dep_dir="#{Environment.dev_root}/dep/#{DEV_TASKS[:relative_directory]}@#{latestRev}" svn_info=`svn info #{svn_publish_uri} 2>&1` if(svn_info.include?('URL:')) Console.debug "#{svn_publish_uri} already exists." else Console.debug "adding publish commands.." add "svn mkdir #{svn_publish_uri} --parents -m\"publish\"" add "svn checkout #{svn_publish_uri} #{local_dir}" add "<%Environment.copy_files(DEV_TASKS[:files][:artifact],'#{local_dir}')%>" add "<%Environment.svn_add_all('#{local_dir}')%>" add "svn commit #{local_dir}@ -m\"publish\"" add "<%FileUtils.rm_r('#{local_dir}')%>" end end end end end def add command self << command if(!include?(command)) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dev_tasks-1.0.38 | lib/publish.rb |
dev_tasks-1.0.37 | lib/publish.rb |