middleman-deploy 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +7 -19
- data/Rakefile +1 -1
- data/lib/middleman-deploy/pkg-info.rb +2 -2
- data/lib/middleman-deploy/strategies/git/base.rb +11 -4
- data/lib/middleman-deploy/strategies/git/force_push.rb +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a43c05f5d3c90b6607a3d389cebeb028b0f9d38a
|
4
|
+
data.tar.gz: 19c4bfead327113f69ae24f7547bc3f61bfd968a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 932dc17f6510dfe8f88535a87e1ee34b0d383571a85a46b78d5fa80a8029843d5a5082530edde252f5d79600dccdd21b9c0f3dffb27bab25204e640bea96fda6
|
7
|
+
data.tar.gz: 6fcb2a5c9a6c323453dda468a758c937f08c58f78ed00edeefab8ffc7eb58cdbf7d8649bfd3081e555baa79b24bb204abf09942e9a81f5947ffa369d30adbc67
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Deploy your [Middleman](http://middlemanapp.com/) build via **rsync**, **ftp**,
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
gem 'middleman-deploy', '~>
|
8
|
+
gem 'middleman-deploy', '~> 1.0'
|
9
9
|
```
|
10
10
|
|
11
11
|
## Usage
|
@@ -146,20 +146,10 @@ namespace :deploy do
|
|
146
146
|
end
|
147
147
|
```
|
148
148
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
* `v0.1.0`
|
155
|
-
- Removed the `--clean` command-line option. This option only applied to
|
156
|
-
the rsync deploy method. The idea going forward is that command-line
|
157
|
-
options must apply to all deploy methods. Options that are specific to a
|
158
|
-
deploy method will only be available in `config.rb`.
|
159
|
-
- Removed `deploy` from the `after_build` hook. This caused a `deploy` to
|
160
|
-
be run each time `build` was called. This workflow never made
|
161
|
-
sense. `deploy` was added to the `after_build` hook simply because it
|
162
|
-
was available.
|
149
|
+
```
|
150
|
+
$ rake deploy:staging
|
151
|
+
$ rake deploy:production
|
152
|
+
```
|
163
153
|
|
164
154
|
## Badges
|
165
155
|
|
@@ -180,12 +170,10 @@ implementations:
|
|
180
170
|
- [JRuby][jruby]
|
181
171
|
- [Rubinius][rubinius]
|
182
172
|
|
183
|
-
## Thanks!
|
184
|
-
|
185
|
-
A **BIG** thanks to [everyone who has contributed](https://github.com/tvaughan/middleman-deploy/graphs/contributors)! Almost all pull requests are accepted.
|
186
|
-
|
187
173
|
# Credits
|
188
174
|
|
175
|
+
A **BIG** thanks to [everyone who has contributed](https://github.com/karlfreeman/middleman-deploy/graphs/contributors)! Almost all pull requests are accepted.
|
176
|
+
|
189
177
|
Inspiration:
|
190
178
|
|
191
179
|
- The rsync task in [Octopress](https://github.com/imathis/octopress)
|
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Middleman
|
2
2
|
module Deploy
|
3
3
|
PACKAGE = 'middleman-deploy'
|
4
|
-
VERSION = '0.
|
4
|
+
VERSION = '1.0.0'
|
5
5
|
TAGLINE = 'Deploy a middleman built site over rsync, ftp, sftp, or git (e.g. gh-pages on github).'
|
6
6
|
README = %Q{
|
7
7
|
You should follow one of the four examples below to setup the deploy
|
@@ -61,4 +61,4 @@ activate :deploy do |deploy|
|
|
61
61
|
deploy.password = "secret"
|
62
62
|
end}
|
63
63
|
end
|
64
|
-
end
|
64
|
+
end
|
@@ -3,13 +3,15 @@ module Middleman
|
|
3
3
|
module Strategies
|
4
4
|
module Git
|
5
5
|
class Base
|
6
|
-
attr_accessor :branch, :build_dir, :remote, :commit_message
|
6
|
+
attr_accessor :branch, :build_dir, :remote, :commit_message, :user_name, :user_email
|
7
7
|
|
8
8
|
def initialize(build_dir, remote, branch, commit_message)
|
9
9
|
self.branch = branch
|
10
10
|
self.build_dir = build_dir
|
11
11
|
self.remote = remote
|
12
12
|
self.commit_message = commit_message
|
13
|
+
self.user_name = `git config --get user.name`
|
14
|
+
self.user_email = `git config --get user.email`
|
13
15
|
end
|
14
16
|
|
15
17
|
def process
|
@@ -37,9 +39,14 @@ module Middleman
|
|
37
39
|
def commit_branch(options = '')
|
38
40
|
message = self.commit_message ? self.commit_message : add_signature_to_commit_message('Automated commit')
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
-
|
42
|
+
run_or_fail("git add -A")
|
43
|
+
run_or_fail("git commit --allow-empty -am \"#{message}\"")
|
44
|
+
run_or_fail("git push #{options} origin #{self.branch}")
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
def run_or_fail(command)
|
49
|
+
system(command) || raise("ERROR running: #{command}")
|
43
50
|
end
|
44
51
|
end
|
45
52
|
end
|
@@ -19,12 +19,18 @@ module Middleman
|
|
19
19
|
unless File.exist?('.git')
|
20
20
|
`git init`
|
21
21
|
`git remote add origin #{url}`
|
22
|
+
`git config user.name "#{self.user_name}"`
|
23
|
+
`git config user.name "#{self.user_email}"`
|
22
24
|
else
|
23
25
|
# check if the remote repo has changed
|
24
26
|
unless url == `git config --get remote.origin.url`.chop
|
25
27
|
`git remote rm origin`
|
26
28
|
`git remote add origin #{url}`
|
27
29
|
end
|
30
|
+
# check if the user name has changed
|
31
|
+
`git config user.name "#{self.user_name}"` unless self.user_name == `git config --get user.name`
|
32
|
+
# check if the user email has changed
|
33
|
+
`git config user.email "#{self.user_email}"` unless self.user_email == `git config --get user.email`
|
28
34
|
end
|
29
35
|
end
|
30
36
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Vaughan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: middleman-core
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- ".rubocop.yml"
|
152
152
|
- ".travis.yml"
|
153
153
|
- ".yardopts"
|
154
|
+
- CHANGELOG.md
|
154
155
|
- CONTRIBUTING.md
|
155
156
|
- Gemfile
|
156
157
|
- LICENSE.md
|