octopress-deploy 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2af5039aee38f546a01d3f4433517c162deb1153
4
- data.tar.gz: e2bd066149b99dbc4f85b2552e946e15413eb3a4
3
+ metadata.gz: b30fec5fea505bb7a246e1d0bc5e0c739343b504
4
+ data.tar.gz: 61f1c39b6c169843e4fe19c1451247ad8af88709
5
5
  SHA512:
6
- metadata.gz: 5e4ba7fafe0ddc43969a6f4266bef6c245774f3593000f7ec94877ff9a3e19416109df3ddf5166ba14a8611656799176d317eb955f2e7f03dfb3350634a502a5
7
- data.tar.gz: 2449bab2c6e132dded9f82f6c98284f43840f0b3d28053a10b57d3252893cbc88feb57e45d8178e3e03b44ac353ccf7a796a27705868e3e7819bf8cf4f771a6d
6
+ metadata.gz: 528045680665befb6071813aff95d2b531da8167f1fee9799a3422c3d52befacbc94343b91c8a651a57415a78a40d833fd7dbb2dc3eb45064f3967f2609959a8
7
+ data.tar.gz: d659d156bac37ae764b2dfa9e7191d717f0d6aa2e49f6db08e494bad4bd582ed57007006feaa3cd90dab09d261f18e50faf009f42fdff736c1298744491e72f4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Octopress Deploy Changelog
2
2
 
3
+ ### 1.0.3 - 2015-01-04
4
+
5
+ - On add-bucket, added <NAME> as an optional argument instead of an option flag
6
+ - Added --force option to pull
7
+ - Minor documentation improvements
8
+
3
9
  ### 1.0.2 - 2015-01-02
4
10
 
5
11
  - Updated Octopress docs integration.
data/README.md CHANGED
@@ -1,21 +1,31 @@
1
1
  # Octopress Deploy
2
2
 
3
- Easily deploy any Jekyll or Octopress site using S3, Git or Rsync.
4
-
5
- Pull request to support other deployment methods are welcome.
3
+ Easily deploy any static site using S3, Git or Rsync. Pull request to support other deployment methods are welcome.
6
4
 
