octopress-deploy 1.0.0 → 1.0.1

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: a5d520dee46302f639264c81e76613c9de457c64
4
- data.tar.gz: e6b2c40263b4bedbb03572279950d1c6fff02367
3
+ metadata.gz: e9d2703f3a60fefc2dad07bed5c89667893aaced
4
+ data.tar.gz: 2186ef8eb38190518f08e43ac60962b0c635a51f
5
5
  SHA512:
6
- metadata.gz: 3c079408b162fe4e49d40020b891c43ec1741444250f5d6b22e99e96d3132b79049bb45ecc0d4a72f063004a6b91fb6ba88852df24aba417d70cfaa2f65884b3
7
- data.tar.gz: fb5cafd7fbb2bfd8f72261c7150f8dabf16d0e97bf5a0fd709b2eed03aa85c6c2adfab679444469b3c9bfe2b45388810474a9b8b8853a0bc98cc10155c2cf4c5
6
+ metadata.gz: 7d7ed8e4498f809bcdef3ef2ffe14b498485a3efa2fa0e3069f94f041a019dc8d09ba50862b9e3c5541a45dcba273f4ce46988bfa1cee86d2dd2c685a46c4db9
7
+ data.tar.gz: 4c928e03d4248bde22c379365446a63bc33b9c2a01263b80d773c1276b65bc30840ef03dc79325b1d0dd33401339abd675435c3de6dba75d6b815eb8bbf7d792
data/.clash.yml ADDED
@@ -0,0 +1,53 @@
1
+ -
2
+ tasks:
3
+ cleanup:
4
+ - rm -rf build local-rsync pull-rsync pull-s3 .deploy pull-git local-git pull-s3 remote-rsync
5
+ reset:
6
+ - cleanup
7
+ - cp -r source/ _site
8
+ - ruby garbage.rb
9
+ -
10
+ title: Test local Rsync
11
+ before:
12
+ - reset
13
+ - octopress deploy init rsync --dir local-rsync --config _rsync_deploy_local.yml --force
14
+ - octopress deploy --config _rsync_deploy_local.yml
15
+ compare: _site local-rsync
16
+
17
+ -
18
+ title: Test remote Rsync
19
+ before:
20
+ - reset
21
+ - octopress deploy --config _rsync_deploy.yml
22
+ - octopress deploy pull pull-rsync --config _rsync_deploy.yml
23
+ compare: _site pull-rsync
24
+
25
+ -
26
+ title: Test local Git
27
+ before:
28
+ - reset
29
+ - git init --bare local-git
30
+ - octopress deploy init git --branch test_git_deploy --url ./local-git --dir site --config _git_deploy_local.yml --force
31
+ - octopress deploy --config _git_deploy_local.yml
32
+ - octopress deploy pull pull-git --config _git_deploy_local.yml
33
+ - rm -rf pull-git/.git
34
+ compare: _site pull-git/site
35
+
36
+ -
37
+ title: Test remote Git
38
+ before:
39
+ - reset
40
+ - octopress deploy init git --branch test_git_deploy --url git@github.com:octopress/deploy --config _git_deploy.yml --force
41
+ - octopress deploy --config _git_deploy.yml
42
+ - octopress deploy pull pull-git --config _git_deploy.yml
43
+ - rm -rf pull-git/.git
44
+ compare: _site pull-git
45
+
46
+ -
47
+ title: Test S3
48
+ before:
49
+ - reset
50
+ - octopress deploy s3 --config _s3_deploy.yml
51
+ - octopress deploy pull pull-s3 --config _s3_deploy.yml
52
+ compare: _site pull-s3
53
+ after: cleanup
data/.gitignore CHANGED
@@ -27,3 +27,4 @@ build
27
27
  local-git
28
28
  local-rsync
29
29
  .DS_Store
30
+ _site
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Octopress Deploy Changelog
2
2
 
3
+ ### 1.0.1 - 2014-12-27
4
+ - Added command line options for setting contents of config file
5
+ - Added support for Octopress docs
6
+
7
+ ### 1.0.0 - 2014-09-24
8
+ - Deemed suitable for use
9
+
3
10
  ### 1.0.0 RC11 - 2014-07-06
4
11
  - Fix: Changed git add command to be more broadly suitable.
5
12
 
data/README.md CHANGED
@@ -24,6 +24,13 @@ directory which you can edit to add any necessary configuration.
24
24
  **Remember to add your configuration to `.gitignore` to be sure
25
25
  you never commit sensitive information to your repository.**
26
26
 
