ponyhost 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -6
- data/bin/ponyhost +25 -22
- data/lib/ponyhost.rb +4 -4
- metadata +2 -2
data/README.md
CHANGED
@@ -12,12 +12,12 @@ account and the [access key id and secret](https://aws-portal.amazon.com/gp/aws/
|
|
12
12
|
|
13
13
|
The installation is as simple as:
|
14
14
|
|
15
|
-
gem install ponyhost
|
15
|
+
$ gem install ponyhost
|
16
16
|
|
17
17
|
## Commands ##
|
18
18
|
### Create ###
|
19
19
|
|
20
|
-
ponyhost create your-site
|
20
|
+
$ ponyhost create your-site
|
21
21
|
|
22
22
|
Will create the S3 bucket with a website configuration.
|
23
23
|
Per default index.html will be the index document and 404.html the error document.
|
@@ -27,7 +27,7 @@ The installation is as simple as:
|
|
27
27
|
|
28
28
|
If you prefer to use a custom domain just pass the name accordingly.
|
29
29
|
|
30
|
-
ponyhost create foo.yoursite.com
|
30
|
+
$ ponyhost create foo.yoursite.com
|
31
31
|
|
32
32
|
You'll have to setup a DNS CNAME record for foo.yoursite.com to s3-website-us-east-1.amazonaws.com.
|
33
33
|
It's also possible to use a naked domain like yoursite.com.
|
@@ -36,20 +36,26 @@ The installation is as simple as:
|
|
36
36
|
|
37
37
|
### Push ###
|
38
38
|
|
39
|
+
$ ponyhost push your-site
|
40
|
+
|
39
41
|
Will compare the md5 sum for each file in the current directory with the remote file and push the file if necessary.
|
40
42
|
Currently it won't delete files in the bucket.
|
41
43
|
|
42
44
|
### Server ###
|
45
|
+
|
46
|
+
$ ponyhost server
|
43
47
|
|
44
48
|
Runs a very basic HTTP server for the current directory on http://localhost:9090
|
45
49
|
|
46
50
|
### Destroy ###
|
51
|
+
|
52
|
+
$ ponyhost destroy your-site
|
47
53
|
|
48
54
|
Will delete the bucket and all files on S3.
|
49
55
|
|
50
56
|
## ToDo ##
|
51
57
|
|
52
|
-
* Implement
|
58
|
+
* Implement an autopush command
|
53
59
|
* Implement a robust HTTP server
|
54
|
-
* Support other availability zones
|
55
|
-
* Delete files in bucket
|
60
|
+
* Support other AWS availability zones
|
61
|
+
* Delete files in bucket on push
|
data/bin/ponyhost
CHANGED
@@ -10,29 +10,32 @@ if command == "server"
|
|
10
10
|
PonyHost.server()
|
11
11
|
elsif command == "list" || (["create", "push", "destroy", "show", "version"].include?(command) && bucketname != nil)
|
12
12
|
credentials = PonyHost.obtain_credentials
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
13
|
+
begin
|
14
|
+
AWS::S3::Base.establish_connection!({
|
15
|
+
:access_key_id => credentials[:access_key_id],
|
16
|
+
:secret_access_key => credentials[:access_key_secret]
|
17
|
+
})
|
18
|
+
|
19
|
+
if(command == "create")
|
20
|
+
PonyHost.create(bucketname)
|
21
|
+
elsif(command == "push")
|
22
|
+
PonyHost.push(bucketname, ".")
|
23
|
+
elsif(command == "autopush")
|
24
|
+
puts "Not Yet Implemented"
|
25
|
+
elsif(command == "destroy")
|
26
|
+
print "Do you really wanna destroy '#{bucketname}' (type 'YES'):"
|
27
|
+
PonyHost.destroy(bucketname) if STDIN.gets.chop == "YES"
|
28
|
+
elsif(command == "list")
|
29
|
+
puts "Your sites:"
|
30
|
+
PonyHost.list.each do |name|
|
31
|
+
puts "http://#{name}"
|
32
|
+
end
|
33
|
+
elsif(command == "version")
|
34
|
+
puts "ponyhost version #{PonyHost::VERSION}"
|
35
|
+
puts "created by Johannes Wagener http://johannes.wagener.cc"
|
32
36
|
end
|
33
|
-
|
34
|
-
puts "
|
35
|
-
puts "created by Johannes Wagener http://johannes.wagener.cc"
|
37
|
+
rescue Exception => e
|
38
|
+
puts "Ooops: #{e.message}"
|
36
39
|
end
|
37
40
|
else
|
38
41
|
puts <<-EOF
|
data/lib/ponyhost.rb
CHANGED
@@ -15,7 +15,7 @@ class PonyHost
|
|
15
15
|
S3_CREDENTIAL_FILES = ["~/.ponyhost.yml"]
|
16
16
|
S3_CREDENTIAL_LINK = "https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key"
|
17
17
|
DEFAULT_DOMAIN = "ponyho.st"
|
18
|
-
VERSION = "0.3.
|
18
|
+
VERSION = "0.3.1"
|
19
19
|
class << self
|
20
20
|
|
21
21
|
|
@@ -24,9 +24,9 @@ class PonyHost
|
|
24
24
|
if File.exists?(credential_file)
|
25
25
|
return YAML.load_file(credential_file)
|
26
26
|
else
|
27
|
-
puts "AWS Credentials file '#{credential_file}' missing.
|
28
|
-
puts "
|
29
|
-
puts
|
27
|
+
puts "AWS Credentials file '#{credential_file}' is missing."
|
28
|
+
puts "Please insert your Amazon AWS S3 credentials. You can look them up on http://j.mp/aws-keys"
|
29
|
+
puts "In case you don't have signed up for S3 yet you can do that on http://j.mp/s3-signup"
|
30
30
|
|
31
31
|
credentials = {}
|
32
32
|
print "Your AWS Access Key ID: "
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ponyhost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.
|
5
|
+
version: 0.3.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Johannes Wagener
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-30 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|