scms 2.0.3 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/blank-template/_config.yml +1 -1
- data/bin/scms +16 -11
- data/lib/scms.rb +4 -3
- data/lib/scms/s3deploy.rb +5 -10
- data/lib/scms/scms-utils.rb +2 -1
- data/lib/scms/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 609c59402344d9305ba7e76db8552d4806ba317c
|
4
|
+
data.tar.gz: 12a2b3db3a156fc520f61ca422e9d6792b1534d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 535c525277e5930d81705dfbbce442878f54ac80ec2bbe39e722779440a42682f409fa5f48e6fb5982b43527eabf0f29b696109587b8ec5a2f49c84beaadbdea
|
7
|
+
data.tar.gz: 3f19d0ef09e134a84015247633634f89a0129e42562ffedb075b6544d68817308718bd07daf7a452509caef24fc9f4cef8a01da3704aabc5dfbd9df8c025fb3d
|
@@ -1,5 +1,5 @@
|
|
1
1
|
template: _templates/skin.erb.html # The website skin (erb template)
|
2
|
-
#
|
2
|
+
#rooturl: http://www.mywebsite.com/ #Whats the website root when published - All references in html ~/ will be replaced with this
|
3
3
|
# Define your pages here
|
4
4
|
pages:
|
5
5
|
- index:
|
data/bin/scms
CHANGED
@@ -11,6 +11,12 @@ require 'optparse'
|
|
11
11
|
require 'fileutils'
|
12
12
|
require 'Scms'
|
13
13
|
|
14
|
+
class String
|
15
|
+
def to_path(end_slash=false)
|
16
|
+
"#{'/' if self[0]=='\\'}#{self.split('\\').join('/')}#{'/' if end_slash}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
14
20
|
options = {}
|
15
21
|
optparse = OptionParser.new do|opts|
|
16
22
|
# Set a banner, displayed at the top
|
@@ -21,6 +27,10 @@ optparse = OptionParser.new do|opts|
|
|
21
27
|
opts.on('-w', '--website WEBSITE', "Website directory (full path)") do |w|
|
22
28
|
options[:website] = w
|
23
29
|
end
|
30
|
+
|
31
|
+
opts.on('-c', '--config CONFIGDIR', "Configeration directory if different from Website (full path)") do |c|
|
32
|
+
options[:configdir] = c
|
33
|
+
end
|
24
34
|
|
25
35
|
opts.on('-o', '--output BuildDIR', "Website build dir (full path)") do |o|
|
26
36
|
options[:pub] = o
|
@@ -35,11 +45,6 @@ optparse = OptionParser.new do|opts|
|
|
35
45
|
opts.on( '-m', '--mode MODE', 'CMS or Publish' ) do|m|
|
36
46
|
options[:mode] = m
|
37
47
|
end
|
38
|
-
|
39
|
-
options[:html] = "true"
|
40
|
-
opts.on( '-f', '--html HTML', 'true or false' ) do|h|
|
41
|
-
options[:html] = h
|
42
|
-
end
|
43
48
|
|
44
49
|
options[:verbose] = false
|
45
50
|
opts.on( '-v', '--verbose', 'Output more information' ) do
|
@@ -57,14 +62,14 @@ optparse.parse!
|
|
57
62
|
#Set globals
|
58
63
|
$stdout.sync = true
|
59
64
|
root_folder = File.expand_path("../", File.dirname(__FILE__))
|
60
|
-
website = (options[:website].nil?) ? Dir.pwd : options[:website]
|
65
|
+
website = ((options[:website].nil?) ? Dir.pwd : options[:website]).to_path
|
61
66
|
$website = website
|
62
67
|
Folders = {
|
63
68
|
:root => root_folder,
|
64
|
-
:website =>
|
65
|
-
:pub => (ENV["SCMS_PUBLISH_FOLDER"] or
|
66
|
-
:
|
67
|
-
:
|
69
|
+
:website => website,
|
70
|
+
:pub => (options[:pub] or ENV["SCMS_PUBLISH_FOLDER"] or '').to_path,
|
71
|
+
:config => (options[:configdir] or ENV["SCMS_CONFIG_FOLDER"] or website).to_path,
|
72
|
+
:assets => File.join(root_folder, "assets")
|
68
73
|
}
|
69
74
|
|
70
75
|
if options[:action] == "create"
|
@@ -93,7 +98,7 @@ end
|
|
93
98
|
|
94
99
|
raise "No website in folder #{Folders[:website]}" if !File::directory?(Folders[:website])
|
95
100
|
Scms.upgrade(Folders[:website])
|
96
|
-
Scms.build(Folders[:website], Folders[:
|
101
|
+
Scms.build(Folders[:website], Folders[:config], options[:mode])
|
97
102
|
Scms.copywebsite(Folders[:website], Folders[:pub]) if Folders[:pub] != nil
|
98
103
|
mimetypefile = File.join(Folders[:root], "assets", "mime.types")
|
99
104
|
S3Deploy.sync(Folders[:website], Folders[:config], mimetypefile) if options[:action] == "deploy"
|
data/lib/scms.rb
CHANGED
@@ -13,7 +13,7 @@ module Scms
|
|
13
13
|
|
14
14
|
include YAML
|
15
15
|
|
16
|
-
def Scms.build(website,
|
16
|
+
def Scms.build(website, config, mode)
|
17
17
|
@website = website
|
18
18
|
@mode = mode
|
19
19
|
#ScmsUtils.log("Mode: #{mode}")
|
@@ -32,7 +32,8 @@ module Scms
|
|
32
32
|
begin
|
33
33
|
require_relative bootstrap
|
34
34
|
rescue Exception=>e
|
35
|
-
ScmsUtils.errLog(
|
35
|
+
ScmsUtils.errLog(e.message)
|
36
|
+
ScmsUtils.log(e.backtrace.inspect )
|
36
37
|
end
|
37
38
|
else
|
38
39
|
ScmsUtils.log("Bootstrap does not exist #{bootstrap}")
|
@@ -319,7 +320,7 @@ module Scms
|
|
319
320
|
end
|
320
321
|
|
321
322
|
def Scms.copywebsite(website, pub)
|
322
|
-
if pub !=
|
323
|
+
if pub.to_s.strip.length != 0
|
323
324
|
FileUtils.mkdir pub unless Dir.exists? pub
|
324
325
|
source = File.join(website)
|
325
326
|
Dir.chdir(source) do
|
data/lib/scms/s3deploy.rb
CHANGED
@@ -9,19 +9,12 @@ module S3Deploy
|
|
9
9
|
ENV["S3CONF"] = config
|
10
10
|
ENV["AWS_CALLING_FORMAT"] = "SUBDOMAIN"
|
11
11
|
ENV["S3SYNC_MIME_TYPES_FILE"] = mimetypefile
|
12
|
-
puts "S3SYNC_MIME_TYPES_FILE: #{ENV["S3SYNC_MIME_TYPES_FILE"] }"
|
12
|
+
#puts "S3SYNC_MIME_TYPES_FILE: #{ENV["S3SYNC_MIME_TYPES_FILE"] }"
|
13
13
|
|
14
14
|
s3yamlpath=File.join(config, "_s3config.yml")
|
15
15
|
settings = YAML.load_file(s3yamlpath)
|
16
16
|
throw "No bucket defined in _s3config.yml settings file" if settings['bucket'] == nil
|
17
17
|
ScmsUtils.log( "Syncing with Amazon S3: #{settings['bucket']}" )
|
18
|
-
|
19
|
-
removeold = "--delete"
|
20
|
-
if settings['clean'] != nil
|
21
|
-
unless settings['clean']
|
22
|
-
removeold = ""
|
23
|
-
end
|
24
|
-
end
|
25
18
|
|
26
19
|
exclude = "(\\.svn$)|(^_)"
|
27
20
|
if settings['ignore'] != nil
|
@@ -29,7 +22,7 @@ module S3Deploy
|
|
29
22
|
end
|
30
23
|
|
31
24
|
cmd = "s3sync"
|
32
|
-
params = "
|
25
|
+
params = "--exclude=\"#{exclude}\" --progress --make-dirs --recursive"
|
33
26
|
|
34
27
|
#First deploy private directories
|
35
28
|
Dir.glob("#{pub}/_*/").each do |f|
|
@@ -49,7 +42,9 @@ module S3Deploy
|
|
49
42
|
end
|
50
43
|
|
51
44
|
ScmsUtils.log( "Syncing root (public)" )
|
52
|
-
|
45
|
+
removeold = ""
|
46
|
+
removeold = "--delete" if settings['clean'].to_s == "true"
|
47
|
+
roorparams = "#{removeold} #{params} --public-read \"#{pub}/\" #{settings['bucket']}:/"
|
53
48
|
#Finnaly deploy all remaining files (except excludes)
|
54
49
|
ScmsUtils.run(cmd, roorparams)
|
55
50
|
ScmsUtils.successLog("Deployed :)")
|
data/lib/scms/scms-utils.rb
CHANGED
data/lib/scms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Courtenay Probert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cprobert-s3sync
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.0.
|
158
|
+
rubygems_version: 2.0.5
|
159
159
|
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: Create simple static websites, in a jiffy
|