27
+ You can pass configurations as command line options. To see specific options for any method, add the `--help` flag.
28
+ For example to see the options for configuring S3:
29
+
30
+ ```sh
31
+ $ octopress deploy init s3 --help
32
+ ```
33
+
27
34
  ## Deploying your site.
28
35
 
29
36
  Deployment is tailored to work with Jekyll, but it will work for
@@ -157,8 +164,9 @@ Only `git_url` is required. Other options will default as shown below.
157
164
  | `user` | ssh user, e.g user@host.com | |
158
165
  | `port` | ssh port | 22 |
159
166
  | `remote_path` | Remote destination's document root | |
160
- | `exclude_file` | Path to a file containing rsync exclusions | |
167
+ | `exclude_from` | Path to a file containing rsync exclusions | |
161
168
  | `exclude` | Inline list of rsync exclusions | |
169
+ | `include_from` | Path to a file containing rsync inclusions | |
162
170
  | `include` | Inline list of inclusions to override exclusions | |
163
171
  | `delete` | Delete files in destination not found in source | false |
164
172
 
@@ -141,3 +141,10 @@ FILE
141
141
 
142
142
  end
143
143
  end
144
+
145
+ Octopress::Docs.add({
146
+ name: "Octopress Deploy",
147
+ description: "An Octopress plugin for deploying static websites.",
148
+ path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
149
+ source_url: "https://github.com/octopress/deploy",
150
+ })
@@ -26,11 +26,55 @@ module Octopress
26
26
  c.command(:init) do |c|
27
27
  c.syntax 'init <METHOD> [options]'
28
28
  c.description "Create a configuration file for a deployment method (#{Deploy::METHODS.keys.join(', ')})."
29
- c.option 'force', '--force', 'Initialize a config file even if it already exists.'
30
29
 
31
- c.action do |args, options|
32
- options['method'] = args.first
33
- Octopress::Deploy.init_config(options)
30
+ c.command(:rsync) do |c|
31
+ c.syntax 'rsync [options]'
32
+ c.description "Create an rsync deployment configuration file."
33
+ c.option 'user', '-u', '--user USER', 'SSH user (e.g. username@host.org)'
34
+ c.option 'port', '-p', '--port PORT', 'SSH port (default: 22)'
35
+ c.option 'flags', '-f', '--flags FLAGS', 'Flags to pass to Rsync command (default: -avz)'
36
+ c.option 'remote_path', '--dir DIR', 'Path to site directory on host (e.g. ~/webroot/)'
37
+ c.option 'delete', '--delete', 'Sync file deletion'
38
+ add_common_init_options(c)
39
+
40
+ c.action do |args, options|
41
+ options['method'] = 'rsync'
42
+ Octopress::Deploy.init_config(options)
43
+ end
44
+ end
45
+
46
+ c.command(:git) do |c|
47
+ c.syntax 'git [options]'
48
+ c.description "Create a git deployment configuration file."
49
+ c.option 'git_url', '-u', '--url URL', 'Git url (e.g. git@github.com:user/project)'
50
+ c.option 'git_branch', '-b', '--branch NAME', 'Branch to deploy to (default: master)'
51
+ c.option 'remote_path', '-d', '--dir DIR', 'Deploy site into a subdirectory.'
52
+ c.option 'delete', '--delete', 'Sync file deletion'
53
+ add_common_init_options(c)
54
+
55
+ c.action do |args, options|
56
+ options['method'] = 'git'
57
+ options['git_url'].sub!(/^\./, Dir.pwd)
58
+ Octopress::Deploy.init_config(options)
59
+ end
60
+ end
61
+
62
+ c.command(:s3) do |c|
63
+ c.syntax 's3 [options]'
64
+ c.description "Create an S3 deployment configuration file."
65
+ c.option 'bucket_name', '-b', '--bucket NAME', 'S3 Bucket name'
66
+ c.option 'access_key_id', '-a', '--access KEY', 'Access key id'
67
+ c.option 'secret_access_key', '-s', '--secret KEY', 'Secret access key'
68
+ c.option 'region', '-r', '--region REGION', 'AWS region (default: us-east-1)'
69
+ c.option 'remote_path', '-d', '--dir DIR', 'Deploy site into a subdirectory.'
70
+ c.option 'verbose', '-v', '--verbose', 'Log verbose output when deploying (default: true)'
71
+ c.option 'delete', '--delete', 'Sync file deletion'
72
+ add_common_init_options(c)
73
+
74
+ c.action do |args, options|
75
+ options['method'] = 's3'
76
+ Octopress::Deploy.init_config(options)
77
+ end
34
78
  end
