trigger_build 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +10 -1
- data/Dockerfile +7 -0
- data/README.md +10 -17
- data/lib/trigger_build.rb +3 -3
- data/lib/trigger_build/options.rb +4 -4
- data/lib/trigger_build/repo.rb +5 -1
- data/lib/trigger_build/{travis.rb → travis_api.rb} +1 -1
- data/lib/trigger_build/version.rb +1 -1
- data/trigger_build.gemspec +1 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69e157df90d7388179451651a9efd895afe2bf26
|
4
|
+
data.tar.gz: 39ded176dabfa23f400d5985879e8ad31bf375be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb804070a9d76885ecf6b0baea20032d5fb20549f67df61378fae9719b4c3bc6c82f691362830c3803ae1e4868929e5431645bc2065f8d3b450d15f37fb4432b
|
7
|
+
data.tar.gz: 08260534780bbf310e3e6382174df92cd6d6ae80ce95749b8fefa403b5c8de0ce8fb09d3588892f86641e3f647aba42e5a06b632b1a0ff03ba58f30f01ee2f17
|
data/.travis.yml
CHANGED
data/Dockerfile
ADDED
data/README.md
CHANGED
@@ -1,33 +1,27 @@
|
|
1
1
|
# TriggerBuild
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Add this line to your application's Gemfile:
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
gem 'trigger_build'
|
9
|
-
```
|
10
|
-
|
11
|
-
And then execute:
|
12
|
-
|
13
|
-
$ bundle
|
3
|
+
TriggerBuild is a simple command line application that can be used to trigger builds on Travis CI.
|
14
4
|
|
15
|
-
|
5
|
+
Installation is as simple as:
|
16
6
|
|
17
7
|
$ gem install trigger_build
|
18
8
|
|
19
9
|
## Usage
|
20
10
|
|
21
|
-
|
11
|
+
Triggering builds on Travis CI requires a Travis API token, which is specified via the `--token` option. The `TRAVIS_API_TOKEN` environment variable will be used if no option is supplied.
|
12
|
+
|
13
|
+
By default public projects hosted on [travis-ci.org](https://travis-ci.org) will be triggered. The `--pro` option should be used if the project is private and hosted on [travis-ci.com](https://travis-ci.com).
|
22
14
|
|
23
|
-
The following example triggers a build of trigger_build:
|
15
|
+
The following example triggers a build of trigger_build hosted on [travis-ci.org](https://travis-ci.org/MYOB-Technology/trigger_build):
|
24
16
|
|
25
|
-
$ trigger_build MYOB-Technology trigger_build --token $
|
17
|
+
$ trigger_build MYOB-Technology trigger_build --token $API_TOKEN
|
26
18
|
|
27
|
-
For detailed usage:
|
19
|
+
For detailed usage and options:
|
28
20
|
|
29
21
|
$ trigger_build -h
|
30
22
|
|
23
|
+
The Travis CI web user interface displays a message for the currently running build. By default this message will include the name of the Git repository from where the `trigger_build` command is executed and the most recent commit message. A generic message will be used if `trigger_build` is not run from a directory containing a Git repository.
|
24
|
+
|
31
25
|
## Contributing
|
32
26
|
|
33
27
|
Bug reports and pull requests are welcome on GitHub at https://github.com/MYOB-Technology/trigger_build.
|
@@ -35,4 +29,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/MYOB-T
|
|
35
29
|
## License
|
36
30
|
|
37
31
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
38
|
-
|
data/lib/trigger_build.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'trigger_build/options'
|
2
2
|
require 'trigger_build/repo'
|
3
|
-
require 'trigger_build/
|
3
|
+
require 'trigger_build/travis_api'
|
4
4
|
|
5
5
|
module TriggerBuild
|
6
6
|
|
@@ -10,8 +10,8 @@ module TriggerBuild
|
|
10
10
|
|
11
11
|
def self.travis(opts)
|
12
12
|
repo = Repo.new
|
13
|
-
|
14
|
-
|
13
|
+
triggerer = repo.valid? ? "#{repo.name}: #{repo.last_commit_message}" : 'trigger_build'
|
14
|
+
TravisAPI.new(opts).trigger("Triggered by #{triggerer}")
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
@@ -7,12 +7,12 @@ module TriggerBuild
|
|
7
7
|
|
8
8
|
def self.parse(args)
|
9
9
|
opts = Slop.parse(args) do |o|
|
10
|
-
o.banner =
|
11
|
-
o.separator
|
12
|
-
o.separator
|
10
|
+
o.banner = 'usage: trigger_build [options] owner repo'
|
11
|
+
o.separator ''
|
12
|
+
o.separator 'options:'
|
13
13
|
o.bool '--pro', 'use travis-ci.com'
|
14
14
|
o.string '-t', '--token',
|
15
|
-
'the
|
15
|
+
'the Travis CI API token (default: TRAVIS_API_TOKEN)', default: ENV['TRAVIS_API_TOKEN']
|
16
16
|
o.on '-h', '--help', 'display this message' do
|
17
17
|
puts o
|
18
18
|
exit
|
data/lib/trigger_build/repo.rb
CHANGED
@@ -5,7 +5,7 @@ module TriggerBuild
|
|
5
5
|
class Repo
|
6
6
|
|
7
7
|
def initialize(directory = Dir.pwd)
|
8
|
-
@git = Git.open(directory)
|
8
|
+
@git = Git.open(directory) rescue nil
|
9
9
|
end
|
10
10
|
|
11
11
|
def name
|
@@ -16,6 +16,10 @@ module TriggerBuild
|
|
16
16
|
@git.gcommit(@git.log.first).message
|
17
17
|
end
|
18
18
|
|
19
|
+
def valid?
|
20
|
+
not @git.nil?
|
21
|
+
end
|
22
|
+
|
19
23
|
end
|
20
24
|
|
21
25
|
end
|
data/trigger_build.gemspec
CHANGED
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.3
|
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-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.12'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.12'
|
97
111
|
description: Trigger Travis CI builds with ease
|
98
112
|
email:
|
99
113
|
- void@rdavis.xyz
|
@@ -106,6 +120,7 @@ files:
|
|
106
120
|
- ".gitignore"
|
107
121
|
- ".rspec"
|
108
122
|
- ".travis.yml"
|
123
|
+
- Dockerfile
|
109
124
|
- Gemfile
|
110
125
|
- LICENSE.txt
|
111
126
|
- README.md
|
@@ -114,7 +129,7 @@ files:
|
|
114
129
|
- lib/trigger_build.rb
|
115
130
|
- lib/trigger_build/options.rb
|
116
131
|
- lib/trigger_build/repo.rb
|
117
|
-
- lib/trigger_build/
|
132
|
+
- lib/trigger_build/travis_api.rb
|
118
133
|
- lib/trigger_build/version.rb
|
119
134
|
- trigger_build.gemspec
|
120
135
|
homepage: https://github.com/MYOB-Technology/trigger_build
|