jgd 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bash/deploy.sh +38 -0
  4. data/bin/jgd +16 -2
  5. data/jgd.gemspec +3 -2
  6. metadata +20 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 355388fed4d6b51004514026d405b6e3f2f0da6f
4
- data.tar.gz: 79e51ca0911129a320ae032bfc42f11256e24056
3
+ metadata.gz: a4643fbdccc90db3d7222715cb7c23d532a74d22
4
+ data.tar.gz: c1fb60f3f19e08de7aaff6433555508a34b886c6
5
5
  SHA512:
6
- metadata.gz: 22166399484655857eac5ac2fe1e20fbd1506ccc0613203bd52d980d04fd648827d98b7c822efcf51b10d501f077fd20b77a89c666aa89db1cdc04ac44dfa1e3
7
- data.tar.gz: ab3c3475bcae261e33710391edc6639f24cc863fa5c93f5061d46e2123bf0a591893a29d4624494332984129b0cfe3a84017cb0fe4e326427985ad90ff3c3ea0
6
+ metadata.gz: 6d2aa75f56626108af27c1f71e15dccfa7fd253fc32bc6f86c2dc87f0730f9b0d78ba6dda30dd6a4967ef5c0175f62d2591abeb79acccb04ecd18a59c194bd5a
7
+ data.tar.gz: 8a3f38cfb5bd7638b0f3328ec44d5a123ce4cb60e837b8bc1e1c398b1e7703ff03595735625729a2637c6e57c4706a7f2b5fc485e4d34e8a913ddc19682b6a48
data/README.md CHANGED
@@ -27,5 +27,5 @@ env:
27
27
  - secure: ...
28
28
  install:
29
29
  - bundle
30
- script: jgd --url=http://yegor256:${PASSWORD}@github.com/yegor256/blog.git
30
+ script: jgd -u http://yegor256:${PASSWORD}@github.com/yegor256/blog.git
31
31
  ```
@@ -0,0 +1,38 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ URL=$1
5
+ SRC=$(pwd)
6
+ TEMP=$(mktemp -d -t jgd-XXX)
7
+ trap "rm -rf ${TEMP}" EXIT
8
+ CLONE=${TEMP}/clone
9
+
10
+ echo -e "Cloning Github repository:"
11
+ git clone "${URL}" "${CLONE}"
12
+
13
+ echo -e "\nBuilding Jekyll site:"
14
+ cd "${CLONE}"
15
+ rm -rf _site
16
+ jekyll build
17
+ cp -R _site ${TEMP}
18
+
19
+ echo -e "\nPreparing gh-pages branch:"
20
+ if [ -z "$(git branch -a | grep origin/gh-pages)" ]; then
21
+ git checkout --orphan gh-pages
22
+ else
23
+ git checkout gh-pages
24
+ fi
25
+
26
+ echo -e "\nDeploying into gh-pages branch:"
27
+ rm -rf *
28
+ cp -R ${TEMP}/_site/* .
29
+ rm README.md
30
+ git add .
31
+ git config user.email "jgd@teamed.io"
32
+ git config user.name "jekyll-github-deploy"
33
+ git commit -am "new site version deployed" --allow-empty
34
+ git push origin gh-pages 2>&1 | sed 's|'$URL'|[skipped]|g'
35
+
36
+ echo -e "\nCleaning up:"
37
+ rm -rf "${CLONE}"
38
+ rm -rf "${SITE}"
data/bin/jgd CHANGED
@@ -1,8 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
2
  STDOUT.sync = true
3
3
 
4
+ require 'trollop'
5
+ opts = Trollop::options do
6
+ banner <<-EOS
7
+ jgd is an automated deployer of Jekyll site to Github Pages
8
+
9
+ Usage: jgd [options]
10
+ EOS
11
+ opt :url, "Github URL", :type=>String, :default=>''
12
+ end
13
+
14
+ url = opts[:url]
15
+ if url.empty?
16
+ url = `git config --get remote.origin.url`
17
+ end
18
+
4
19
  spec = Gem::Specification.find_by_name("jgd")
5
20
  root = spec.gem_dir
6
21
  script = File.join(root, 'bash/deploy.sh')
7
-
8
- %x[ #{script} test ]
22
+ system("#{script} #{url}")
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.rubygems_version = '2.2.2'
6
6
  s.required_ruby_version = '>= 1.9.3'
7
7
  s.name = 'jgd'
8
- s.version = '1.0'
8
+ s.version = '1.1'
9
9
  s.license = 'MIT'
10
10
  s.summary = "Jekyll Github Deploy"
11
11
  s.description = "Automated deployment of your Jekyll blog to Github Pages"
@@ -17,5 +17,6 @@ Gem::Specification.new do |s|
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
18
  s.rdoc_options = ["--charset=UTF-8"]
19
19
  s.extra_rdoc_files = %w[README.md LICENSE.txt]
20
- s.add_runtime_dependency('jekyll')
20
+ s.add_runtime_dependency('trollop', '2.0')
21
+ s.add_runtime_dependency('jekyll', '1.5.1')
21
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jgd
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -10,20 +10,34 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: trollop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: jekyll
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - ">="
31
+ - - '='
18
32
  - !ruby/object:Gem::Version
19
- version: '0'
33
+ version: 1.5.1
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - ">="
38
+ - - '='
25
39
  - !ruby/object:Gem::Version
26
- version: '0'
40
+ version: 1.5.1
27
41
  description: Automated deployment of your Jekyll blog to Github Pages
28
42
  email: yegor@tpc2.com
29
43
  executables:
@@ -37,6 +51,7 @@ files:
37
51
  - Gemfile
38
52
  - LICENSE.txt
39
53
  - README.md
54
+ - bash/deploy.sh
40
55
  - bin/jgd
41
56
  - jgd.gemspec
42
57
  homepage: http://github.com/yegor256/jekyll-github-deploy