35
79
  end
36
80
 
@@ -49,6 +93,12 @@ module Octopress
49
93
  end
50
94
  end
51
95
  end
96
+
97
+ def self.add_common_init_options(c)
98
+ c.option 'site_dir', '--site', 'Path to generated site (default: _site).'
99
+ c.option 'force', '--force', 'Overwrite any exiting config file.'
100
+ c.option 'config_file', '--config FILE', 'Choose a config file name. (default. _deploy.yml)'
101
+ end
52
102
  end
53
103
  end
54
104
  end
@@ -10,11 +10,11 @@ module Octopress
10
10
  @local = @options[:site_dir] || '_site'
11
11
  @remote_path = @options[:remote_path]
12
12
  @exclude = @options[:exclude]
13
- @exclude_file = @options[:exclude_file]
14
- @exclude_file = File.expand_path(@exclude_file) if @exclude_file
13
+ @exclude_from = @options[:exclude_from]
14
+ @exclude_from = File.expand_path(@exclude_from) if @exclude_from
15
15
  @include = @options[:include]
16
- @exclude_file = @options[:include_file]
17
- @exclude_file = File.expand_path(@include_file) if @include_file
16
+ @exclude_from = @options[:include_from]
17
+ @exclude_from = File.expand_path(@include_from) if @include_from
18
18
  @delete = @options[:delete] || false
19
19
  @pull_dir = @options[:dir]
20
20
  end
@@ -35,10 +35,10 @@ module Octopress
35
35
 
36
36
  cmd = "rsync "
37
37
  cmd << "#{@flags} "
38
- cmd << " -e" if @exclude_file || @exclude
39
- cmd << " --exclude-from #{@exclude_file}" if @exclude_file
38
+ cmd << " -e" if @exclude_from || @exclude
39
+ cmd << " --exclude-from #{@exclude_from}" if @exclude_from
40
40
  cmd << " --exclude #{@exclude}" if @exclude
41
- cmd << " --include-from #{@include_file}" if @include_file
41
+ cmd << " --include-from #{@include_from}" if @include_from
42
42
  cmd << " --include #{@include}" if @include
43
43
  cmd << " --rsh='ssh -p#{@port}'" if @user && @port
44
44
  cmd << " --delete " if @delete
@@ -59,13 +59,13 @@ module Octopress
59
59
  #{"user: #{options[:user]}".ljust(40)} # The user for your host, e.g. user@host.com
60
60
  #{"remote_path: #{options[:remote_path]}".ljust(40)} # Destination directory
61
61
  #{"delete: #{options[:delete]}".ljust(40)} # Remove files from destination which don't match files in source
62
+ #{"port: #{options[:port]}".ljust(40)} # If your host requires a non standard port
63
+ #{"flags: #{options[:flags] || ' -avz'}".ljust(40)} # Modify flags as necessary to suit your hosting setup
62
64
 
63
- #{"# flags: #{options[:flags] || '-rltDvz'}".ljust(40)} # Modify flags as necessary to suit your hosting setup
64
- #{"# port: #{options[:port]}".ljust(40)} # If your host requires a non standard port
65
- #{"# exclude: ".ljust(40)} # Path to file containing list of files to exclude
66
- #{"# exclude-file: ".ljust(40)} # Path to file containing list of files to exclude
67
- #{"# include: ".ljust(40)} # Path to file containing list of files to include
68
- #{"# include-file: ".ljust(40)} # Path to file containing list of files to include
65
+ #{"# exclude: ".ljust(40)} # files to exclude
66
+ #{"# exclude-from: ".ljust(40)} # Path to file containing list of files to exclude
67
+ #{"# include: ".ljust(40)} # files to include
68
+ #{"# include-from: ".ljust(40)} # Path to file containing list of files to include
69
69
  CONFIG
70
70
  end
71
71
 
@@ -219,8 +219,8 @@ module Octopress
219
219
  #{"access_key_id: #{options[:access_key_id]}".ljust(40)} # Get this from your AWS console at aws.amazon.com.
220
220
  #{"secret_access_key: #{options[:secret_access_key]}".ljust(40)} # Keep it safe; keep it secret. Keep this file in your .gitignore.
221
221
  #{"remote_path: #{options[:remote_path] || '/'}".ljust(40)} # relative path on bucket where files should be copied.
222
+ #{"region: #{options[:remote_path] || 'us-east-1'}".ljust(40)} # Region where your bucket is located.
222
223
 
