moj-danger 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +113 -0
- metadata +77 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: eb44a11a75d37ecdd859b35e779892b864d7bca8
|
4
|
+
data.tar.gz: 20a6778488da9b8a4b5f356dff4b9b7fdd5bad31
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cfbdf0f039b225d972917a6454db9b3c0b463f15e79141370b6fc8c50fc37a3cb5f1daafa2d4f7d28eef9ea9c3c517b90104001db3efba3174ee27514e4b7c21
|
7
|
+
data.tar.gz: a4ff5eb33a9ccaeb1979b2764d33c5ba73c3dc6311ed85c171ae2a46bdd97be0a28794bdd9213cbd153fc47fc4851d7554897c11a051dc92e5cf0fb349b2ef5a
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Ministry of Justice
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
# Danger
|
2
|
+
|
3
|
+
[Danger](http://danger.systems) runs during our CI process, and lets us
|
4
|
+
ensure our commits, pull requests, and more meet a minimum level
|
5
|
+
of quality.
|
6
|
+
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/moj-danger.svg)](https://badge.fury.io/rb/moj-danger)
|
8
|
+
|
9
|
+
## Setup
|
10
|
+
|
11
|
+
Enable Danger for a project within the [ministryofjustice
|
12
|
+
organization](https://github.com/ministryofjustice).
|
13
|
+
|
14
|
+
1. Add the following to your Gemfile;
|
15
|
+
```
|
16
|
+
group :development do
|
17
|
+
gem 'moj-danger'
|
18
|
+
end
|
19
|
+
```
|
20
|
+
|
21
|
+
1. `bundle install`
|
22
|
+
|
23
|
+
1. Create Dangerfile
|
24
|
+
|
25
|
+
```
|
26
|
+
echo "danger.import_dangerfile(github: 'ministryofjustice/danger')" > Dangerfile
|
27
|
+
```
|
28
|
+
|
29
|
+
1. Add Danger to your .travis.yml (use whatever ruby version is appropriate)
|
30
|
+
|
31
|
+
```
|
32
|
+
rvm: 2.3.3
|
33
|
+
|
34
|
+
script:
|
35
|
+
- bundle exec danger
|
36
|
+
```
|
37
|
+
|
38
|
+
1. Commit the changes to the Dangerfile and .travis.yml
|
39
|
+
|
40
|
+
1. Add the MoJ Dangerbot API token to Travis;
|
41
|
+
|
42
|
+
This assumes your project has already been added to Travis.
|
43
|
+
|
44
|
+
https://travis-ci.org/ministryofjustice/[your project]/settings
|
45
|
+
|
46
|
+
Add the environment variable `DANGER_GITHUB_API_TOKEN`, with the value from the password field of `https://rattic.service.dsd.io/cred/detail/695/`
|
47
|
+
|
48
|
+
### Run danger locally
|
49
|
+
|
50
|
+
You need to create a PR before you can do this.
|
51
|
+
|
52
|
+
```
|
53
|
+
bundle exec danger pr https://github.com/ministryofjustice/[your project]/pull/[PR number]
|
54
|
+
```
|
55
|
+
|
56
|
+
### Configure Danger to use this repo's Dangerfile
|
57
|
+
|
58
|
+
Commit a `Dangerfile` containing linking to this repo:
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
danger.import_dangerfile(github: 'ministryofjustice/danger')
|
62
|
+
```
|
63
|
+
|
64
|
+
### If you're running Ruby
|
65
|
+
|
66
|
+
Add `danger` to your `Gemfile`.
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
gem 'danger'
|
70
|
+
```
|
71
|
+
|
72
|
+
#### Run Danger in Travis
|
73
|
+
|
74
|
+
Add Danger to `.travis.yml`:
|
75
|
+
|
76
|
+
```yaml
|
77
|
+
before_script:
|
78
|
+
- bundle exec danger
|
79
|
+
```
|
80
|
+
|
81
|
+
… or add it to your build matrix:
|
82
|
+
|
83
|
+
```yaml
|
84
|
+
matrix:
|
85
|
+
include:
|
86
|
+
- rvm: 2.3.1
|
87
|
+
script:
|
88
|
+
- bundle exec danger
|
89
|
+
```
|
90
|
+
|
91
|
+
And add the `DANGER_GITHUB_API_TOKEN` as an environment variable in
|
92
|
+
Travis's repo settings, which are at a URL like
|
93
|
+
`https://travis-ci.org/ministryofjustice/[repo]/settings`. The API token
|
94
|
+
itself is in Rattic (search for `Danger`).
|
95
|
+
|
96
|
+
#### Run Danger in CircleCI
|
97
|
+
|
98
|
+
Just add `bundle exec danger` to your `circle.yml`, either as an extra
|
99
|
+
step in your `test` overrides, or in a new `pre` section. You'll need
|
100
|
+
to add the `DANGER_GITHUB_API_TOKEN` to the environment variables like
|
101
|
+
with Travis, and [Danger
|
102
|
+
recommend](http://danger.systems/guides/getting_started.html#setting-up-danger-to-run-on-your-ci)
|
103
|
+
setting “only build pull requests” in the advanced settings.
|
104
|
+
|
105
|
+
### If you're not running Ruby
|
106
|
+
|
107
|
+
If Danger is your only Ruby dependency, you probably don't want to have
|
108
|
+
a Gemfile cluttering up your repo. In that case, you can (probably) use
|
109
|
+
this command in the Travis config above:
|
110
|
+
|
111
|
+
```bash
|
112
|
+
rbenv global 2.3.1 && gem install danger --version '~> 5.0' && danger
|
113
|
+
```
|
metadata
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: moj-danger
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ministry Of Justice
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: danger
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: danger-commit_lint
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- tools+danger@digital.justice.gov.uk
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files:
|
47
|
+
- README.md
|
48
|
+
files:
|
49
|
+
- LICENSE
|
50
|
+
- README.md
|
51
|
+
homepage: https://github.com/ministryofjustice/danger
|
52
|
+
licenses:
|
53
|
+
- MIT
|
54
|
+
metadata: {}
|
55
|
+
post_install_message:
|
56
|
+
rdoc_options:
|
57
|
+
- "--main"
|
58
|
+
- README.md
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 2.3.0
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirements: []
|
72
|
+
rubyforge_project:
|
73
|
+
rubygems_version: 2.5.2
|
74
|
+
signing_key:
|
75
|
+
specification_version: 4
|
76
|
+
summary: Add Danger gems
|
77
|
+
test_files: []
|