Sha256: cbcdf962ee3cb5d61f7529393bec20339c87277f2d47158829b1049a018b7d29
Contents?: true
Size: 1.37 KB
Versions: 2
Compression:
Stored size: 1.37 KB
Contents
module S3Deploy VERSION = '1.0.0' require "scms/scms_utils.rb" def S3Deploy.sync(pub, config) @pub = pub ENV["S3CONF"] = config ENV["AWS_CALLING_FORMAT"] = "SUBDOMAIN" #ENV["SSL_CERT_DIR"] = File.join($website, "s3certs") ENV["S3SYNC_MIME_TYPES_FILE"] = File.join(Folders[:root], "assets", "mime.types") yamlpath=File.join(config, "s3config.yml") #ScmsUtils.log( "Getting s3sync settings: \n#{yamlpath}\n\n") $settings = YAML.load_file(yamlpath) ScmsUtils.log( "Syncing with Amazon S3: **#{$settings['bucket']}**" ) removeold = "--delete" if $settings['clean'] != nil unless $settings['clean'] removeold = "" end end cmd = "s3sync" cache = "--cache-control='max-age=31449600'" params = "--exclude='.svn' --progress --make-dirs --recursive --public-read #{removeold} #{cache} \"#{@pub}/\" #{$settings['bucket']}:/" if $settings['cache'] != nil $settings['cache'].each do |folder| ScmsUtils.log( "Syncing **#{folder}** caching: 1 year" ) ScmsUtils.run(cmd, params) end end cache = "" ScmsUtils.log( "Syncing **root** no caching" ) ScmsUtils.run(cmd, params) ScmsUtils.successLog("**Deployed :)**") if $settings['uri'] != nil ScmsUtils.log("[_#{$settings['uri']}_](#{$settings['uri']})") end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
scms-1.7.9 | lib/scms/s3deploy.rb |
scms-1.7.8 | lib/scms/s3deploy.rb |