7
5
  [![Gem Version](http://img.shields.io/gem/v/octopress-deploy.svg)](https://rubygems.org/gems/octopress-deploy)
8
6
  [![License](http://img.shields.io/:license-mit-blue.svg)](http://octopress.mit-license.org)
9
7
 
10
8
  ## Installation
11
9
 
12
- To use Octopress Deploy, first install the Octopress gem with `gem install octopress` or by adding it to your Gemfile.
10
+ Octopress Deploy is bundled with the Octopress Gem, to use it from the command line, install Octopress first.
11
+
12
+ ```
13
+ $ gem install octopress
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ | Subcommand | Description |
19
+ |:--------------------|:-------------------------------------------------------------------|
20
+ | `init <METHOD>` | Generate a config file for the deployment method. (git, s3, rsync) |
21
+ | `pull <DIR>` | Pull down your site into a local directory. |
22
+ | `add-bucket <NAME>` | (S3 only) Add a bucket using your configured S3 credentials. |
13
23
 
14
24
  ## Set up
15
25
 
16
26
  First set up a configuration file for your deployment method.
17
27
 
18
- ```sh
28
+ ```
19
29
  $ octopress deploy init git # or rsync, s3
20
30
  ```
21
31
 
@@ -27,7 +37,7 @@ you never commit sensitive information to your repository.**
27
37
  You can pass configurations as command line options. To see specific options for any method, add the `--help` flag.
28
38
  For example to see the options for configuring S3:
29
39
 
30
- ```sh
40
+ ```
31
41
  $ octopress deploy init s3 --help
32
42
  ```
33
43
 
@@ -38,14 +48,14 @@ any static site. Simply make sure your configuration points to
38
48
  the root directory of your static site (For Jekyll, that's
39
49
  probably `_site`) then tell Octopress to deploy it.
40
50
 
41
- ```sh
51
+ ```
42
52
  $ octopress deploy
43
53
  ```
44
54
 
45
55
  This will read your `_deploy.yml` configuration and deploy your
46
56
  site. If you like, you can specify a configuration file.
47
57
 
48
- ```sh
58
+ ```
49
59
  $ octopress deploy --config _staging.yml
50
60
  ```
51
61
 
@@ -53,8 +63,8 @@ $ octopress deploy --config _staging.yml
53
63
 
54
64
  With the `pull` command, you can pull your site down into a local directory.
55
65
 
56
- ```sh
57
- octopress deploy pull <DIR>
66
+ ```
67
+ $ octopress deploy pull <DIR>
58
68
  ```
59
69
 
60
70
  Mainly you'd do this if you're troubleshooting deployment and you want to see if it's working how you expected.
@@ -126,15 +136,14 @@ Note: configurations in `_deploy.yml` will override environment variables so be
126
136
 
127
137
  If your AWS credentials are properly configured, you can add a new bucket with this command.
128
138
 
129
- ```sh
130
- octopress deploy add-bucket
139
+ ```
140
+ $ octopress deploy add-bucket <NAME>
131
141
  ```
132
142
 
133
143
  This will connect to AWS, create a new S3 bucket, and configure it for static website hosting. This command can use the settings in your deployment configuration or you can pass options to override those settings.
134
144
 
135
145
  | Option | Description | Default
136
146
  |:--------------|:-------------------------------------------------|:---------------|
137
- | `--name` | Override the `bucket_name` configuration | |
138
147
  | `--region` | Override the `region` configuration | |
139
148
  | `--index` | Specify an index page for your site | index.html |
140
149
  | `--error` | Specify an error page for your site | error.html |
@@ -34,11 +34,15 @@ module Octopress
34
34
  def self.pull(options={})
35
35
  options = merge_configs(options)
36
36
 
37
- if !File.exists? options[:dir]
37
+ if Dir.exist?(options[:dir]) &&
38
+ !(Dir.entries(options[:dir]) - %w{. ..}).empty? &&
39
+ !options[:force]
40
+ puts "Pull failed. Directory #{options[:dir]} is not empty. Pass --force to overwrite."
41
+ abort
42
+ else
38
43
  FileUtils.mkdir_p options[:dir]
44
+ deployer(options).pull
39
45
  end
40
-
41
- deployer(options).pull
42
46
  end
43
47
 
44
48
  def self.add_bucket(options={})
@@ -144,7 +148,9 @@ end
144
148
 
145
149
  Octopress::Docs.add({
146
150
  name: "Octopress Deploy",
147
- description: "An Octopress plugin for deploying static websites.",
151
+ gem: "octopress-deploy",
152
+ version: Octopress::Deploy::VERSION,
153
+ description: "Easily deploy any static site using S3, Git or Rsync.",
148
154
  path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
149
155
  source_url: "https://github.com/octopress/deploy",
150
156
  })
@@ -15,6 +15,7 @@ module Octopress
15
15
  c.command(:pull) do |c|
16
16
  c.syntax "pull <DIR>"
17
17
  c.description "Pull down the published copy of your site into DIR"
18
+ c.option 'force', '--force', 'Overwrite existing files on pull'
18
19
  c.option "config_file", "--config FILE", "The path to your config file (default: _deploy.yml)"
19
20
 
20
21
  c.action do |args, options|
@@ -79,15 +80,15 @@ module Octopress
79
80
  end
80
81
 
81
82
  c.command(:'add-bucket') do |c|
82
- c.syntax 'add-bucket [options]'
83
- c.description "Add a new S3 bucket and configure it for static websites."
84
- c.option 'bucket_name','--name NAME','Choose a bucket name. (Defaults: to bucket_name in config file)'
83
+ c.syntax 'add-bucket <NAME> [options]'
84
+ c.description "Add a new S3 bucket and configure it for static websites. Name defaults to bucket_name in config file"
85
85
  c.option 'region','--region REGION','Choose a region. (Defaults: to region in config file)'
86
86
  c.option 'index_page','--index PAGE','Specify an index page. (Default: index.html)'
87
87
  c.option 'error_page','--error PAGE','Specify an error page. (Default: 404.html)'
88
88
  c.option "config_file", "--config FILE", "The path to your config file (default: _deploy.yml)"
89
89
 
90
90
  c.action do |args, options|
91
+ options['bucket_name'] = args.first
91
92
  Octopress::Deploy.add_bucket(options)
92
93
  end
93
94
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Deploy
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-02 00:00:00.000000000 Z
11
+ date: 2015-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorator