jekyll-deploy 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0c862ee1ae0061b143819948ee65a01ddcfae6fb
4
+ data.tar.gz: c91dd1939273c1d1643616f483dc1ebbaaf8e941
5
+ SHA512:
6
+ metadata.gz: b12367abd5ed239aad657354099d8cf2bc791d06f33ffbaf83fcb5cdc343a985223f7e5c3f66577617cb584fb3ab3646f9c5aeeb30473ef40c14cdc4c238cad0
7
+ data.tar.gz: 00cb92148cb028ad12dae4005f120cde23a06911bef0c73ae68aa963b46d1c572c23dac7774a56dd70a634a65b90982506d2049e355bc9b78e20a66c6c5a42dc
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Vincent Wochnik.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,46 @@
1
+ # Jekyll Deploy [![Gem Version](https://badge.fury.io/rb/jekyll-deploy.png)](http://badge.fury.io/rb/jekyll-deploy)
2
+
3
+ > Jekyll 3.0-compatible deploy plugin
4
+
5
+ Jekyll Deploy is a Jekyll plugin which adds a `deploy` sub-command to the `jekyll` executable which allows deploy commands to be executed quickly.
6
+
7
+ ## Installation
8
+
9
+ This plugin is available as a [RubyGem][ruby-gem].
10
+
11
+ Add this line to your application's `Gemfile`:
12
+
13
+ ```
14
+ group :jekyll_plugins do
15
+ gem 'jekyll-deploy'
16
+ end
17
+ ```
18
+
19
+ And then execute the `bundle` command to install the gem.
20
+
21
+ After the plugin has been installed successfully, the `deploy` sub-command is available for use.
22
+
23
+ # Configuration
24
+
25
+ The `deploy` command executes all commands specified in the `deploy` array inside the site's configuration file as the following example demonstrates:
26
+
27
+ ```
28
+ deploy:
29
+ - rsync -aze ssh --delete ./ example.com:www/
30
+ ```
31
+
32
+ All commands are executed within the site's destination directory which is, by default, `_site` but can be changed with the `destination` configuration option.
33
+
34
+ The `deploy` command supports the built-in `--config`, `--destination` and `--verbose` command line options.
35
+
36
+ # Contribute
37
+
38
+ Fork this repository, make your changes and then issue a pull request. If you find bugs or have new ideas that you do not want to implement yourself, file a bug report.
39
+
40
+ # Copyright
41
+
42
+ Copyright (c) 2015 Vincent Wochnik.
43
+
44
+ License: MIT
45
+
46
+ [ruby-gem]: https://rubygems.org/gems/jekyll-deploy
@@ -0,0 +1,7 @@
1
+ module Jekyll
2
+ module Deploy
3
+ autoload :VERSION, 'jekyll/deploy/version.rb'
4
+ end
5
+ end
6
+
7
+ require 'jekyll/commands/deploy.rb'
@@ -0,0 +1,67 @@
1
+ require 'open3'
2
+
3
+ module Jekyll
4
+ module Commands
5
+ class Deploy < Command
6
+
7
+ class << self
8
+
9
+ def init_with_program(prog)
10
+ prog.command(:deploy) do |c|
11
+ c.syntax 'deploy'
12
+ c.description 'Deploys the contents of the currently built site.'
13
+ c.option 'config', '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
14
+ c.option 'destination', '-d', '--destination DESTINATION', 'The current folder will be generated into DESTINATION'
15
+ c.option 'verbose', '-V', '--verbose', 'Print verbose output.'
16
+ c.alias :d
17
+
18
+ c.action do |args, options|
19
+ Jekyll::Commands::Deploy.process(options)
20
+ end
21
+ end
22
+
23
+ def process(options)
24
+ # Adjust verbosity quickly
25
+ Jekyll.logger.adjust_verbosity(options)
26
+
27
+ options = configuration_from_options(options)
28
+
29
+ deploy = options.fetch('deploy', [])
30
+ if !deploy.is_a?(Array) || !deploy.all? { |d| d.is_a?(String) }
31
+ Jekyll.logger.error "Invalid deploy options."
32
+ elsif deploy.length == 0
33
+ Jekyll.logger.error "No deploy commands specified."
34
+ else
35
+ Jekyll.logger.info "Working directory:", options['destination']
36
+ deploy.each do |command|
37
+ unless execute(command, options['destination'])
38
+ Jekyll.logger.error "Deploy aborted."
39
+ break
40
+ end
41
+ end
42
+ end
43
+ end
44
+
45
+ def execute(command, directory)
46
+ t = Time.now
47
+ Jekyll.logger.info "Executing '#{command}'..."
48
+ output, status = Open3.capture2(command, :chdir => directory)
49
+ output.each_line { |line| Jekyll.logger.debug line.chomp }
50
+ if status.success?
51
+ Jekyll.logger.info "", "done in #{(Time.now - t).round(3)} seconds."
52
+ else
53
+ if status.exited?
54
+ Jekyll.logger.error "", "failed with status code #{status.exitstatus} in #{(Time.now - t).round(3)} seconds."
55
+ else
56
+ Jekyll.logger.error "", "aborted in #{(Time.now - t).round(3)} seconds."
57
+ end
58
+ end
59
+ status.success?
60
+ end
61
+ end
62
+
63
+ end # end of class << self
64
+
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,5 @@
1
+ module Jekyll
2
+ module Deploy
3
+ VERSION = '0.0.2'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-deploy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Vincent Wochnik
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jekyll
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ description: Jekyll 3.0-compatible deploy plugin
28
+ email:
29
+ - v.wochnik@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - lib/jekyll/commands/deploy.rb
35
+ - lib/jekyll/deploy/version.rb
36
+ - lib/jekyll-deploy.rb
37
+ - README.md
38
+ - LICENSE.md
39
+ homepage: https://github.com/vwochnik/jekyll-deploy
40
+ licenses:
41
+ - MIT
42
+ metadata: {}
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - '>='
50
+ - !ruby/object:Gem::Version
51
+ version: 1.9.3
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 2.0.14
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: This plugin provides a simple jekyll command for deploying your static site.
63
+ test_files: []