static_deploy 0.2.0 → 0.3.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 +5 -5
- data/README.md +12 -6
- data/lib/static_deploy.rb +1 -3
- data/lib/static_deploy/publish_task.rb +14 -14
- data/lib/static_deploy/version.rb +2 -2
- data/spec/static_deploy_spec.rb +3 -7
- data/static_deploy.gemspec +8 -4
- metadata +49 -21
- data/.gitignore +0 -17
- data/.rspec +0 -2
- data/.ruby-version +0 -1
- data/.travis.yml +0 -3
- data/Gemfile +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1873d1fea3044a35f6c5f56fdd30b283b071aa6a74ac053a7065b8d2ae2c3749
|
4
|
+
data.tar.gz: 133be672b6abef37cb16a483cbc77d37b8683ebd52188d45fee32558db906f4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57ee9a0760d4c83b0e469942578a6337a9870340d771612cb9c56a673ff2d89351ac262eb7532eab7d5a2a3347eff1dfb8826732dda91445406e0655ab0df96f
|
7
|
+
data.tar.gz: 548597e02866d35d340d3115af98a12dd891efa7895a27c71efe4f8fc600e19e153a7765b6a4d4154a5d0e6307eac4e8a14f25732dc17e7a47bbb672b630d2c2
|
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# StaticDeploy
|
2
2
|
|
3
|
-
|
3
|
+
[][gem]
|
4
|
+
[][travis]
|
5
|
+
|
6
|
+
[gem]: http://badge.fury.io/rb/static_deploy
|
7
|
+
[travis]: http://travis-ci.org/piotrmurach/static_deploy
|
8
|
+
|
9
|
+
> Rake tasks to ease publishing a static website via git to a remote repository (e.g. GitHub pages).
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -18,7 +24,7 @@ Or install it yourself as:
|
|
18
24
|
|
19
25
|
## Usage
|
20
26
|
|
21
|
-
In
|
27
|
+
In `Rakefile` add the following:
|
22
28
|
|
23
29
|
```ruby
|
24
30
|
require 'static_deploy'
|
@@ -27,19 +33,19 @@ ENV['GENERATOR'] = 'jekyll' # => static website generator executable
|
|
27
33
|
ENV['COMMAND'] = 'build' # => command for building a project, defaults to 'build'
|
28
34
|
```
|
29
35
|
|
30
|
-
|
36
|
+
When deploying inside the current repository, git defaults are used to get username and repository name:
|
31
37
|
|
32
38
|
```ruby
|
33
39
|
bundle exec rake site:publish
|
34
40
|
```
|
35
41
|
|
36
|
-
Otherwise, to publish to remote branch
|
42
|
+
Otherwise, to publish to remote branch in the different repository do:
|
37
43
|
|
38
44
|
```ruby
|
39
45
|
bundle exec rake site:publish["username/repository"]
|
40
46
|
```
|
41
47
|
|
42
|
-
As a convenience you may
|
48
|
+
As a convenience you may want to add the following rake task to your `Rakefile`:
|
43
49
|
|
44
50
|
```ruby
|
45
51
|
desc 'publish this site'
|
@@ -58,4 +64,4 @@ end
|
|
58
64
|
|
59
65
|
## Copyright
|
60
66
|
|
61
|
-
Copyright (c) 2013
|
67
|
+
Copyright (c) 2013 Piotr Murach. See LICENSE for further details.
|
data/lib/static_deploy.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'fileutils'
|
4
|
-
require 'tty'
|
4
|
+
require 'tty-prompt'
|
5
5
|
|
6
6
|
BUILD_DIR = "_site"
|
7
7
|
ROOT = `git rev-parse --show-toplevel`.strip
|
8
8
|
DEFAULT_URL = `git config --get remote.origin.url`.strip
|
9
9
|
REGEX = /^.+:(.*)\/(.*).git$/
|
10
10
|
|
11
|
-
def
|
12
|
-
@
|
11
|
+
def prompt
|
12
|
+
@prompt ||= TTY::Prompt.new
|
13
13
|
end
|
14
14
|
|
15
15
|
def default_user
|
@@ -36,12 +36,12 @@ end
|
|
36
36
|
namespace :site do
|
37
37
|
desc "Prepare remote branch"
|
38
38
|
task :prepare, [:repo] do |t, args|
|
39
|
-
|
39
|
+
prompt.ok "=> Preparing..."
|
40
40
|
|
41
41
|
mkdir_p BUILD_DIR
|
42
42
|
|
43
43
|
cd BUILD_DIR do
|
44
|
-
unless File.
|
44
|
+
unless File.exist?(".git")
|
45
45
|
sh "git init"
|
46
46
|
sh "git remote add github git@github.com:#{args.repo}.git"
|
47
47
|
sh "git fetch github"
|
@@ -60,7 +60,7 @@ namespace :site do
|
|
60
60
|
|
61
61
|
desc "Fetch upstream changes on gh pages"
|
62
62
|
task :sync, [:repo] do |t, args|
|
63
|
-
|
63
|
+
prompt.ok "=> Synching..."
|
64
64
|
|
65
65
|
cd BUILD_DIR do
|
66
66
|
sh "git fetch github"
|
@@ -72,7 +72,7 @@ namespace :site do
|
|
72
72
|
|
73
73
|
desc "Compile files into #{BUILD_DIR} directory"
|
74
74
|
task :build do
|
75
|
-
|
75
|
+
prompt.ok "=> Building..."
|
76
76
|
|
77
77
|
cd ROOT do
|
78
78
|
sh "bundle exec #{generator} #{command}"
|
@@ -83,22 +83,22 @@ namespace :site do
|
|
83
83
|
task :publish, [:repo] => [:prepare, :sync, :build] do |t, args|
|
84
84
|
args.with_defaults(:repo => "#{default_user}/#{default_repo}")
|
85
85
|
|
86
|
-
message =
|
87
|
-
|
88
|
-
end
|
86
|
+
message = prompt.ask "Provide a deployment message for #{args.repo}: " do |q|
|
87
|
+
q.required true
|
88
|
+
end
|
89
89
|
|
90
|
-
|
90
|
+
prompt.ok "=> Deploying to #{args.repo} GitHub Pages..."
|
91
91
|
|
92
92
|
cd BUILD_DIR do
|
93
93
|
sh 'git add --all'
|
94
94
|
if /nothing to commit/ =~ `git status`
|
95
|
-
|
95
|
+
prompt.ok "No changes to commit."
|
96
96
|
else
|
97
97
|
sh "git commit -m '#{message.gsub("'", "\\'")}'"
|
98
98
|
end
|
99
99
|
sh "git push github gh-pages"
|
100
100
|
end
|
101
101
|
|
102
|
-
|
102
|
+
prompt.ok "Site build. OK"
|
103
103
|
end
|
104
104
|
end
|
data/spec/static_deploy_spec.rb
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe StaticDeploy do
|
4
|
-
it '
|
5
|
-
StaticDeploy::VERSION.
|
6
|
-
end
|
7
|
-
|
8
|
-
it 'should do something useful' do
|
9
|
-
false.should be_true
|
3
|
+
RSpec.describe StaticDeploy do
|
4
|
+
it 'has a version number' do
|
5
|
+
expect(StaticDeploy::VERSION).to_not be_nil
|
10
6
|
end
|
11
7
|
end
|
data/static_deploy.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'static_deploy/version'
|
@@ -13,12 +12,17 @@ Gem::Specification.new do |spec|
|
|
13
12
|
spec.homepage = ""
|
14
13
|
spec.license = "MIT"
|
15
14
|
|
16
|
-
spec.files =
|
15
|
+
spec.files = Dir['{lib,spec}/**/*.rb', 'static_deploy.gemspec']
|
16
|
+
spec.files += Dir['README.md', 'LICENSE.txt', 'Rakefile']
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
21
|
+
spec.required_ruby_version = '>= 2.0.0'
|
22
22
|
|
23
|
-
spec.
|
23
|
+
spec.add_runtime_dependency 'tty-prompt', '~> 0.18'
|
24
|
+
spec.add_runtime_dependency 'rake'
|
25
|
+
|
26
|
+
spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.1'
|
24
28
|
end
|
metadata
CHANGED
@@ -1,43 +1,77 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: tty
|
14
|
+
name: tty-prompt
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.18'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: '0.18'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- -
|
45
|
+
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: 1.5.0
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '2.0'
|
34
51
|
type: :development
|
35
52
|
prerelease: false
|
36
53
|
version_requirements: !ruby/object:Gem::Requirement
|
37
54
|
requirements:
|
38
|
-
- -
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: 1.5.0
|
58
|
+
- - "<"
|
39
59
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
60
|
+
version: '2.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.1'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '3.1'
|
41
75
|
description: Automated deployment to GitHub pages
|
42
76
|
email:
|
43
77
|
- pmurach@gmail.com
|
@@ -45,11 +79,6 @@ executables: []
|
|
45
79
|
extensions: []
|
46
80
|
extra_rdoc_files: []
|
47
81
|
files:
|
48
|
-
- .gitignore
|
49
|
-
- .rspec
|
50
|
-
- .ruby-version
|
51
|
-
- .travis.yml
|
52
|
-
- Gemfile
|
53
82
|
- LICENSE.txt
|
54
83
|
- README.md
|
55
84
|
- Rakefile
|
@@ -69,17 +98,17 @@ require_paths:
|
|
69
98
|
- lib
|
70
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
100
|
requirements:
|
72
|
-
- -
|
101
|
+
- - ">="
|
73
102
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
103
|
+
version: 2.0.0
|
75
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
105
|
requirements:
|
77
|
-
- -
|
106
|
+
- - ">="
|
78
107
|
- !ruby/object:Gem::Version
|
79
108
|
version: '0'
|
80
109
|
requirements: []
|
81
110
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.7.3
|
83
112
|
signing_key:
|
84
113
|
specification_version: 4
|
85
114
|
summary: Provides rake tasks for publishing your static site to github pages to any
|
@@ -87,4 +116,3 @@ summary: Provides rake tasks for publishing your static site to github pages to
|
|
87
116
|
test_files:
|
88
117
|
- spec/spec_helper.rb
|
89
118
|
- spec/static_deploy_spec.rb
|
90
|
-
has_rdoc:
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0.0
|
data/.travis.yml
DELETED