travisci-bundle-update-pr 0.0.9 → 0.0.10
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/Gemfile.lock +1 -1
- data/README.md +26 -9
- data/exe/travisci-bundle-update-pr +1 -1
- data/lib/travisci/bundle/update/pr.rb +10 -10
- data/lib/travisci/bundle/update/pr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b806e34c25c37c581cb15eb9246d7cfbf5714aa
|
|
4
|
+
data.tar.gz: de3aed8749b0d3bc4b99009d91785917b8090226
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b4c12eae5b92c44f83470ce18e42b37a43aa63f2a9553ff071c3dafad42637fa081a3d9359bc855d42feacb1ebfa06a9077a99a0b816f206404fde4fe0da75a1
|
|
7
|
+
data.tar.gz: 82511cc1eed71f73374cd119c744f1a6dbb63964b2a3c9617f369f46e960ed3734f1d5db714960fb2bf73f120522c9d94ee8c72b0e146499c41cefb125dd78b4
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -20,9 +20,12 @@ Or install it yourself as:
|
|
|
20
20
|
|
|
21
21
|
## Getting Started
|
|
22
22
|
|
|
23
|
-
Set your GitHub Personal access tokens to `$GITHUB_ACCESS_TOKEN
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
Set your GitHub Personal access tokens to `$GITHUB_ACCESS_TOKEN`. Remember to keep your GitHub Personal access tokens secret.
|
|
24
|
+
https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Or GitHub Personal access tokens should be encrypted.
|
|
28
|
+
https://docs.travis-ci.com/user/encryption-keys/
|
|
26
29
|
|
|
27
30
|
```yaml
|
|
28
31
|
# .travis.yml
|
|
@@ -39,18 +42,32 @@ before_script:
|
|
|
39
42
|
- ./scripts/travisci-bundle-update-pr.sh
|
|
40
43
|
```
|
|
41
44
|
|
|
42
|
-
In the case of Cron jobs run builds.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
In the case of Cron jobs run builds. Cron Jobs are not enabled by default.
|
|
46
|
+
https://docs.travis-ci.com/user/cron-jobs/
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# travisci-bundle-update-pr.sh
|
|
50
|
+
|
|
51
|
+
#!/bin/bash
|
|
52
|
+
set -ev
|
|
53
|
+
|
|
54
|
+
if [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
|
|
55
|
+
gem install travisci-bundle-update-pr
|
|
56
|
+
travisci-bundle-update-pr TravisCI travisci@example.com master
|
|
57
|
+
fi
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If you want to set the path of Gemfile.
|
|
45
61
|
|
|
46
62
|
```bash
|
|
47
|
-
#
|
|
63
|
+
# travisci-bundle-update-pr.sh
|
|
64
|
+
|
|
48
65
|
#!/bin/bash
|
|
49
66
|
set -ev
|
|
50
67
|
|
|
51
68
|
if [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
|
|
52
69
|
gem install travisci-bundle-update-pr
|
|
53
|
-
travisci-bundle-update-pr TravisCI travisci@
|
|
70
|
+
travisci-bundle-update-pr TravisCI travisci@example.com master target_path
|
|
54
71
|
fi
|
|
55
72
|
```
|
|
56
73
|
|
|
@@ -62,7 +79,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
62
79
|
|
|
63
80
|
## Contributing
|
|
64
81
|
|
|
65
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
82
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/mediba-moritake/travisci-bundle-update-pr. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
66
83
|
|
|
67
84
|
|
|
68
85
|
## License
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
require "travisci/bundle/update/pr"
|
|
4
4
|
|
|
5
|
-
Travisci::Bundle::Update::Pr.start(git_username: ARGV.shift, git_email: ARGV.shift, git_branch: ARGV.empty? ? 'master' : ARGV)
|
|
5
|
+
Travisci::Bundle::Update::Pr.start(git_username: ARGV.shift, git_email: ARGV.shift, git_branch: ARGV.empty? ? 'master' : ARGV.shift, path: ARGV.empty? ? '' : ARGV.shift)
|
|
@@ -5,27 +5,27 @@ module Travisci
|
|
|
5
5
|
module Bundle
|
|
6
6
|
module Update
|
|
7
7
|
module Pr
|
|
8
|
-
def self.start(git_username: nil, git_email: nil, git_branch:
|
|
8
|
+
def self.start(git_username: nil, git_email: nil, git_branch: nil, path: nil)
|
|
9
9
|
raise "travisci-bundle-update-pr can be executed only in Travis CI." unless ENV['TRAVIS']
|
|
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")
|
|
13
|
+
unless system("cd #{ENV['TRAVIS_BUILD_DIR']}/#{path} && bundle update")
|
|
14
14
|
raise "Unable to execute `bundle update`"
|
|
15
15
|
end
|
|
16
|
-
unless `git status -s 2> /dev/null`.include?('Gemfile.lock')
|
|
16
|
+
unless `cd #{ENV['TRAVIS_BUILD_DIR']} && git status -s 2> /dev/null`.include?('Gemfile.lock')
|
|
17
17
|
return
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
time = Time.now.strftime('%Y%m%d%H%M%S')
|
|
21
21
|
branch = "bundle-update-#{time}"
|
|
22
|
-
system("git config --global user.name #{git_username}")
|
|
23
|
-
system("git config --global user.email #{git_email}")
|
|
24
|
-
system("git init")
|
|
25
|
-
system("git checkout -b #{branch}")
|
|
26
|
-
system("git add Gemfile.lock")
|
|
27
|
-
system("git commit -m '$ bundle update'")
|
|
28
|
-
system("git push --force --quiet \"https://${GITHUB_ACCESS_TOKEN}@github.com/#{ENV['TRAVIS_REPO_SLUG']}.git\" #{branch}:#{branch} > /dev/null 2>&1")
|
|
22
|
+
system("cd #{ENV['TRAVIS_BUILD_DIR']} && git config --global user.name #{git_username}")
|
|
23
|
+
system("cd #{ENV['TRAVIS_BUILD_DIR']} && git config --global user.email #{git_email}")
|
|
24
|
+
system("cd #{ENV['TRAVIS_BUILD_DIR']} && git init")
|
|
25
|
+
system("cd #{ENV['TRAVIS_BUILD_DIR']} && git checkout -b #{branch}")
|
|
26
|
+
system("cd #{ENV['TRAVIS_BUILD_DIR']}/#{path} && git add Gemfile.lock")
|
|
27
|
+
system("cd #{ENV['TRAVIS_BUILD_DIR']} && git commit -m '$ bundle update'")
|
|
28
|
+
system("cd #{ENV['TRAVIS_BUILD_DIR']} && git push --force --quiet \"https://${GITHUB_ACCESS_TOKEN}@github.com/#{ENV['TRAVIS_REPO_SLUG']}.git\" #{branch}:#{branch} > /dev/null 2>&1")
|
|
29
29
|
|
|
30
30
|
title = "bundle update #{time}"
|
|
31
31
|
body = "This PullRequest is generated in Travis CI."
|
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.
|
|
4
|
+
version: 0.0.10
|
|
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-
|
|
11
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: octokit
|