shart 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +19 -7
- data/bin/shart +1 -11
- data/lib/shart.rb +4 -4
- data/lib/shart/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Shart
|
2
2
|
|
3
|
-
Shart is
|
3
|
+
Shart is a DRY approach to deploying websites generated by [Middleman](http://middlemanapp.com/), [Jekyll](http://jekyllrb.com/), or other static websites to cloud service providers that support website hosting, like [Amazon S3](http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html).
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,19 +18,31 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
Create a `Shartfile` in the root of your project
|
21
|
+
Create a `Shartfile` in the root of your project that looks like:
|
22
22
|
|
23
23
|
```ruby
|
24
|
-
# A
|
24
|
+
# A Middleman Shartfile.
|
25
25
|
source './build'
|
26
26
|
target 'your-aws-bucket-name', {
|
27
|
-
provider
|
28
|
-
aws_secret_access_key
|
29
|
-
aws_access_key_id
|
27
|
+
:provider => 'AWS',
|
28
|
+
:aws_secret_access_key => 'your AWS credentials',
|
29
|
+
:aws_access_key_id => 'your AWS credentials'
|
30
30
|
}
|
31
31
|
```
|
32
32
|
|
33
|
-
|
33
|
+
When you're ready to publish your website, run:
|
34
|
+
|
35
|
+
$ shart
|
36
|
+
|
37
|
+
Don't forget to run `middleman build` before you `shart` if you're using Middleman.
|
38
|
+
|
39
|
+
After you successfully shart, be sure to [read the blog post about hosting a website on S3](http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html) if you haven't already configured your S3 bucket to do so.
|
40
|
+
|
41
|
+
## Supported targets
|
42
|
+
|
43
|
+
Shart has only been tested with Amazon S3 buckets.
|
44
|
+
|
45
|
+
In theory, you can shart into any [storage provider that Fog supports](http://fog.io/0.8.1/about/getting_started.html).
|
34
46
|
|
35
47
|
## Contributing
|
36
48
|
|
data/bin/shart
CHANGED
@@ -4,14 +4,4 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
|
4
4
|
|
5
5
|
require 'shart'
|
6
6
|
|
7
|
-
Shart::DSL.shartfile('Shartfile')
|
8
|
-
|
9
|
-
# target = Shart::Target.new 'tech.polleverywhere.com', {
|
10
|
-
# :provider => 'AWS',
|
11
|
-
# :aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
|
12
|
-
# :aws_access_key_id => ENV['AWS_ACCESS_KEY_ID']
|
13
|
-
# }
|
14
|
-
|
15
|
-
# source = Shart::Source.new('/Users/bradgessler/projects/polleverywhere/tech-blog/build')
|
16
|
-
|
17
|
-
# target.sync source
|
7
|
+
Shart::DSL.shartfile('Shartfile')
|
data/lib/shart.rb
CHANGED
@@ -21,7 +21,7 @@ module Shart
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def sync(source)
|
24
|
-
Sync.new(source, self).
|
24
|
+
Sync.new(source, self).run
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -41,7 +41,7 @@ module Shart
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def sync(target)
|
44
|
-
Sync.new(self, target).
|
44
|
+
Sync.new(self, target).run
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -63,7 +63,7 @@ module Shart
|
|
63
63
|
sync = new.tap { |dsl| dsl.instance_eval(File.read(filename), filename) }.sync
|
64
64
|
puts "Sharting from #{sync.source.root.to_s.inspect} to #{sync.target.directory_name.inspect}"
|
65
65
|
sync.run do |path, key, file|
|
66
|
-
puts " #{key
|
66
|
+
puts " #{key}"
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
@@ -82,7 +82,7 @@ module Shart
|
|
82
82
|
:key => key,
|
83
83
|
:body => File.open(path),
|
84
84
|
:public => true,
|
85
|
-
:cache_control => 0 # Disable cache on S3 so that future sharts are visible if folks web browsers.
|
85
|
+
:cache_control => 'max-age=0' # Disable cache on S3 so that future sharts are visible if folks web browsers.
|
86
86
|
})
|
87
87
|
end
|
88
88
|
end
|
data/lib/shart/version.rb
CHANGED