mina-ci 0.0.3 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -0
- data/lib/mina/ci/tasks.rb +9 -11
- data/lib/mina/ci/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 152792a7227b7ca55889fc2ec43c34d056909e76
|
4
|
+
data.tar.gz: 2895e15bd7c1848e64f0d00d84891f2c463f1366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfe99c21f5380d49944887529ffefa1728d88dcfb5089418bb254a9090a1ecb09148be9555ff516c715ea0fefdc4652bd954261c0db6111f062bcac89fd8dd23
|
7
|
+
data.tar.gz: 1fbcfde0efdd96765b650564451c046db2095a6f5fb682908eea58a01d2771249383cf44a19669da357b01240344c995ad1114d5280bc8949adc83579212c0c1
|
data/README.md
CHANGED
@@ -1,2 +1,50 @@
|
|
1
1
|
# mina-ci
|
2
2
|
Mina recipe for checking Circle CI build status
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
|
6
|
+
Add this line to your application's Gemfile:
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
gem 'mina-ci', require: false
|
10
|
+
```
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
require 'mina/ci'
|
19
|
+
|
20
|
+
...
|
21
|
+
set :circle_token, 'your circle API token'
|
22
|
+
set :circle_username, 'your circle project username'
|
23
|
+
set :circle_project, 'your circle project'
|
24
|
+
|
25
|
+
task deploy: :environment do
|
26
|
+
deploy do
|
27
|
+
invoke :'ci:verify_status'
|
28
|
+
...
|
29
|
+
|
30
|
+
to :launch do
|
31
|
+
...
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
## Options
|
37
|
+
|
38
|
+
| Name | Description |
|
39
|
+
| ---------------------------- | ----------------------------------- |
|
40
|
+
| `circle_token` | CircleCI API token |
|
41
|
+
| `circle_username` | CircleCI project username |
|
42
|
+
| `circle_project` | CircleCI project name |
|
43
|
+
|
44
|
+
## Contributing
|
45
|
+
|
46
|
+
1. Fork it ( https://github.com/seandong/mina-ci/fork )
|
47
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
48
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
49
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
50
|
+
5. Create a new Pull Request
|
data/lib/mina/ci/tasks.rb
CHANGED
@@ -24,16 +24,14 @@ set_default :circle_project, nil
|
|
24
24
|
|
25
25
|
namespace :ci do
|
26
26
|
|
27
|
-
desc 'Verify CircleCI
|
28
|
-
task :verify_status => :
|
29
|
-
queue %[echo "-----> check CircleCI status"]
|
30
|
-
die 0, 'Please set
|
31
|
-
die 0, 'Please set
|
32
|
-
die 0, 'Please set
|
33
|
-
|
34
|
-
unless %w(success fixed).include?(cricle_status)
|
35
|
-
die 1, "CircleCI not passed (#{cricle_status}), please check and fix problem first."
|
36
|
-
end
|
27
|
+
desc 'Verify CircleCI build status.'
|
28
|
+
task :verify_status => :environment do
|
29
|
+
queue %[echo "-----> check CircleCI build status"]
|
30
|
+
die 0, 'Please set `:circle_token`.' unless circle_token
|
31
|
+
die 0, 'Please set `:circle_username`.' unless circle_username
|
32
|
+
die 0, 'Please set `:circle_project`.' unless circle_project
|
33
|
+
|
34
|
+
die 0, "CircleCI build failed. current status: #{cricle_status}), please check and fix it first." unless %w(success fixed).include?(cricle_status)
|
37
35
|
end
|
38
36
|
|
39
37
|
private
|
@@ -43,7 +41,7 @@ namespace :ci do
|
|
43
41
|
end
|
44
42
|
|
45
43
|
def circle_repsonse
|
46
|
-
JSON.parse `curl -H 'Accept: application/json' #{circle_url}`
|
44
|
+
JSON.parse `curl -s -H 'Accept: application/json' #{circle_url}`
|
47
45
|
end
|
48
46
|
|
49
47
|
def cricle_status
|
data/lib/mina/ci/version.rb
CHANGED