circleci-bundle-update-pr 1.8.1 → 1.8.2
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 +5 -5
- data/README-for-CircleCI-1.0.md +108 -0
- data/README.md +53 -49
- data/lib/circleci/bundle/update/pr/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36a4846778ec35a7a29ecd10a7af3a7e32695186
|
4
|
+
data.tar.gz: 4deacf895acd8301f10b58a97f787a061be0b034
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 960221589331f17bae1ef8457b5f020c0dc714a3a6e455f1b852c527f9e72a69d7b660e0e2d251d24d5465a27eb4931e9ccad2eb5c48af6f42e018ad207ea50a
|
7
|
+
data.tar.gz: a28af0b2827b6395853f23ea737711f18f1f3bd26e3bf50a3c58324acaf7a0253d494c235d912824cf40badeb260acb726ea6edd3c5b7f0eb616d8c02159d2a2
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
circleci-bundle-update-pr (1.8.
|
4
|
+
circleci-bundle-update-pr (1.8.2)
|
5
5
|
compare_linker
|
6
6
|
octokit
|
7
7
|
|
@@ -17,10 +17,10 @@ GEM
|
|
17
17
|
multipart-post (>= 1.2, < 3)
|
18
18
|
httpclient (2.8.3)
|
19
19
|
multipart-post (2.0.0)
|
20
|
-
octokit (4.
|
20
|
+
octokit (4.8.0)
|
21
21
|
sawyer (~> 0.8.0, >= 0.5.3)
|
22
|
-
public_suffix (3.0.
|
23
|
-
rake (12.
|
22
|
+
public_suffix (3.0.1)
|
23
|
+
rake (12.3.0)
|
24
24
|
sawyer (0.8.1)
|
25
25
|
addressable (>= 2.3.5, < 2.6)
|
26
26
|
faraday (~> 0.8, < 1.0)
|
@@ -35,4 +35,4 @@ DEPENDENCIES
|
|
35
35
|
rake
|
36
36
|
|
37
37
|
BUNDLED WITH
|
38
|
-
1.16.
|
38
|
+
1.16.1
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# Circleci::Bundle::Update::Pr
|
2
|
+
|
3
|
+
[][circleci]
|
4
|
+
[][license]
|
5
|
+
[][gem-link]
|
6
|
+
|
7
|
+
[circleci]: https://circleci.com/gh/masutaka/circleci-bundle-update-pr
|
8
|
+
[license]: https://github.com/masutaka/circleci-bundle-update-pr/blob/master/LICENSE.txt
|
9
|
+
[gem-link]: http://badge.fury.io/rb/circleci-bundle-update-pr
|
10
|
+
|
11
|
+
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/).
|
12
|
+
|
13
|
+
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.
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
```
|
18
|
+
$ gem install circleci-bundle-update-pr
|
19
|
+
```
|
20
|
+
|
21
|
+
## Prerequisites
|
22
|
+
|
23
|
+
The application on which you want to run continuous bundle update must be configured to be built on CircleCI.
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
### Setting GitHub personal access token to CircleCI
|
28
|
+
|
29
|
+
GitHub personal access token is required for sending pull requests to your repository.
|
30
|
+
|
31
|
+
1. Go to [your account's settings page](https://github.com/settings/tokens) and generate a personal access token with "repo" scope
|
32
|
+
2. On CircleCI dashboard, go to your application's "Project Settings" -> "Environment Variables"
|
33
|
+
3. Add an environment variable `GITHUB_ACCESS_TOKEN` with your GitHub personal access token
|
34
|
+
|
35
|
+
### Getting CircleCI API token
|
36
|
+
|
37
|
+
CircleCI API token is required to trigger nightly builds.
|
38
|
+
|
39
|
+
1. Go to your application's "Project Settings" -> "API Permissions"
|
40
|
+
2. Select "Create Token" and create a new token with "All" scope and any label you like
|
41
|
+
|
42
|
+
### Configure circle.yml
|
43
|
+
|
44
|
+
Configure your `circle.yml` to run `circleci-bundle-update-pr` if `BUNDLE_UPDATE` environment variable is present, for example:
|
45
|
+
|
46
|
+
```yaml
|
47
|
+
deployment:
|
48
|
+
production:
|
49
|
+
branch: master
|
50
|
+
commands:
|
51
|
+
- |
|
52
|
+
if [ "${BUNDLE_UPDATE}" ] ; then
|
53
|
+
gem update bundler -N
|
54
|
+
gem install circleci-bundle-update-pr -N
|
55
|
+
circleci-bundle-update-pr <username> <email>
|
56
|
+
fi
|
57
|
+
```
|
58
|
+
|
59
|
+
NOTE: Please make sure you replace `<username>` and `<email>` with yours.
|
60
|
+
|
61
|
+
### Trigger nightly build API via curl
|
62
|
+
|
63
|
+
The easiest way to start a nightly build is using curl. The below is a simple script to trigger a build.
|
64
|
+
|
65
|
+
```bash
|
66
|
+
_project=<username>/<reponame>
|
67
|
+
_branch=master
|
68
|
+
_circle_token=<ciecleci api token>
|
69
|
+
|
70
|
+
trigger_build_url=https://circleci.com/api/v1/project/${_project}/tree/${_branch}?circle-token=${_circle_token}
|
71
|
+
|
72
|
+
post_data='{ "build_parameters": { "BUNDLE_UPDATE": "true" } }'
|
73
|
+
|
74
|
+
curl \
|
75
|
+
--header "Accept: application/json" \
|
76
|
+
--header "Content-Type: application/json" \
|
77
|
+
--data "${post_data}" \
|
78
|
+
--request POST ${trigger_build_url}
|
79
|
+
```
|
80
|
+
|
81
|
+
NOTE: Please do not forget to replace `<username>/<reponame>/<circleci api token>` with yours.
|
82
|
+
|
83
|
+
|
84
|
+
### Trigger nightly build via ci-build-trigger (recommended)
|
85
|
+
|
86
|
+
While you can trigger nightly builds by using whatever you want for sending requests to API, the most recommended way is to use "ci-build-trigger". Please see https://github.com/masutaka/ci-build-trigger for details.
|
87
|
+
|
88
|
+
## CLI command references
|
89
|
+
|
90
|
+
General usage:
|
91
|
+
|
92
|
+
```
|
93
|
+
$ circleci-bundle-update-pr <git username> <git email address>
|
94
|
+
```
|
95
|
+
|
96
|
+
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.
|
97
|
+
|
98
|
+
```
|
99
|
+
$ circleci-bundle-update-pr <git username> <git email address> master develop topic
|
100
|
+
```
|
101
|
+
|
102
|
+
## Contributing
|
103
|
+
|
104
|
+
1. Fork it ( https://github.com/masutaka/circleci-bundle-update-pr/fork )
|
105
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
106
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
107
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
108
|
+
5. Create a new Pull Request
|
data/README.md
CHANGED
@@ -8,9 +8,11 @@
|
|
8
8
|
[license]: https://github.com/masutaka/circleci-bundle-update-pr/blob/master/LICENSE.txt
|
9
9
|
[gem-link]: http://badge.fury.io/rb/circleci-bundle-update-pr
|
10
10
|
|
11
|
-
circleci-bundle-update-pr is an automation script for continuous bundle update and for sending a pull request
|
11
|
+
`circleci-bundle-update-pr` is an automation script for continuous bundle update and for sending a pull request using [`Scheduling a Workflow of CircleCI 2.0`](https://circleci.com/docs/2.0/workflows/#scheduling-a-workflow).
|
12
12
|
|
13
|
-
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.
|
13
|
+
By requesting a nightly build to CircleCI with an environment variable configured in `circle.yml` or `.circleci/config.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.
|
14
|
+
|
15
|
+
:bulb: [README.md for CircleCI 1.0 is here.](README-for-CircleCI-1.0.md)
|
14
16
|
|
15
17
|
## Installation
|
16
18
|
|
@@ -32,58 +34,63 @@ GitHub personal access token is required for sending pull requests to your repos
|
|
32
34
|
2. On CircleCI dashboard, go to your application's "Project Settings" -> "Environment Variables"
|
33
35
|
3. Add an environment variable `GITHUB_ACCESS_TOKEN` with your GitHub personal access token
|
34
36
|
|
35
|
-
### Getting CircleCI API token
|
36
|
-
|
37
|
-
CircleCI API token is required to trigger nightly builds.
|
38
|
-
|
39
|
-
1. Go to your application's "Project Settings" -> "API Permissions"
|
40
|
-
2. Select "Create Token" and create a new token with "All" scope and any label you like
|
41
|
-
|
42
37
|
### Configure circle.yml
|
43
38
|
|
44
|
-
Configure your `circle.yml` to run `circleci-bundle-update-pr
|
39
|
+
Configure your `circle.yml` or `.circleci/config.yml` to run `circleci-bundle-update-pr`, for example:
|
45
40
|
|
46
41
|
```yaml
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
42
|
+
version: 2
|
43
|
+
jobs:
|
44
|
+
build:
|
45
|
+
# snip
|
46
|
+
continuous_bundle_update:
|
47
|
+
docker:
|
48
|
+
- image: ruby:2.4.2-alpine
|
49
|
+
working_directory: /work
|
50
|
+
steps:
|
51
|
+
- run:
|
52
|
+
name: Install System Dependencies
|
53
|
+
command: |
|
54
|
+
# See also https://circleci.com/docs/2.0/custom-images/#adding-required-and-custom-tools-or-files
|
55
|
+
apk add --update --no-cache git openssh-client tar gzip ca-certificates \
|
56
|
+
tzdata
|
57
|
+
gem install -N bundler
|
58
|
+
- run:
|
59
|
+
name: Set timezone to Asia/Tokyo
|
60
|
+
command: cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
|
61
|
+
- checkout
|
62
|
+
- restore_cache:
|
63
|
+
name: Restore bundler cache
|
64
|
+
keys:
|
65
|
+
- gems-{{ .Environment.COMMON_CACHE_KEY }}-{{ checksum "Gemfile.lock" }}
|
66
|
+
- gems-{{ .Environment.COMMON_CACHE_KEY }}-
|
67
|
+
- run:
|
68
|
+
name: Setup requirements for continuous bundle update
|
69
|
+
command: gem install -N circleci-bundle-update-pr
|
70
|
+
- deploy:
|
71
|
+
name: Continuous bundle update
|
72
|
+
command: circleci-bundle-update-pr <username> <email>
|
73
|
+
|
74
|
+
workflows:
|
75
|
+
version: 2
|
76
|
+
build:
|
77
|
+
jobs:
|
78
|
+
- build:
|
79
|
+
# snip
|
80
|
+
nightly:
|
81
|
+
triggers:
|
82
|
+
- schedule:
|
83
|
+
cron: "00 10 * * 5"
|
84
|
+
filters:
|
85
|
+
branches:
|
86
|
+
only: master
|
87
|
+
jobs:
|
88
|
+
- continuous_bundle_update
|
57
89
|
```
|
58
90
|
|
59
91
|
NOTE: Please make sure you replace `<username>` and `<email>` with yours.
|
60
92
|
|
61
|
-
|
62
|
-
|
63
|
-
The easiest way to start a nightly build is using curl. The below is a simple script to trigger a build.
|
64
|
-
|
65
|
-
```bash
|
66
|
-
_project=<username>/<reponame>
|
67
|
-
_branch=master
|
68
|
-
_circle_token=<ciecleci api token>
|
69
|
-
|
70
|
-
trigger_build_url=https://circleci.com/api/v1/project/${_project}/tree/${_branch}?circle-token=${_circle_token}
|
71
|
-
|
72
|
-
post_data='{ "build_parameters": { "BUNDLE_UPDATE": "true" } }'
|
73
|
-
|
74
|
-
curl \
|
75
|
-
--header "Accept: application/json" \
|
76
|
-
--header "Content-Type: application/json" \
|
77
|
-
--data "${post_data}" \
|
78
|
-
--request POST ${trigger_build_url}
|
79
|
-
```
|
80
|
-
|
81
|
-
NOTE: Please do not forget to replace `<username>/<reponame>/<circleci api token>` with yours.
|
82
|
-
|
83
|
-
|
84
|
-
### Trigger nightly build via ci-build-trigger (recommended)
|
85
|
-
|
86
|
-
While you can trigger nightly builds by using whatever you want for sending requests to API, the most recommended way is to use "ci-build-trigger". Please see https://github.com/masutaka/ci-build-trigger for details.
|
93
|
+
`circleci-bundle-update-pr` regularly updates myself. See also [.circleci/config.yml](.circleci/config.yml).
|
87
94
|
|
88
95
|
## CLI command references
|
89
96
|
|
@@ -106,6 +113,3 @@ $ circleci-bundle-update-pr <git username> <git email address> master develop to
|
|
106
113
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
107
114
|
4. Push to the branch (`git push origin my-new-feature`)
|
108
115
|
5. Create a new Pull Request
|
109
|
-
|
110
|
-
[gem-badge]: https://badge.fury.io/rb/circleci-bundle-update-pr.svg
|
111
|
-
[gem-link]: http://badge.fury.io/rb/circleci-bundle-update-pr
|
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.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Masuda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- Gemfile
|
80
80
|
- Gemfile.lock
|
81
81
|
- LICENSE.txt
|
82
|
+
- README-for-CircleCI-1.0.md
|
82
83
|
- README.md
|
83
84
|
- Rakefile
|
84
85
|
- bin/circleci-bundle-update-pr
|