travis 1.8.12.travis.1135.9 → 1.8.12.travis.1136.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 +26 -2
- data/assets/travis.sh +1 -1
- data/lib/travis/cli/console.rb +22 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6217c88912e32a9b54d638465935109b2ac5f4942ee2d604a67ad519712ee3a
|
4
|
+
data.tar.gz: 9e0ccd040b5b3085dbb01dc643d1149256308ffd65aa956d0e52857682860c35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b16938eb4f3e3502521e06523531222f1c426dcbbd5e7aee1a2514d7792ead9e3bc0b42f8b1c96241273ff27a94e247b238be237bb0fd79576fbe2c67ba1ac3
|
7
|
+
data.tar.gz: 1c7708f5fedaad5ce783bb1a412a39c0e687fecba3d524b9cddddce74028d98c0a63d69053ef1c909c4ec67a1da27cbd4a7b42332cbf8a3056a38fe439bf723b
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ The [travis gem](https://rubygems.org/gems/travis) includes both a [command line
|
|
12
12
|
* [`version`](#version) - outputs the client version
|
13
13
|
* [General API Commands](#general-api-commands)
|
14
14
|
* [`accounts`](#accounts) - displays accounts and their subscription status
|
15
|
-
* [`console`](#console) - interactive shell
|
15
|
+
* [`console`](#console) - interactive shell; requires `pry`
|
16
16
|
* [`endpoint`](#endpoint) - displays or changes the API endpoint
|
17
17
|
* [`login`](#login) - authenticates against the API and stores the token
|
18
18
|
* [`monitor`](#monitor) - live monitor for what's going on
|
@@ -161,9 +161,13 @@ travis-ci (Travis CI): subscribed, 57 repositories
|
|
161
161
|
|
162
162
|
#### `console`
|
163
163
|
|
164
|
+
Provides an interactive shell via [pry](http://pry.github.io/).
|
165
|
+
|
164
166
|
Running `travis console` gives you an interactive Ruby session with all the [entities](#entities) imported into global namespace.
|
165
167
|
|
166
|
-
|
168
|
+
This has advantages over `irb -r travis`, such as:
|
169
|
+
* It will take care of authentication, setting the correct endpoint, etc.
|
170
|
+
* It also allows you to pass in `--debug` if you are curious as to what's actually going on.
|
167
171
|
|
168
172
|
``` console
|
169
173
|
$ travis console
|
@@ -175,6 +179,26 @@ $ travis console
|
|
175
179
|
=> #<Travis::Client::Build: sinatra/sinatra#360>
|
176
180
|
```
|
177
181
|
|
182
|
+
Interactive shell; requires `pry`.
|
183
|
+
Usage: travis console [OPTIONS]
|
184
|
+
-h, --help Display help
|
185
|
+
-i, --[no-]interactive be interactive and colorful
|
186
|
+
-E, --[no-]explode don't rescue exceptions
|
187
|
+
--skip-version-check don't check if travis client is up to date
|
188
|
+
--skip-completion-check don't check if auto-completion is set up
|
189
|
+
-e, --api-endpoint URL Travis API server to talk to
|
190
|
+
-I, --[no-]insecure do not verify SSL certificate of API endpoint
|
191
|
+
--pro short-cut for --api-endpoint 'https://api.travis-ci.com/'
|
192
|
+
--com short-cut for --api-endpoint 'https://api.travis-ci.com/'
|
193
|
+
--org short-cut for --api-endpoint 'https://api.travis-ci.org/'
|
194
|
+
--staging talks to staging system
|
195
|
+
-t, --token [ACCESS_TOKEN] access token to use
|
196
|
+
--debug show API requests
|
197
|
+
--debug-http show HTTP(S) exchange
|
198
|
+
-X, --enterprise [NAME] use enterprise setup (optionally takes name for multiple setups)
|
199
|
+
--adapter ADAPTER Faraday adapter to use for HTTP requests
|
200
|
+
-x, --eval LINE run line of ruby
|
201
|
+
|
178
202
|
#### `endpoint`
|
179
203
|
|
180
204
|
Prints out the API endpoint you're talking to.
|
data/assets/travis.sh
CHANGED
@@ -20,7 +20,7 @@ _travis_complete() {
|
|
20
20
|
if type compdef 1>/dev/null 2>/dev/null; then
|
21
21
|
compdef _travis travis
|
22
22
|
_travis() { _travis_complete $((${#words} - 1)) "${words[2]}"; }
|
23
|
-
_travis_commands() { list=(accounts:"displays accounts and their subscription status" branches:"displays the most recent build for each branch" cache:"lists or deletes repository caches" cancel:"cancels a job or build" console:"interactive shell" disable:"disables a project" enable:"enables a project" encrypt:"encrypts values for the .travis.yml" encrypt-file:"encrypts a file and adds decryption steps to .travis.yml" endpoint:"displays or changes the API endpoint" env:"show or modify build environment variables" help:"helps you out when in dire need of information" history:"displays a projects build history" init:"generates a .travis.yml and enables the project" lint:"display warnings for a .travis.yml" login:"authenticates against the API and stores the token" logout:"deletes the stored API token" logs:"streams test logs" monitor:"live monitor for what's going on" open:"opens a build or job in the browser" pubkey:"prints out a repository's public key" raw:"makes an (authenticated) API call and prints out the result" report:"generates a report useful for filing issues" repos:"lists repositories the user has certain permissions on" requests:"lists recent requests" restart:"restarts a build or job" settings:"access repository settings" setup:"sets up an addon or deploy target" show:"displays a build or job" sshkey:"checks, updates or deletes an SSH key" status:"checks status of the latest build" sync:"triggers a new sync with GitHub" token:"outputs the secret API token" version:"outputs the client version" whatsup:"lists most recent builds" whoami:"outputs the current user") _describe -t common-commands 'common commands' list; }
|
23
|
+
_travis_commands() { list=(accounts:"displays accounts and their subscription status" branches:"displays the most recent build for each branch" cache:"lists or deletes repository caches" cancel:"cancels a job or build" console:"interactive shell; requires `pry`" disable:"disables a project" enable:"enables a project" encrypt:"encrypts values for the .travis.yml" encrypt-file:"encrypts a file and adds decryption steps to .travis.yml" endpoint:"displays or changes the API endpoint" env:"show or modify build environment variables" help:"helps you out when in dire need of information" history:"displays a projects build history" init:"generates a .travis.yml and enables the project" lint:"display warnings for a .travis.yml" login:"authenticates against the API and stores the token" logout:"deletes the stored API token" logs:"streams test logs" monitor:"live monitor for what's going on" open:"opens a build or job in the browser" pubkey:"prints out a repository's public key" raw:"makes an (authenticated) API call and prints out the result" report:"generates a report useful for filing issues" repos:"lists repositories the user has certain permissions on" requests:"lists recent requests" restart:"restarts a build or job" settings:"access repository settings" setup:"sets up an addon or deploy target" show:"displays a build or job" sshkey:"checks, updates or deletes an SSH key" status:"checks status of the latest build" sync:"triggers a new sync with GitHub" token:"outputs the secret API token" version:"outputs the client version" whatsup:"lists most recent builds" whoami:"outputs the current user") _describe -t common-commands 'common commands' list; }
|
24
24
|
_travis_setup() { list=(anynines:"automatic deployment to anynines" appfog:"automatic deployment to Appfog" artifacts:"automatic artifact shipping to S3" biicode:"automatic publish to biicode" cloudcontrol:"automatic deployment to cloudControl" cloudfiles:"automatic pushing to Rackspace Cloud Files" cloudfoundry:"automatic deployment to Cloud Foundry" cloud66:"Automatic deployment to Cloud 66" codedeploy:"triggering a new deployment on Amazon CodeDeploy" deis:"automatic deployment to a deis app" divshot:"deployment to Divshot.io" elasticbeanstalk:"deployment to AWS Elastic Beanstalk" engineyard:"automatic deployment to Engine Yard" gcs:"automatic pushing to Google Cloud Storage" hackage:"automatic deployment of hackage packages" heroku:"automatic deployment to Heroku" modulus:"deployment to Modulus" npm:"automatic release to NPM" ninefold:"Automatic deployment to Ninefold" nodejitsu:"automatic deployment to Nodejitsu" openshift:"automatic deployment to OpenShfit" opsworks:"deployment to OpsWorks" pypi:"automatic deployment to PyPI" releases:"Upload Assets to GitHub Releases" rubygems:"automatic release to RubyGems" s3:"automatic pushing to S3" sauce_connect:"Sauce Connet addon for Sauce Labs integration") _describe -t common-commands 'common commands' list; }
|
25
25
|
_travis_settings() { list=(builds_only_with_travis_yml:"Only run builds with a .travis.yml" build_pushes:"Build pushes" build_pull_requests:"Build pull requests" maximum_number_of_builds:"Maximum number of concurrent builds" auto_cancel_pushes:"Cancel older push builds that are not yet running" auto_cancel_pull_requests:"Cancel older pull request builds that are not yet running") _describe -t common-commands 'common commands' list; }
|
26
26
|
_travis_init() { list=(c:'initialize c project' clojure:'initialize clojure project' cpp:'initialize cpp project' erlang:'initialize erlang project' go:'initialize go project' groovy:'initialize groovy project' haskell:'initialize haskell project' java:'initialize java project' node_js:'initialize node_js project' objective-c:'initialize objective-c project' perl:'initialize perl project' php:'initialize php project' python:'initialize python project' ruby:'initialize ruby project' scala:'initialize scala project') _describe -t common-commands 'common commands' list; }
|
data/lib/travis/cli/console.rb
CHANGED
@@ -3,30 +3,43 @@ require 'travis/cli'
|
|
3
3
|
module Travis
|
4
4
|
module CLI
|
5
5
|
class Console < ApiCommand
|
6
|
-
description "interactive shell"
|
6
|
+
description "interactive shell; requires `pry`"
|
7
7
|
on '-x', '--eval LINE', 'run line of ruby' do |c, line|
|
8
8
|
c.instance_eval(line)
|
9
9
|
exit
|
10
10
|
end
|
11
11
|
|
12
12
|
def run
|
13
|
-
|
13
|
+
ensure_pry
|
14
14
|
|
15
15
|
Object.send(:include, Client::Namespace.new(session))
|
16
16
|
hooks = defined?(Pry::Hooks) ? Pry::Hooks.new : {}
|
17
|
-
|
17
|
+
opts = {quiet: true, output: $stdout, hooks: hooks }
|
18
|
+
opts.merge!({prompt: prompt}) if prompt
|
19
|
+
binding.pry(opts)
|
18
20
|
end
|
19
21
|
|
20
22
|
private
|
21
23
|
|
22
|
-
def
|
24
|
+
def ensure_pry
|
23
25
|
require 'pry'
|
24
|
-
true
|
25
26
|
rescue LoadError
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
msg = [
|
28
|
+
'You need to install pry to use Travis CLI console. Try',
|
29
|
+
nil,
|
30
|
+
'$ (sudo) gem install pry'
|
31
|
+
].join("\n")
|
32
|
+
error msg
|
33
|
+
end
|
34
|
+
|
35
|
+
def prompt
|
36
|
+
if Pry.const_defined? :SIMPLE_PROMPT
|
37
|
+
Pry::SIMPLE_PROMPT
|
38
|
+
elsif defined?(Pry::Prompt)
|
39
|
+
Pry::Prompt[:simple]
|
40
|
+
else
|
41
|
+
nil
|
42
|
+
end
|
30
43
|
end
|
31
44
|
end
|
32
45
|
end
|