circleci-bundle-update-pr 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +76 -11
- data/lib/circleci/bundle/update/pr.rb +2 -0
- data/lib/circleci/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: ec15a9ea284e113041573a7ee82f8aad3e5ad3dc
|
4
|
+
data.tar.gz: 9058ee5035d097cdb0e534a39072b2c1ef400023
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0aaf83bd78161760d3aef76081e543e5660cd5b417b10e82acb3434ad815d7dadb5f33d09e358f0fad85ca8bd213cb47c76d6aff5432bfb69280d9880b37022
|
7
|
+
data.tar.gz: fa8f7d28460191166be8daa72f3c9966e955b1823d634d1d592fac556dab0470ac1402733ca128e598e107e86dbe979cf532fe04c4651f8e5284702b133e86a4
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
circleci-bundle-update-pr (1.
|
4
|
+
circleci-bundle-update-pr (1.5.0)
|
5
5
|
compare_linker
|
6
6
|
octokit (~> 3.8)
|
7
7
|
|
@@ -9,12 +9,12 @@ GEM
|
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
11
|
addressable (2.3.8)
|
12
|
-
compare_linker (1.
|
12
|
+
compare_linker (1.3.0)
|
13
13
|
httpclient
|
14
14
|
octokit
|
15
15
|
faraday (0.9.2)
|
16
16
|
multipart-post (>= 1.2, < 3)
|
17
|
-
httpclient (2.
|
17
|
+
httpclient (2.8.2.4)
|
18
18
|
multipart-post (2.0.0)
|
19
19
|
octokit (3.8.0)
|
20
20
|
sawyer (~> 0.6.0, >= 0.5.3)
|
@@ -32,4 +32,4 @@ DEPENDENCIES
|
|
32
32
|
rake (~> 10.0)
|
33
33
|
|
34
34
|
BUNDLED WITH
|
35
|
-
1.
|
35
|
+
1.13.1
|
data/README.md
CHANGED
@@ -1,30 +1,95 @@
|
|
1
1
|
# Circleci::Bundle::Update::Pr [![Gem Version][gem-badge]][gem-link]
|
2
2
|
|
3
|
-
circleci-bundle-update-pr is
|
3
|
+
circleci-bundle-update-pr is an automation script for continuous bundle update and for sending a pull request via CircleCI [Nightly builds](https://circleci.com/docs/nightly-builds/).
|
4
|
+
|
5
|
+
By requesting a nightly build to CircleCI with an environment variable configured in `circle.yml` to execute this script, bundle update is invoked, then commit changes and send a pull request to GitHub repository if there some changes exist.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
|
9
|
+
```
|
10
|
+
$ gem install circleci-bundle-update-pr
|
11
|
+
```
|
12
|
+
|
13
|
+
## Prerequisites
|
14
|
+
|
15
|
+
The application on which you want to run continuous bundle update must be configured to be built on CircleCI.
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
### Setting GitHub personal access token to CircleCI
|
20
|
+
|
21
|
+
GitHub personal access token is required for sending pull requests to your repository.
|
22
|
+
|
23
|
+
1. Go to [your account's settings page](https://github.com/settings/tokens) and generate a personal access token with "repo" scope
|
24
|
+
2. On CircleCI dashboard, go to your application's "Project Settings" -> "Environment Variables"
|
25
|
+
3. Add an environment variable `GITHUB_ACCESS_TOKEN` with your GitHub personal access token
|
26
|
+
|
27
|
+
### Getting CircleCI API token
|
28
|
+
|
29
|
+
CircleCI API token is required to trigger nightly builds.
|
30
|
+
|
31
|
+
1. Go to your application's "Project Settings" -> "API Permissions"
|
32
|
+
2. Select "Create Token" and create a new token with "All" scope and any label you like
|
33
|
+
|
34
|
+
### Configure circle.yml
|
35
|
+
|
36
|
+
Configure your `circle.yml` to run `circleci-bundle-update-pr` if `BUNDLE_UPDATE` environment variable is present, for example:
|
8
37
|
|
9
|
-
```
|
10
|
-
|
38
|
+
```yaml
|
39
|
+
deployment:
|
40
|
+
production:
|
41
|
+
branch: master
|
42
|
+
commands:
|
43
|
+
- |
|
44
|
+
if [ "${BUNDLE_UPDATE}" ] ; then
|
45
|
+
gem update bundler --no-document
|
46
|
+
gem install circleci-bundle-update-pr
|
47
|
+
circleci-bundle-update-pr <username> <email>
|
48
|
+
fi
|
11
49
|
```
|
12
50
|
|
13
|
-
|
51
|
+
NOTE: Please make sure you replace `<username>` and `<email>` with yours.
|
14
52
|
|
15
|
-
|
53
|
+
### Trigger nightly build API via curl
|
16
54
|
|
17
|
-
|
55
|
+
The easiest way to start a nightly build is using curl. The below is a simple script to trigger a build.
|
18
56
|
|
19
|
-
|
57
|
+
```bash
|
58
|
+
_project=<username>/<reponame>
|
59
|
+
_branch=master
|
60
|
+
_circle_token=<ciecleci api token>
|
20
61
|
|
21
|
-
|
62
|
+
trigger_build_url=https://circleci.com/api/v1/project/${_project}/tree/${_branch}?circle-token=${_circle_token}
|
63
|
+
|
64
|
+
post_data='{ "build_parameters": { "BUNDLE_UPDATE": "true" } }'
|
65
|
+
|
66
|
+
curl \
|
67
|
+
--header "Accept: application/json" \
|
68
|
+
--header "Content-Type: application/json" \
|
69
|
+
--data "${post_data}" \
|
70
|
+
--request POST ${trigger_build_url}
|
71
|
+
```
|
72
|
+
|
73
|
+
NOTE: Please do not forget to replace `<username>/<reponame>/<circleci api token>` with yours.
|
74
|
+
|
75
|
+
|
76
|
+
### Trigger nightly build via ci-bundle-update (recommended)
|
22
77
|
|
23
|
-
|
78
|
+
While you can trigger nightly builds by using whatever you want for sending requests to API, the most recommended way is to use "ci-bundle-update". Please see https://github.com/masutaka/ci-bundle-update for details.
|
79
|
+
|
80
|
+
## CLI command references
|
81
|
+
|
82
|
+
General usage:
|
83
|
+
|
84
|
+
```
|
85
|
+
$ circleci-bundle-update-pr <git username> <git email address>
|
86
|
+
```
|
24
87
|
|
25
88
|
By default, it works only on master branch, but you can also explicitly specify any branches rather than only master branch by adding them to the arguments.
|
26
89
|
|
27
|
-
|
90
|
+
```
|
91
|
+
$ circleci-bundle-update-pr <git username> <git email address> master develop topic
|
92
|
+
```
|
28
93
|
|
29
94
|
## Contributing
|
30
95
|
|
@@ -55,6 +55,8 @@ module Circleci
|
|
55
55
|
compare_linker.formatter = CompareLinker::Formatter::Markdown.new
|
56
56
|
|
57
57
|
comment = <<-EOC
|
58
|
+
**Updated RubyGems:**
|
59
|
+
|
58
60
|
#{compare_linker.make_compare_links.to_a.join("\n")}
|
59
61
|
|
60
62
|
Powered by [compare_linker](https://rubygems.org/gems/compare_linker)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circleci-bundle-update-pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Masuda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|