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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +68 -25
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8df765a9d38c80e4cfabbc90cf6422fd255d42b3
4
- data.tar.gz: 8af4a140e56b48372b4dc4856807ac7585618ed8
3
+ metadata.gz: 08483394e0c5044b4e9ffb9b5730c957ff22cd33
4
+ data.tar.gz: ed92bf24458017e8314dc6e9441ce6e2cfc3e02b
5
5
  SHA512:
6
- metadata.gz: ce47c23cce74c427bcb89bd971fc318e2c8445b354443c8aaa0595441da9c7f983dfd31af34dcb566ff6315537a5e477714ed92cb597ba0fd26b37045762b1bf
7
- data.tar.gz: c914bcaeb26202b022336bf4682975ba00448a86e931b016fb35c558a8ed1662c736345ba7f1340945a38b8c6fdfdbab92bd2d02808d0ff898da95010a50a7e8
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
- ## Setup
7
+ [![Gem Version](https://badge.fury.io/rb/ministryofjustice-danger.svg)](https://badge.fury.io/rb/ministryofjustice-danger)
8
8
 
9
- Enable Danger for a project within the [ministryofjustice
10
- organization](https://github.com/ministryofjustice).
9
+ # Setup
11
10
 
12
- ### Configure Danger to use this repo's Dangerfile
11
+ ## Add Danger to your [Ministry of Justice](https://github.com/ministryofjustice) Ruby project
13
12
 
14
- Commit a `Dangerfile` containing linking to this repo:
13
+ 1. Add the following to your Gemfile;
15
14
 
16
- ```ruby
17
- danger.import_dangerfile(github: 'ministryofjustice/danger')
15
+ ```
16
+ group :development do
17
+ gem 'ministryofjustice-danger'
18
+ end
18
19
  ```
19
20
 
20
- ### If you're running Ruby
21
+ 2. `bundle install`
21
22
 
22
- Add `danger` to your `Gemfile`.
23
+ 3. Create a Dangerfile that imports the central MoJ Dangerfile
23
24
 
24
- ```ruby
25
- gem 'danger'
25
+ ```bash
26
+ echo "danger.import_dangerfile(github: 'ministryofjustice/danger')" > Dangerfile
26
27
  ```
27
28
 
28
- #### Run Danger in Travis
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
- before_script:
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.1
47
+ - rvm: 2.3.3
43
48
  script:
44
49
  - bundle exec danger
45
50
  ```
46
51
 
47
- And add the `DANGER_GITHUB_API_TOKEN` as an environment variable in
48
- Travis's repo settings, which are at a URL like
49
- `https://travis-ci.org/ministryofjustice/[repo]/settings`. The API token
50
- itself is in Rattic (search for `Danger`).
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
- #### Run Danger in CircleCI
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 like
57
- with Travis, and [Danger
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
- ### If you're not running Ruby
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 '~> 5.0' && danger
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.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-12 00:00:00.000000000 Z
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: '0'
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: '0'
26
+ version: '5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: danger-commit_lint
29
29
  requirement: !ruby/object:Gem::Requirement