ministryofjustice-danger 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +68 -25
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08483394e0c5044b4e9ffb9b5730c957ff22cd33
|
4
|
+
data.tar.gz: ed92bf24458017e8314dc6e9441ce6e2cfc3e02b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e53601cd70ec4d17d4c596854f2b8e632756d69360c1467cd97ae3606b9a23fcee16a79af0dcbecf04fb58b22df049c40fb71eb6add0a5fd57773d554a2e6210
|
7
|
+
data.tar.gz: 58a6065eece9cf1a2a00938e51e61a870a25d286575cb6d733d25da3f3a00ccf13ecc121d6f58f941ef43c61669845bab4627a446661bbeb62f0132cd244c476
|
data/README.md
CHANGED
@@ -4,33 +4,38 @@
|
|
4
4
|
ensure our commits, pull requests, and more meet a minimum level
|
5
5
|
of quality.
|
6
6
|
|
7
|
-
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/ministryofjustice-danger.svg)](https://badge.fury.io/rb/ministryofjustice-danger)
|
8
8
|
|
9
|
-
|
10
|
-
organization](https://github.com/ministryofjustice).
|
9
|
+
# Setup
|
11
10
|
|
12
|
-
|
11
|
+
## Add Danger to your [Ministry of Justice](https://github.com/ministryofjustice) Ruby project
|
13
12
|
|
14
|
-
|
13
|
+
1. Add the following to your Gemfile;
|
15
14
|
|
16
|
-
```
|
17
|
-
|
15
|
+
```
|
16
|
+
group :development do
|
17
|
+
gem 'ministryofjustice-danger'
|
18
|
+
end
|
18
19
|
```
|
19
20
|
|
20
|
-
|
21
|
+
2. `bundle install`
|
21
22
|
|
22
|
-
|
23
|
+
3. Create a Dangerfile that imports the central MoJ Dangerfile
|
23
24
|
|
24
|
-
```
|
25
|
-
|
25
|
+
```bash
|
26
|
+
echo "danger.import_dangerfile(github: 'ministryofjustice/danger')" > Dangerfile
|
26
27
|
```
|
27
28
|
|
28
|
-
|
29
|
+
Commit and push your changes.
|
30
|
+
|
31
|
+
## Run Danger via [Travis CI](https://travis-ci.org)
|
29
32
|
|
30
|
-
Add Danger to `.travis.yml
|
33
|
+
1. Add Danger to your `.travis.yml` (use whatever ruby version (>= 2.3.0) is appropriate)
|
31
34
|
|
32
35
|
```yaml
|
33
|
-
|
36
|
+
rvm: 2.3.3
|
37
|
+
|
38
|
+
script:
|
34
39
|
- bundle exec danger
|
35
40
|
```
|
36
41
|
|
@@ -39,31 +44,69 @@ before_script:
|
|
39
44
|
```yaml
|
40
45
|
matrix:
|
41
46
|
include:
|
42
|
-
- rvm: 2.3.
|
47
|
+
- rvm: 2.3.3
|
43
48
|
script:
|
44
49
|
- bundle exec danger
|
45
50
|
```
|
46
51
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
52
|
+
Commit and push the changes.
|
53
|
+
|
54
|
+
2. Add the MoJ Dangerbot API token to Travis;
|
55
|
+
|
56
|
+
This assumes your project has already been added to Travis.
|
51
57
|
|
52
|
-
|
58
|
+
https://travis-ci.org/ministryofjustice/[your project]/settings
|
59
|
+
|
60
|
+
[Add the environment variable](https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings)
|
61
|
+
`DANGER_GITHUB_API_TOKEN`, with the value
|
62
|
+
from the password field of the `MOJ Danger bot Github API token` entry
|
63
|
+
in Rattic.
|
64
|
+
|
65
|
+
Danger will now run against every PR which is raised, and will create comments
|
66
|
+
about any errors that it finds (the comments will be removed once the issues
|
67
|
+
are fixed).
|
68
|
+
|
69
|
+
## Run Danger via [CircleCI](https://circleci.com)
|
53
70
|
|
54
71
|
Just add `bundle exec danger` to your `circle.yml`, either as an extra
|
55
72
|
step in your `test` overrides, or in a new `pre` section. You'll need
|
56
|
-
to add the `DANGER_GITHUB_API_TOKEN` to the environment variables
|
57
|
-
with Travis, and
|
58
|
-
recommend](http://danger.systems/guides/getting_started.html#setting-up-danger-to-run-on-your-ci)
|
73
|
+
to add the `DANGER_GITHUB_API_TOKEN` to the environment variables,
|
74
|
+
like with Travis, and
|
75
|
+
[Danger recommend](http://danger.systems/guides/getting_started.html#setting-up-danger-to-run-on-your-ci)
|
59
76
|
setting “only build pull requests” in the advanced settings.
|
60
77
|
|
61
|
-
|
78
|
+
## If you're not running Ruby
|
62
79
|
|
63
80
|
If Danger is your only Ruby dependency, you probably don't want to have
|
64
81
|
a Gemfile cluttering up your repo. In that case, you can (probably) use
|
65
82
|
this command in the Travis config above:
|
66
83
|
|
67
84
|
```bash
|
68
|
-
rbenv global 2.3.1 && gem install danger --version '~>
|
85
|
+
rbenv global 2.3.1 && gem install ministryofjustice-danger --version '~> 0.1' && danger
|
86
|
+
```
|
87
|
+
|
88
|
+
## Updating the gem
|
89
|
+
|
90
|
+
e.g. to add new runtime dependencies
|
91
|
+
|
92
|
+
1. Make your changes to `ministryofjustice-danger.gemspec`
|
93
|
+
|
94
|
+
2. Update the version in `ministryofjustice-danger.gemspec`
|
95
|
+
|
96
|
+
3. Build the gem
|
97
|
+
```
|
98
|
+
gem build ministryofjustice-danger.gemspec
|
69
99
|
```
|
100
|
+
|
101
|
+
4. Publish to [Rubygems](https://rubygems.org)
|
102
|
+
```
|
103
|
+
gem push ministryofjustice-danger-[VERSION].gem
|
104
|
+
```
|
105
|
+
|
106
|
+
## Fixing your commits
|
107
|
+
|
108
|
+
To keep Danger happy, you will need to amend commits that you have already pushed.
|
109
|
+
|
110
|
+
This [Github article](https://help.github.com/articles/changing-a-commit-message/)
|
111
|
+
describes a process for doing this. But, please use [--force-with-lease](https://developer.atlassian.com/blog/2015/04/force-with-lease/)
|
112
|
+
instead of `--force` when pushing your amendments.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ministryofjustice-danger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ministry of Justice
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: danger-commit_lint
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|