223
- #{"# region: #{options[:region] || 'us-east-1'}".ljust(40)} # Region where your bucket is located.
224
224
  #{"# delete: #{options[:delete] || 'true'}".ljust(40)} # Remove files from destination which do not match source files.
225
225
  #{"# verbose: #{options[:verbose] || 'true'}".ljust(40)} # Print out all file operations.
226
226
  CONFIG
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Deploy
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -23,6 +23,8 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "octopress"
25
25
  spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "clash"
27
+ spec.add_development_dependency "aws-sdk"
26
28
 
27
29
  if RUBY_VERSION >= "2"
28
30
  spec.add_development_dependency "pry-byebug"
@@ -0,0 +1,12 @@
1
+ method: git # How do you want to deploy? git, rsync or s3.
2
+ site_dir: _site # Location of your your static site files.
3
+
4
+ git_url: /Users/imathis/workspace/octodev/deploy/test/local-git # remote repository url, e.g. git@github.com:username/repo_name
5
+
6
+ # Note on git_branch:
7
+ # If using GitHub project pages, set the branch to 'gh-pages'.
8
+ # For GitHub user/organization pages or Heroku, set the branch to 'master'.
9
+ #
10
+ git_branch: test_git_deploy # Git branch where static site files are commited
11
+
12
+ remote_path: site # Destination directory
@@ -0,0 +1,13 @@
1
+ method: rsync # How do you want to deploy? git, rsync or s3.
2
+ site_dir: _site # Location of your your static site files.
3
+
4
+ user: # The user for your host, e.g. user@host.com
5
+ remote_path: local-rsync # Destination directory
6
+ delete: # Remove files from destination which don't match files in source
7
+ port: # If your host requires a non standard port
8
+ flags: -avz # Modify flags as necessary to suit your hosting setup
9
+
10
+ # exclude: # files to exclude
11
+ # exclude-from: # Path to file containing list of files to exclude
12
+ # include: # files to include
13
+ # include-from: # Path to file containing list of files to include
data/test/garbage.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'find'
2
+
3
+ def add_garbage
4
+ Find.find('_site').to_a.each do |f|
5
+ system("echo '#{garbage}' >> #{f}") unless File.directory?(f)
6
+ end
7
+ end
8
+
9
+ def garbage
10
+ o = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten
11
+ (0...50).map { o[rand(o.length)] }.join
12
+ end
13
+
14
+ add_garbage
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.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-25 00:00:00.000000000 Z
11
+ date: 2014-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorator
@@ -80,6 +80,34 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: clash
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: aws-sdk
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: pry-byebug
85
113
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +129,7 @@ executables: []
101
129
  extensions: []
102
130
  extra_rdoc_files: []
103
131
  files:
132
+ - ".clash.yml"
104
133
  - ".gitignore"
105
134
  - CHANGELOG.md
106
135
  - Gemfile
@@ -118,8 +147,9 @@ files:
118
147
  - octopress-deploy.gemspec
119
148
  - test/.gitignore
120
149
  - test/Gemfile
121
- - test/_deploy_rsync.yml
122
- - test/_deploy_rsync_local.yml
150
+ - test/_git_deploy_local.yml
151
+ - test/_rsync_deploy_local.yml
152
+ - test/garbage.rb
123
153
  - test/source/.hidden
124
154
  - test/source/dir/file
125
155
  - test/source/test_file
@@ -144,15 +174,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
174
  version: '0'
145
175
  requirements: []
146
176
  rubyforge_project:
147
- rubygems_version: 2.4.1
177
+ rubygems_version: 2.2.2
148
178
  signing_key:
149
179
  specification_version: 4
150
180
  summary: Easily deploy any Jekyll or Octopress site using S3, Git, or Rsync.
151
181
  test_files:
152
182
  - test/.gitignore
153
183
  - test/Gemfile
154
- - test/_deploy_rsync.yml
155
- - test/_deploy_rsync_local.yml
184
+ - test/_git_deploy_local.yml
185
+ - test/_rsync_deploy_local.yml
186
+ - test/garbage.rb
156
187
  - test/source/.hidden
157
188
  - test/source/dir/file
158
189
  - test/source/test_file
@@ -1,6 +0,0 @@
1
- method: rsync
2
- site_dir: build
3
- user: imathis@imathis.com
4
- port:
5
- remote_path: ~/octopress-deploy/rsync/
6
- delete:
@@ -1,6 +0,0 @@
1
- method: rsync
2
- site_dir: build
3
- user:
4
- port:
5
- remote_path: local-rsync
6
- delete: