trigger_build 0.0.1 → 0.0.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 +2 -2
- data/bin/trigger_build +7 -2
- data/lib/trigger_build/options.rb +1 -3
- data/lib/trigger_build/travis.rb +2 -1
- data/lib/trigger_build/version.rb +1 -1
- data/lib/trigger_build.rb +5 -2
- data/trigger_build.gemspec +2 -2
- 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: a379d6a646a09ae34d2d3f9b6e56ad325c4e6b50
|
4
|
+
data.tar.gz: 08b5d212329b35855b4b0595695a4d6eda012f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef27a48430125cdaa2cb17c1ebe1c6ba2844d4446f1801ba7dccb397f5d7149fe6aff315355a00aa6b2051d6d05f867a5b15c211758f27bf9c54113789cf8e38
|
7
|
+
data.tar.gz: 22f55888e6bc115e7577a1e37418f8e1936e9566bea9ad2e13fb309a629b30554c679c106987cfc8c54e959df154e0583bd65cde7322538f7ee731136c2a780a
|
data/README.md
CHANGED
@@ -18,11 +18,11 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
TriggerBuild is a simple command line application that can be used to trigger builds on
|
21
|
+
TriggerBuild is a simple command line application that can be used to trigger builds on Travis CI.
|
22
22
|
|
23
23
|
The following example triggers a build of trigger_build:
|
24
24
|
|
25
|
-
$ trigger_build MYOB-Technology trigger_build --
|
25
|
+
$ trigger_build MYOB-Technology trigger_build --token $TRAVIS_API_TOKEN
|
26
26
|
|
27
27
|
For detailed usage:
|
28
28
|
|
data/bin/trigger_build
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'pp'
|
4
3
|
require 'trigger_build'
|
5
4
|
|
6
|
-
|
5
|
+
opts = TriggerBuild.parse_args(ARGV)
|
6
|
+
response = TriggerBuild.travis(opts)
|
7
|
+
if response.success?
|
8
|
+
puts 'Successfully triggered build'
|
9
|
+
else
|
10
|
+
abort "Failed to trigger build: #{response}"
|
11
|
+
end
|
@@ -27,10 +27,8 @@ module TriggerBuild
|
|
27
27
|
abort opts.to_s
|
28
28
|
end
|
29
29
|
|
30
|
-
url = opts.pro? ? 'travis-ci.com' : 'travis-ci.org'
|
31
30
|
owner, repo = *opts.args
|
32
|
-
|
33
|
-
{ owner: owner, repo: repo, token: opts[:token], url: url }
|
31
|
+
{ owner: owner, repo: repo, token: opts[:token], pro: opts.pro? }
|
34
32
|
end
|
35
33
|
|
36
34
|
end
|
data/lib/trigger_build/travis.rb
CHANGED
@@ -9,7 +9,8 @@ module TriggerBuild
|
|
9
9
|
'Travis-API-Version' => '3'
|
10
10
|
|
11
11
|
def initialize(opts)
|
12
|
-
|
12
|
+
url = opts[:pro] ? 'travis-ci.com' : 'travis-ci.org'
|
13
|
+
self.class.base_uri "api.#{url}/repo/#{opts[:owner]}\%2F#{opts[:repo]}"
|
13
14
|
self.class.headers 'Authorization' => "token #{opts[:token]}"
|
14
15
|
end
|
15
16
|
|
data/lib/trigger_build.rb
CHANGED
@@ -4,8 +4,11 @@ require 'trigger_build/travis'
|
|
4
4
|
|
5
5
|
module TriggerBuild
|
6
6
|
|
7
|
-
def self.
|
8
|
-
|
7
|
+
def self.parse_args(args)
|
8
|
+
Options.parse(args)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.travis(opts)
|
9
12
|
repo = Repo.new
|
10
13
|
travis = Travis.new(opts)
|
11
14
|
travis.trigger("Triggered by #{repo.name}: #{repo.last_commit_message}", branch: 'master')
|
data/trigger_build.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['void@rdavis.xyz']
|
11
11
|
spec.executables = ['trigger_build']
|
12
12
|
|
13
|
-
spec.summary = 'Trigger
|
14
|
-
spec.description = 'Trigger
|
13
|
+
spec.summary = 'Trigger Travis CI builds'
|
14
|
+
spec.description = 'Trigger Travis CI builds with ease'
|
15
15
|
spec.homepage = 'https://github.com/MYOB-Technology/trigger_build'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trigger_build
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
-
description: Trigger
|
97
|
+
description: Trigger Travis CI builds with ease
|
98
98
|
email:
|
99
99
|
- void@rdavis.xyz
|
100
100
|
executables:
|
@@ -140,5 +140,5 @@ rubyforge_project:
|
|
140
140
|
rubygems_version: 2.5.1
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
|
-
summary: Trigger
|
143
|
+
summary: Trigger Travis CI builds
|
144
144
|
test_files: []
|