octopress-deploy 1.2.8 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/octopress-deploy.rb +22 -21
- data/lib/octopress-deploy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb1708ce95bc906465623ace6490388d0b83dab3
|
4
|
+
data.tar.gz: ca26c228f9d5fbdbe61ddf3950105338a281af58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c135e234c3447ce4f4a49004e4a8c0fe3f98df7c605c70b05bb82b6f5eb166b2ef634ff673597ed74639a782f4d33bab777ee4dc039055c171a6da285c8ce332
|
7
|
+
data.tar.gz: 93863c8a068ba4d87e6c689edffe962ac95ef3a97a72fe5fb5c31b28c1220600d50e3821affddbf4b327ec46a53ce09533aa34f30e7444ee116c52de8cd6ed1a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 1.3.0 - 2015-07-05
|
4
|
+
- New: Now `_deploy.yml` is processed through ERB, this means you can load configurations for ENV vars pretty easily. [#62](https://github.com/octopress/deploy/pull/62)
|
5
|
+
|
3
6
|
### 1.2.8 - 2015-06-29
|
4
7
|
- Fix: Using Regex quote to escape special characters in repo urls. [#61](https://github.com/octopress/deploy/pull/61)
|
5
8
|
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ $ gem install octopress
|
|
15
15
|
|
16
16
|
## Usage
|
17
17
|
|
18
|
-
For usage instructions, please refer to [
|
18
|
+
For usage instructions, please refer to the [Octopress CLI documentation](https://github.com/octopress/octopress#deploy).
|
19
19
|
|
20
20
|
## Contributing
|
21
21
|
|
data/lib/octopress-deploy.rb
CHANGED
@@ -26,12 +26,14 @@ module Octopress
|
|
26
26
|
:site_dir => '_site',
|
27
27
|
}
|
28
28
|
|
29
|
-
|
29
|
+
extend self
|
30
|
+
|
31
|
+
def push(options={})
|
30
32
|
options = merge_configs(options)
|
31
33
|
deployer(options).push
|
32
34
|
end
|
33
35
|
|
34
|
-
def
|
36
|
+
def pull(options={})
|
35
37
|
options = merge_configs(options)
|
36
38
|
|
37
39
|
if Dir.exist?(options[:dir]) &&
|
@@ -45,38 +47,37 @@ module Octopress
|
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
|
-
def
|
50
|
+
def add_bucket(options={})
|
49
51
|
options = merge_configs(options)
|
50
52
|
get_deployment_method(options).new(options).add_bucket()
|
51
53
|
end
|
52
54
|
|
53
|
-
def
|
54
|
-
options = check_config(options)
|
55
|
-
config = SafeYAML.load(File.open(options[:config_file])).to_symbol_keys
|
56
|
-
options = config.deep_merge(options)
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.check_config(options={})
|
55
|
+
def merge_configs(options={})
|
60
56
|
options = options.to_symbol_keys
|
61
57
|
options[:config_file] ||= DEFAULT_OPTIONS[:config_file]
|
62
58
|
|
63
|
-
|
59
|
+
load_config(options[:config_file]).deep_merge(options)
|
60
|
+
end
|
61
|
+
|
62
|
+
def load_config(path)
|
63
|
+
if File.exist?(path)
|
64
|
+
YAML.load(ERB.new(File.read(path)).result || {}).to_symbol_keys
|
65
|
+
else
|
64
66
|
abort "File not found: #{options[:config_file]}. Create a deployment config file with `octopress deploy init <METHOD>`."
|
65
67
|
end
|
66
|
-
|
67
|
-
options
|
68
68
|
end
|
69
69
|
|
70
|
-
|
70
|
+
|
71
|
+
def deployer(options)
|
71
72
|
get_deployment_method(options).new(options)
|
72
73
|
end
|
73
74
|
|
74
|
-
def
|
75
|
+
def get_deployment_method(options)
|
75
76
|
METHODS[options[:method].downcase]
|
76
77
|
end
|
77
78
|
|
78
79
|
|
79
|
-
def
|
80
|
+
def site_dir
|
80
81
|
if options[:site_dir]
|
81
82
|
options[:site_dir]
|
82
83
|
elsif File.exist? '_config.yml'
|
@@ -88,7 +89,7 @@ module Octopress
|
|
88
89
|
|
89
90
|
# Create a config file
|
90
91
|
#
|
91
|
-
def
|
92
|
+
def init_config(options={})
|
92
93
|
options = options.to_symbol_keys
|
93
94
|
|
94
95
|
if !options[:method]
|
@@ -100,7 +101,7 @@ module Octopress
|
|
100
101
|
check_gitignore
|
101
102
|
end
|
102
103
|
|
103
|
-
def
|
104
|
+
def write_config
|
104
105
|
if File.exist?(@options[:config_file]) && !@options[:force]
|
105
106
|
abort "A config file already exists at #{@options[:config_file]}. Use --force to overwrite."
|
106
107
|
end
|
@@ -114,7 +115,7 @@ module Octopress
|
|
114
115
|
puts "Modify these configurations as necessary."
|
115
116
|
end
|
116
117
|
|
117
|
-
def
|
118
|
+
def get_config
|
118
119
|
<<-FILE
|
119
120
|
#{"method: #{@options[:method]}".ljust(40)} # How do you want to deploy? git, rsync or s3.
|
120
121
|
#{"site_dir: #{@options[:site_dir]}".ljust(40)} # Location of your static site files.
|
@@ -127,7 +128,7 @@ FILE
|
|
127
128
|
#
|
128
129
|
# returns: Boolean - whether it is present or not.
|
129
130
|
#
|
130
|
-
def
|
131
|
+
def check_gitignore
|
131
132
|
gitignore = File.join(`git rev-parse --show-toplevel`.strip, ".gitignore")
|
132
133
|
|
133
134
|
if !File.exist?(gitignore) ||
|
@@ -139,7 +140,7 @@ FILE
|
|
139
140
|
end
|
140
141
|
end
|
141
142
|
|
142
|
-
def
|
143
|
+
def gem_dir(*subdirs)
|
143
144
|
File.expand_path(File.join(File.dirname(__FILE__), '../', *subdirs))
|
144
145
|
end
|
145
146
|
|
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.
|
4
|
+
version: 1.3.0
|
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-
|
11
|
+
date: 2015-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorator
|