travisci-bundle-update-pr 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07813eaffdc7e60e6ccc01bd45584c2669cc874a
4
- data.tar.gz: 24aa67654fd3f7b9f9c7b17bc487fd795b873084
3
+ metadata.gz: 39ad76420f782b2b8ffd59d82d91cd6f514ad992
4
+ data.tar.gz: 6d84f23d34c51d4c8aa30e0e4d1d480e9671c0c6
5
5
  SHA512:
6
- metadata.gz: bbf079f094652f8c625f323ad387eb957f96aa2e3fa42ef797bf2760fd0d8a2c8b524ed101f588d6df396aa0d05b86514ee0966f7c2ffaca19501ec9a27be64a
7
- data.tar.gz: 9526f89952ceba12280c77e757c09f319b567c71256452ed793f821ea5da462ba04a4e8df827fb26e188bc528684c9f2b615584e363e6f54aa43e05ff27e1d27
6
+ metadata.gz: 9560ef62ad5fe2e37d75d2e3d4b00abdcd93847be62bcd50928b93a85680c26f8ee29d16b892956d4b2d7d495f295c5427f2bcaa107502dc2556e688c9ff90ef
7
+ data.tar.gz: c1b7c4dde4a261e22d7172e692642219d475d63b4d334450279bdddc339796477629f91bbedb2ec9603cce9e54f8da70ed9860757fa4550b663795c15beadb1e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- travisci-bundle-update-pr (0.0.8)
4
+ travisci-bundle-update-pr (0.0.9)
5
5
  octokit (~> 4.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Travisci::Bundle::Update::Pr
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/travisci/bundle/update/pr`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Create GitHub PullRequest of bundle update in Travis CI.
6
4
 
7
5
  ## Installation
8
6
 
@@ -20,9 +18,41 @@ Or install it yourself as:
20
18
 
21
19
  $ gem install travisci-bundle-update-pr
22
20
 
23
- ## Usage
21
+ ## Getting Started
22
+
23
+ Set your GitHub Personal access tokens to `$GITHUB_ACCESS_TOKEN`:
24
+ Remember to keep your GitHub Personal access tokens secret, it should be encrypted.
25
+ https://docs.travis-ci.com/user/encryption-keys/
26
+
27
+ ```yaml
28
+ # .travis.yml
29
+ env:
30
+ global:
31
+ - secure: "ZYJeLUxLbTlEtcpNF1yKCuDYisK4epfddwB+z5woE0YnJwE/iSENzrjpfbMSD3rEvim1MY0LYLXaJw9EnUirTpElFQ7lXJZ1U924fubNdMiLqpypEmZ7G5NcNcMtv1VRyim4ZiHSzKX+DgWSz3v0+a9HEF0UOXhpF+w8th+Zg3l3x+eWclT1R7JKWAUs8l/8xUPspTXk5P6NoOnLuJaelS6BtwiEt8Bwn03uru3/+l9G4Dau/VTX/WQi8NippIida5GAvHoEFvFCptg4ucICUjjQAqCK0moKn5Ltr18SHa+MtJnp4rBaPkPvTlH9iaZuw0Pm8bGJPgrSAApfZwncopvNBSUrJv1kDT11b8MPR0Jq7VRxXUAf8wMYt4c/CYRR1gNqDi9QTaD111iIliFepNEcowXhNzG4pHmG/vM7oStcFjTpdY6SMW377tsDEh/O7z+jlW7DNeCI/AFKBAfsPZDDoXM1a+iA5WEKD46195li1WM5+221nOPilIzkvxiyJM68CZF5Yv6HkZXtSyc17AvWba/8t5+TBPu0GchTNe3AQ/JRgi0bGA7EkPonNavBh199HLo1/pG/zpUmLSxDP5hV7DxMoF8V1liHNFNZn0Qr9UeKC/JCx6s27zwEqSr9nU40+siP1ea8BCQW2n++aMQ9dmXZAJOqITNfWNayaMc="
32
+ ```
33
+
34
+ In such as `before_script` Lifecycle.
24
35
 
25
- TODO: Write usage instructions here
36
+ ```yaml
37
+ # .travis.yml
38
+ before_script:
39
+ - ./scripts/travisci-bundle-update-pr.sh
40
+ ```
41
+
42
+ In the case of Cron jobs run builds.
43
+ Cron Jobs are not enabled by default.
44
+ https://docs.travis-ci.com/user/cron-jobs/
45
+
46
+ ```bash
47
+ # .travisci-bundle-update-pr.sh
48
+ #!/bin/bash
49
+ set -ev
50
+
51
+ if [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
52
+ gem install travisci-bundle-update-pr
53
+ travisci-bundle-update-pr TravisCI travisci@travisci-bundle-update-pr.com
54
+ fi
55
+ ```
26
56
 
27
57
  ## Development
28
58
 
@@ -10,35 +10,28 @@ module Travisci
10
10
  raise "$TRAVIS_REPO_SLUG undefined." unless ENV['TRAVIS_REPO_SLUG']
11
11
  raise "$GITHUB_ACCESS_TOKEN undefined." unless ENV['GITHUB_ACCESS_TOKEN']
12
12
 
13
- unless system("bundle update && bundle update --ruby")
14
- raise "Unable to execute `bundle update && bundle update --ruby`"
13
+ unless system("bundle update")
14
+ raise "Unable to execute `bundle update`"
15
15
  end
16
16
  unless `git status -s 2> /dev/null`.include?('Gemfile.lock')
17
17
  return
18
18
  end
19
19
 
20
- now = Time.now.strftime('%Y%m%d%H%M%S')
21
- branch = "bundle-update-#{now}"
20
+ time = Time.now.strftime('%Y%m%d%H%M%S')
21
+ branch = "bundle-update-#{time}"
22
22
  system("git config --global user.name #{git_username}")
23
23
  system("git config --global user.email #{git_email}")
24
24
  system("git init")
25
25
  system("git checkout -b #{branch}")
26
26
  system("git add Gemfile.lock")
27
- system("git commit -m '$ bundle update && bundle update --ruby'")
27
+ system("git commit -m '$ bundle update'")
28
28
  system("git push --force --quiet \"https://${GITHUB_ACCESS_TOKEN}@github.com/#{ENV['TRAVIS_REPO_SLUG']}.git\" #{branch}:#{branch} > /dev/null 2>&1")
29
29
 
30
- title = "bundle update #{now}"
31
- body = 'Auto generated by [TravisCI]'
32
- repo_full_name = "#{ENV['TRAVIS_REPO_SLUG']}"
30
+ title = "bundle update #{time}"
31
+ body = "This PullRequest is generated in Travis CI."
33
32
 
34
33
  client = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN'])
35
- client.create_pull_request(
36
- repo_full_name,
37
- git_branch,
38
- branch,
39
- title,
40
- body
41
- )
34
+ client.create_pull_request("#{ENV['TRAVIS_REPO_SLUG']}", git_branch, branch, title, body)
42
35
  end
43
36
  end
44
37
  end
@@ -2,7 +2,7 @@ module Travisci
2
2
  module Bundle
3
3
  module Update
4
4
  module Pr
5
- VERSION = "0.0.8"
5
+ VERSION = "0.0.9"
6
6
  end
7
7
  end
8
8
  end
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Yasufumi Moritake"]
10
10
  spec.email = ["moritake@mediba.jp"]
11
11
 
12
- spec.summary = %q{Create GitHub PullRequest of bundle update in TravisCI.}
13
- spec.description = %q{A script for continues bundle update. Use in TravisCI.}
12
+ spec.summary = %q{Create GitHub PullRequest of bundle update in Travis CI.}
13
+ spec.description = %q{Create GitHub PullRequest of bundle update in Travis CI.}
14
14
  spec.homepage = "https://github.com/mediba-moritake/travisci-bundle-update-pr"
15
15
  spec.license = "MIT"
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travisci-bundle-update-pr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasufumi Moritake
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-07 00:00:00.000000000 Z
11
+ date: 2016-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
- description: A script for continues bundle update. Use in TravisCI.
69
+ description: Create GitHub PullRequest of bundle update in Travis CI.
70
70
  email:
71
71
  - moritake@mediba.jp
72
72
  executables:
@@ -112,5 +112,5 @@ rubyforge_project:
112
112
  rubygems_version: 2.5.1
113
113
  signing_key:
114
114
  specification_version: 4
115
- summary: Create GitHub PullRequest of bundle update in TravisCI.
115
+ summary: Create GitHub PullRequest of bundle update in Travis CI.
116
116
  test_files: []