travis 1.6.15.travis.580.6 → 1.6.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NjAxZTQyYThhNjI5MzEzNDFkMjBkM2UyZTE0YWRmYzVjMDM0ZWNkNg==
5
- data.tar.gz: !binary |-
6
- MTdjZjEwOWQ0NDBlNmNhY2YwYTM5Y2NlNDI5YzA4MWQ2NjMzYTE5NQ==
2
+ SHA1:
3
+ metadata.gz: aba2dfc387fae25a693ed74ccd67a3ee87ebdee3
4
+ data.tar.gz: 347e858fa3c4fb5fb4df3c52ef6f12003d53a32d
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YzY1MWM0MDliNzBjMWNmYTQ0NTBjZWZkNDc0NmZmZTRlODdhMzY1MTMzZDRm
10
- ZTFjMWJlYTg1YzQwODczODRkMTZjNjdkZjliYThhZGI1YWU3ZTQ0MDZjNDlh
11
- YjQ0OTMxNzY1YmY4YWU3MGZlNWY3MTBkN2RlZTA4YTI4ODg0YmE=
12
- data.tar.gz: !binary |-
13
- YzJkNTdlMjc5ZjNiNjg3ZDM5ODU0Y2NlYmZkYTAwMTNlOTgxNzE5MjZhZmMy
14
- ZmY4ODNlMTZmNjg4ZThhYWFjMjVmYmNmOWY5YWMxYzM1YTlhMDVkYjY0MmUz
15
- ZmU0Yzk4NzQ0YmY4N2FhMGVlYWVjMDg3MzQ0YzU0ODZlZGIxYTQ=
6
+ metadata.gz: 8cb606d175d7b4b28477f7207ee2e243356a4858d0dd224f3001f2dbce637350806207c1133f0d4b575e399031c072ffe68b0beecde68e749a8e62f3dc5da6c2
7
+ data.tar.gz: da55f6ceeced83b93b596ac2ba33677cb26ad7df5d8342cf49cb7d22aa8adcee03cc532fa6475b6126ff278d89ee8b58f7e51a249c67f28d41845d17b9cdad92
data/README.md CHANGED
@@ -1635,12 +1635,12 @@ You can check your Ruby version by running `ruby -v`:
1635
1635
 
1636
1636
  Then run:
1637
1637
 
1638
- $ gem install travis -v 1.6.14 --no-rdoc --no-ri
1638
+ $ gem install travis -v 1.6.15 --no-rdoc --no-ri
1639
1639
 
1640
1640
  Now make sure everything is working:
1641
1641
 
1642
1642
  $ travis version
1643
- 1.6.14
1643
+ 1.6.15
1644
1644
 
1645
1645
  See also [Note on Ubuntu](#note-on-ubuntu) below.
1646
1646
 
@@ -1725,8 +1725,10 @@ If you have the old `travis-cli` gem installed, you should `gem uninstall travis
1725
1725
 
1726
1726
  ## Version History
1727
1727
 
1728
- **1.6.15** (not yet released)
1728
+ **1.6.15** (July 18, 2014)
1729
1729
 
1730
+ * Add `travis env [list|add|set|copy]`.
1731
+ * Add `Repository#env_vars`.
1730
1732
  * Add `travis setup ghc`.
1731
1733
  * Add `Log#delete_body`, `Job#delete_log` and `Build#delete_logs` to Ruby API.
1732
1734
  * Add `--delete`, `--force` and `--no-stream` options to `travis logs`.
data/assets/travis.sh CHANGED
@@ -20,9 +20,9 @@ _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" endpoint:"displays or changes the API endpoint" 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" 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" disable:"disables a project" enable:"enables a project" encrypt:"encrypts values for the .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" 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=(appfog:"automatic deployment to Appfog" artifacts:"automatic artifact shipping to S3" cloudcontrol:"automatic deployment to cloudControl" cloudfiles:"automatic pushing to Rackspace Cloud Files" cloudfoundry:"automatic deployment to Cloud Foundry" cloud66:"Automatic deployment to Cloud 66" deis:"automatic deployment to a deis app" divshot:"deployment to Divshot.io" 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
- _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") _describe -t common-commands 'common commands' list; }
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") _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; }
27
27
  _travis_option() {
28
28
  case "${words[2]}" in
@@ -35,6 +35,7 @@ if type compdef 1>/dev/null 2>/dev/null; then
35
35
  enable) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-s[don't trigger a sync if the repo is unknown]" "--skip-sync[don't trigger a sync if the repo is unknown]" '*:file:_files' && return 0;;
36
36
  encrypt) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-a[adds it to .travis.yml under KEY (default: env.global)]" "--add[adds it to .travis.yml under KEY (default: env.global)]" "-s[treat each line as a separate input]" "--split[treat each line as a separate input]" "--no-split[treat each line as a separate input]" "-p[don't override existing values, instead treat as list]" "--append[don't override existing values, instead treat as list]" "-x[override existing value]" "--override[override existing value]" '*:file:_files' && return 0;;
37
37
  endpoint) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "--drop-default[delete stored default endpoint]" "--set-default[store endpoint as global default]" "--github[display github endpoint]" '*:file:_files' && return 0;;
38
+ env) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-P[make new values public]" "--public[make new values public]" "--no-public[make new values public]" "-p[make new values private]" "--private[make new values private]" "--no-private[make new values private]" "-u[do not escape values]" "--unescape[do not escape values]" "--no-unescape[do not escape values]" '*:file:_files' && return 0;;
38
39
  help) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" '*:file:_files' && return 0;;
39
40
  history) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-a[Only show history after a given build number]" "--after[Only show history after a given build number]" "-p[Only show history for the given Pull Request]" "--pull-request[Only show history for the given Pull Request]" "-b[Only show history for the given branch]" "--branch[Only show history for the given branch]" "-l[Maximum number of history items]" "--limit[Maximum number of history items]" "-d[Include date in output]" "--date[Include date in output]" "-c[Include committer in output]" "--committer[Include committer in output]" "--all[Display all history items]" "--no-all[Display all history items]" '*:file:_files' && return 0;;
40
41
  init) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-s[don't trigger a sync if the repo is unknown]" "--skip-sync[don't trigger a sync if the repo is unknown]" "-f[override .travis.yml if it already exists]" "--force[override .travis.yml if it already exists]" "-k[do not enable project, only add .travis.yml]" "--skip-enable[do not enable project, only add .travis.yml]" "-p[print generated config instead of writing to file]" "--print-conf[print generated config instead of writing to file]" "--script[sets script option in .travis.yml (can be used more than once)]" "--before-script[sets before_script option in .travis.yml (can be used more than once)]" "--after-script[sets after_script option in .travis.yml (can be used more than once)]" "--after-success[sets after_success option in .travis.yml (can be used more than once)]" "--install[sets install option in .travis.yml (can be used more than once)]" "--before-install[sets before_install option in .travis.yml (can be used more than once)]" "--compiler[sets compiler option in .travis.yml (can be used more than once)]" "--otp-release[sets otp_release option in .travis.yml (can be used more than once)]" "--go[sets go option in .travis.yml (can be used more than once)]" "--jdk[sets jdk option in .travis.yml (can be used more than once)]" "--node-js[sets node_js option in .travis.yml (can be used more than once)]" "--perl[sets perl option in .travis.yml (can be used more than once)]" "--php[sets php option in .travis.yml (can be used more than once)]" "--python[sets python option in .travis.yml (can be used more than once)]" "--rvm[sets rvm option in .travis.yml (can be used more than once)]" "--scala[sets scala option in .travis.yml (can be used more than once)]" "--env[sets env option in .travis.yml (can be used more than once)]" "--gemfile[sets gemfile option in .travis.yml (can be used more than once)]" '*:file:_files' && return 0;;
@@ -50,7 +51,7 @@ if type compdef 1>/dev/null 2>/dev/null; then
50
51
  repos) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-m[only list repositories matching the given pattern (shell style)]" "--match[only list repositories matching the given pattern (shell style)]" "-o[only list repos for a certain owner]" "--owner[only list repos for a certain owner]" "-n[only list repos with a given name]" "--name[only list repos with a given name]" "-a[only list active repositories]" "--active[only list active repositories]" "-A[only list inactive repositories]" "--inactive[only list inactive repositories]" "-d[only list repos with (or without) admin access]" "--admin[only list repos with (or without) admin access]" "-D[only list repos without admin access]" "--no-admin[only list repos without admin access]" '*:file:_files' && return 0;;
51
52
  requests) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-l[Maximum number requests to display]" "--limit[Maximum number requests to display]" '*:file:_files' && return 0;;
52
53
  restart) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" '*:file:_files' && return 0;;
53
- settings) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "--keys[always use setting key instead of description]" "--enable[enable the setting(s)]" "-f[disable the setting(s)]" "--disable[disable the setting(s)]" "-c[change settings interactively]" "--configure[change settings interactively]" '*:file:_files' && return 0;;
54
+ settings) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "--keys[always use setting key instead of description]" "--enable[enable boolean setting(s)]" "-f[disable boolean setting(s)]" "--disable[disable boolean setting(s)]" "-s[set to given value]" "--set[set to given value]" "-c[change settings interactively]" "--configure[change settings interactively]" '*:file:_files' && return 0;;
54
55
  setup) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-f[override config section if it already exists]" "--force[override config section if it already exists]" '*:file:_files' && return 0;;
55
56
  show) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" '*:file:_files' && return 0;;
56
57
  status) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-x[sets the exit code to 1 if the build failed]" "--exit-code[sets the exit code to 1 if the build failed]" "--no-exit-code[sets the exit code to 1 if the build failed]" "-q[does not print anything]" "--quiet[does not print anything]" "--no-quiet[does not print anything]" "-p[sets the status code to 1 if the build is pending]" "--fail-pending[sets the status code to 1 if the build is pending]" "--no-fail-pending[sets the status code to 1 if the build is pending]" '*:file:_files' && return 0;;
@@ -64,9 +65,9 @@ if type compdef 1>/dev/null 2>/dev/null; then
64
65
  elif type compctl 1>/dev/null 2>/dev/null; then
65
66
  compctl -K _travis travis
66
67
  _travis() { read -cA words && _travis_complete $((${#words} - 1)) "${words[2]}"; }
67
- _travis_commands() { reply=("accounts" "branches" "cache" "cancel" "console" "disable" "enable" "encrypt" "endpoint" "help" "history" "init" "lint" "login" "logout" "logs" "monitor" "open" "pubkey" "raw" "report" "repos" "requests" "restart" "settings" "setup" "show" "status" "sync" "token" "version" "whatsup" "whoami"); }
68
+ _travis_commands() { reply=("accounts" "branches" "cache" "cancel" "console" "disable" "enable" "encrypt" "endpoint" "env" "help" "history" "init" "lint" "login" "logout" "logs" "monitor" "open" "pubkey" "raw" "report" "repos" "requests" "restart" "settings" "setup" "show" "status" "sync" "token" "version" "whatsup" "whoami"); }
68
69
  _travis_setup() { reply=("appfog" "artifacts" "cloudcontrol" "cloudfiles" "cloudfoundry" "cloud66" "deis" "divshot" "engineyard" "gcs" "hackage" "heroku" "modulus" "npm" "ninefold" "nodejitsu" "openshift" "opsworks" "pypi" "releases" "rubygems" "s3" "sauce_connect"); }
69
- _travis_settings() { reply=(builds_only_with_travis_yml build_pushes build_pull_requests); }
70
+ _travis_settings() { reply=(builds_only_with_travis_yml build_pushes build_pull_requests maximum_number_of_builds); }
70
71
  _travis_init() { reply=("c" "clojure" "cpp" "erlang" "go" "groovy" "haskell" "java" "node_js" "objective-c" "perl" "php" "python" "ruby" "scala"); }
71
72
  _travis_option() {
72
73
  case "${words[2]}" in
@@ -79,6 +80,7 @@ elif type compctl 1>/dev/null 2>/dev/null; then
79
80
  enable) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--skip-sync" "-s");;
80
81
  encrypt) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--add" "-a" "--split" "--no-split" "-s" "--append" "-p" "--override" "-x");;
81
82
  endpoint) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--drop-default" "--set-default" "--github");;
83
+ env) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--public" "--no-public" "-P" "--private" "--no-private" "-p" "--unescape" "--no-unescape" "-u");;
82
84
  help) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check");;
83
85
  history) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--after" "-a" "--pull-request" "-p" "--branch" "-b" "--limit" "-l" "--date" "-d" "--committer" "-c" "--all" "--no-all");;
84
86
  init) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--skip-sync" "-s" "--force" "-f" "--skip-enable" "-k" "--print-conf" "-p" "--script" "--before-script" "--after-script" "--after-success" "--install" "--before-install" "--compiler" "--otp-release" "--go" "--jdk" "--node-js" "--perl" "--php" "--python" "--rvm" "--scala" "--env" "--gemfile");;
@@ -94,7 +96,7 @@ elif type compctl 1>/dev/null 2>/dev/null; then
94
96
  repos) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--match" "-m" "--owner" "-o" "--name" "-n" "--active" "-a" "--inactive" "-A" "--admin" "-d" "--no-admin" "-D");;
95
97
  requests) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--limit" "-l");;
96
98
  restart) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r");;
97
- settings) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--keys" "--enable" "--disable" "-f" "--configure" "-c");;
99
+ settings) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--keys" "--enable" "--disable" "-f" "--set" "-s" "--configure" "-c");;
98
100
  setup) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--force" "-f");;
99
101
  show) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r");;
100
102
  status) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--exit-code" "--no-exit-code" "-x" "--quiet" "--no-quiet" "-q" "--fail-pending" "--no-fail-pending" "-p");;
@@ -108,9 +110,9 @@ elif type compctl 1>/dev/null 2>/dev/null; then
108
110
  elif type complete 1>/dev/null 2>/dev/null; then
109
111
  complete -F _travis travis
110
112
  _travis() { _travis_complete "$COMP_CWORD" "${COMP_WORDS[1]}"; }
111
- _travis_commands() { COMPREPLY=( $(compgen -W "accounts branches cache cancel console disable enable encrypt endpoint help history init lint login logout logs monitor open pubkey raw report repos requests restart settings setup show status sync token version whatsup whoami" -- "${COMP_WORDS[COMP_CWORD]}") ); }
113
+ _travis_commands() { COMPREPLY=( $(compgen -W "accounts branches cache cancel console disable enable encrypt endpoint env help history init lint login logout logs monitor open pubkey raw report repos requests restart settings setup show status sync token version whatsup whoami" -- "${COMP_WORDS[COMP_CWORD]}") ); }
112
114
  _travis_setup() { COMPREPLY=( $(compgen -W "appfog artifacts cloudcontrol cloudfiles cloudfoundry cloud66 deis divshot engineyard gcs hackage heroku modulus npm ninefold nodejitsu openshift opsworks pypi releases rubygems s3 sauce_connect" -- "${COMP_WORDS[COMP_CWORD]}") ); }
113
- _travis_settings() { COMPREPLY=( $(compgen -W "builds_only_with_travis_yml build_pushes build_pull_requests" -- "${COMP_WORDS[COMP_CWORD]}") ); }
115
+ _travis_settings() { COMPREPLY=( $(compgen -W "builds_only_with_travis_yml build_pushes build_pull_requests maximum_number_of_builds" -- "${COMP_WORDS[COMP_CWORD]}") ); }
114
116
  _travis_init() { COMPREPLY=( $(compgen -W ""c" "clojure" "cpp" "erlang" "go" "groovy" "haskell" "java" "node_js" "objective-c" "perl" "php" "python" "ruby" "scala"" -- "${COMP_WORDS[COMP_CWORD]}") ); }
115
117
  _travis_option() {
116
118
  local options
@@ -124,6 +126,7 @@ elif type complete 1>/dev/null 2>/dev/null; then
124
126
  enable) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --skip-sync -s";;
125
127
  encrypt) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --add -a --split --no-split -s --append -p --override -x";;
126
128
  endpoint) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --drop-default --set-default --github";;
129
+ env) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --public --no-public -P --private --no-private -p --unescape --no-unescape -u";;
127
130
  help) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check";;
128
131
  history) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --after -a --pull-request -p --branch -b --limit -l --date -d --committer -c --all --no-all";;
129
132
  init) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --skip-sync -s --force -f --skip-enable -k --print-conf -p --script --before-script --after-script --after-success --install --before-install --compiler --otp-release --go --jdk --node-js --perl --php --python --rvm --scala --env --gemfile";;
@@ -139,7 +142,7 @@ elif type complete 1>/dev/null 2>/dev/null; then
139
142
  repos) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --match -m --owner -o --name -n --active -a --inactive -A --admin -d --no-admin -D";;
140
143
  requests) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --limit -l";;
141
144
  restart) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r";;
142
- settings) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --keys --enable --disable -f --configure -c";;
145
+ settings) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --keys --enable --disable -f --set -s --configure -c";;
143
146
  setup) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --force -f";;
144
147
  show) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r";;
145
148
  status) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --exit-code --no-exit-code -x --quiet --no-quiet -q --fail-pending --no-fail-pending -p";;
@@ -220,14 +220,15 @@ module Travis
220
220
  method = method(method)
221
221
  if method.respond_to? :parameters
222
222
  method.parameters.each do |type, name|
223
- name = "[#{name}]" if type == :opt
223
+ name = name.upcase
224
+ name = "[#{name}]" if type == :opt
224
225
  name = "[#{name}..]" if type == :rest
225
226
  usage << " #{name}"
226
227
  end
227
228
  elsif method.arity != 0
228
229
  usage << " ..."
229
230
  end
230
- usage << " [options]"
231
+ usage << " [OPTIONS]"
231
232
  end
232
233
 
233
234
  def help(info = "")
@@ -0,0 +1,55 @@
1
+ require 'travis/cli'
2
+ require 'shellwords'
3
+
4
+ module Travis
5
+ module CLI
6
+ class Env < RepoCommand
7
+ on('-P', '--[no-]public', 'make new values public')
8
+ on('-p', '--[no-]private', 'make new values private') { |c,v| c.public = !v }
9
+ on('-u', '--[no-]unescape', 'do not escape values')
10
+
11
+ description "show or modify build environment variables"
12
+ subcommands :list, :set, :unset, :copy
13
+
14
+ def setup
15
+ super
16
+ authenticate
17
+ error "not allowed to access environment variables for #{color(repository.slug, :bold)}" unless repository.admin?
18
+ end
19
+
20
+ def set(name, value)
21
+ options ||= { :public => public } if public != nil
22
+ say color('[+] ', [:green, :bold]) + "setting environment variable #{color "$#{name}", :info}"
23
+ value = Shellwords.escape(value) unless unescape?
24
+ env_vars.upsert(name, value, options || {})
25
+ end
26
+
27
+ def copy(*names)
28
+ names.each do |name|
29
+ if ENV.include? name
30
+ set(name, ENV[name])
31
+ else
32
+ warn "missing in current environment: #{color "$#{name}", :bold}"
33
+ end
34
+ end
35
+ end
36
+
37
+ def unset(*names)
38
+ env_vars.each do |var|
39
+ next unless names.include? var.name
40
+ say color('[x] ', [:red, :bold]) + "removing environment variable #{color "$#{var.name}", :info}"
41
+ var.delete
42
+ end
43
+ end
44
+
45
+ def list
46
+ say color("# environment variables for #{color repository.slug, :bold}", :info)
47
+ env_vars.each { |v| say "#{v.name}=" << color(v.value || "[secure]", :bold) }
48
+ end
49
+
50
+ def env_vars
51
+ repository.env_vars
52
+ end
53
+ end
54
+ end
55
+ end
@@ -12,6 +12,8 @@ module Travis
12
12
  def run(resource)
13
13
  reply = session.get_raw(resource)
14
14
  json? ? say(reply.to_json) : pp(reply)
15
+ rescue Travis::Client::NotFound
16
+ error "resource not found"
15
17
  end
16
18
  end
17
19
  end
@@ -0,0 +1,102 @@
1
+ require 'travis/client'
2
+ require 'delegate'
3
+
4
+ module Travis
5
+ module Client
6
+ class EnvVar < Entity
7
+ class List < DelegateClass(Array)
8
+ attr_reader :repository
9
+
10
+ def initialize(repository, &block)
11
+ @repository = repository
12
+ @generator = block || ::Proc.new { session.get(EnvVar.path(repository))['env_vars'] }
13
+ super(nil)
14
+ end
15
+
16
+ def list=(list)
17
+ __setobj__ list.dup.freeze
18
+ end
19
+
20
+ def __getobj__
21
+ super || (self.list = @generator.call)
22
+ end
23
+
24
+ def reload
25
+ __setobj__ nil
26
+ self
27
+ end
28
+
29
+ def session
30
+ repository.session
31
+ end
32
+
33
+ def repository_id
34
+ repository.id
35
+ end
36
+
37
+ def add(name, value, options = {})
38
+ body = JSON.dump(:env_var => options.merge(:name => name, :value => value))
39
+ result = session.post(EnvVar.path(self), body)
40
+ self.list += [result['env_var']]
41
+ end
42
+
43
+ def upsert(name, value, options = {})
44
+ entries = select { |e| e.name == name }
45
+ if entries.any?
46
+ entries.first.update(options.merge(:value => value))
47
+ entries[1..-1].each { |e| e.delete }
48
+ else
49
+ add(name, value, options)
50
+ end
51
+ reload
52
+ end
53
+
54
+ def [](key)
55
+ return super if key.is_a? Integer
56
+ detect { |e| e.name == key.to_s }
57
+ end
58
+
59
+ def []=(key, value)
60
+ return super if key.is_a? Integer
61
+ upsert(key.to_s, value)
62
+ end
63
+
64
+ alias list __getobj__
65
+ end
66
+
67
+ def self.path(object)
68
+ repository_id = Repository === object ? object.id : object.repository_id
69
+ raise "repository unknown" unless repository_id
70
+ "/settings/env_vars/#{object.id if object.is_a? EnvVar}?repository_id=#{repository_id}"
71
+ end
72
+
73
+ include NotLoadable
74
+ extend HasUuid
75
+ one :env_var
76
+ many :env_vars
77
+
78
+ # @!parse attr_reader :name, :public, :repository_id
79
+ attributes :name, :value, :public, :repository_id
80
+
81
+ # @!parse attr_reader :repository
82
+ has :repository
83
+
84
+ def update(options)
85
+ options = { :value => options } unless options.is_a? Hash
86
+ result = session.patch(EnvVar.path(self), JSON.dump(:env_var => options))
87
+ attributes.replace(result['env_var'].attributes)
88
+ self
89
+ end
90
+
91
+ def delete
92
+ session.delete_raw EnvVar.path(self)
93
+ repository.env_vars.reload
94
+ true
95
+ end
96
+
97
+ def inspect_info
98
+ "#{name}=#{value ? value.inspect : "[secure]"}"
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,13 @@
1
+ module Travis
2
+ module Client
3
+ module HasUuid
4
+ def id?(object)
5
+ object =~ /\A(?:\w+-){4}\w+\Z/ if object.is_a? String
6
+ end
7
+
8
+ def cast_id(object)
9
+ object.to_str
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Travis
2
- VERSION = '1.6.14'
2
+ VERSION = '1.6.15'
3
3
  end
@@ -23,11 +23,11 @@ describe Travis::CLI::Help do
23
23
 
24
24
  example "travis help endpoint" do
25
25
  run_cli('help', 'endpoint').should be_success
26
- stdout.should include("Usage: travis endpoint [options]")
26
+ stdout.should include("Usage: travis endpoint [OPTIONS]")
27
27
  end
28
28
 
29
29
  example "travis endpoint --help" do
30
30
  run_cli('endpoint', '--help').should be_success
31
- stdout.should include("Usage: travis endpoint [options]")
31
+ stdout.should include("Usage: travis endpoint [OPTIONS]")
32
32
  end
33
33
  end
data/travis.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  # general infos
4
4
  s.name = "travis"
5
- s.version = "1.6.14"
5
+ s.version = "1.6.15"
6
6
  s.description = "CLI and Ruby client library for Travis CI"
7
7
  s.homepage = "https://github.com/travis-ci/travis.rb"
8
8
  s.summary = "Travis CI client"
@@ -131,6 +131,7 @@ Gem::Specification.new do |s|
131
131
  "lib/travis/cli/enable.rb",
132
132
  "lib/travis/cli/encrypt.rb",
133
133
  "lib/travis/cli/endpoint.rb",
134
+ "lib/travis/cli/env.rb",
134
135
  "lib/travis/cli/help.rb",
135
136
  "lib/travis/cli/history.rb",
136
137
  "lib/travis/cli/init.rb",
@@ -190,7 +191,9 @@ Gem::Specification.new do |s|
190
191
  "lib/travis/client/cache.rb",
191
192
  "lib/travis/client/commit.rb",
192
193
  "lib/travis/client/entity.rb",
194
+ "lib/travis/client/env_var.rb",
193
195
  "lib/travis/client/error.rb",
196
+ "lib/travis/client/has_uuid.rb",
194
197
  "lib/travis/client/job.rb",
195
198
  "lib/travis/client/lint_result.rb",
196
199
  "lib/travis/client/listener.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.15.travis.580.6
4
+ version: 1.6.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
@@ -39,206 +39,206 @@ authors:
39
39
  autorequire:
40
40
  bindir: bin
41
41
  cert_chain: []
42
- date: 2014-07-17 00:00:00.000000000 Z
42
+ date: 2014-07-18 00:00:00.000000000 Z
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: faraday
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - ~>
48
+ - - "~>"
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0.9'
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ~>
55
+ - - "~>"
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0.9'
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: faraday_middleware
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ~>
62
+ - - "~>"
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0.9'
65
- - - ! '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: 0.9.1
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0.9'
75
- - - ! '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: 0.9.1
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: highline
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ~>
82
+ - - "~>"
83
83
  - !ruby/object:Gem::Version
84
84
  version: '1.6'
85
85
  type: :runtime
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ~>
89
+ - - "~>"
90
90
  - !ruby/object:Gem::Version
91
91
  version: '1.6'
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: backports
94
94
  requirement: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ! '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - ! '>='
103
+ - - ">="
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  - !ruby/object:Gem::Dependency
107
107
  name: gh
108
108
  requirement: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - ~>
110
+ - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0.13'
113
113
  type: :runtime
114
114
  prerelease: false
115
115
  version_requirements: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ~>
117
+ - - "~>"
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0.13'
120
120
  - !ruby/object:Gem::Dependency
121
121
  name: launchy
122
122
  requirement: !ruby/object:Gem::Requirement
123
123
  requirements:
124
- - - ~>
124
+ - - "~>"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '2.1'
127
127
  type: :runtime
128
128
  prerelease: false
129
129
  version_requirements: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ~>
131
+ - - "~>"
132
132
  - !ruby/object:Gem::Version
133
133
  version: '2.1'
134
134
  - !ruby/object:Gem::Dependency
135
135
  name: pry
136
136
  requirement: !ruby/object:Gem::Requirement
137
137
  requirements:
138
- - - <
138
+ - - "<"
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0.10'
141
- - - ~>
141
+ - - "~>"
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0.9'
144
144
  type: :runtime
145
145
  prerelease: false
146
146
  version_requirements: !ruby/object:Gem::Requirement
147
147
  requirements:
148
- - - <
148
+ - - "<"
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0.10'
151
- - - ~>
151
+ - - "~>"
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0.9'
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: typhoeus
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - ~>
158
+ - - "~>"
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0.6'
161
- - - ! '>='
161
+ - - ">="
162
162
  - !ruby/object:Gem::Version
163
163
  version: 0.6.8
164
164
  type: :runtime
165
165
  prerelease: false
166
166
  version_requirements: !ruby/object:Gem::Requirement
167
167
  requirements:
168
- - - ~>
168
+ - - "~>"
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0.6'
171
- - - ! '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: 0.6.8
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: pusher-client
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ~>
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0.4'
181
181
  type: :runtime
182
182
  prerelease: false
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ~>
185
+ - - "~>"
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0.4'
188
188
  - !ruby/object:Gem::Dependency
189
189
  name: addressable
190
190
  requirement: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ~>
192
+ - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: '2.3'
195
195
  type: :runtime
196
196
  prerelease: false
197
197
  version_requirements: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ~>
199
+ - - "~>"
200
200
  - !ruby/object:Gem::Version
201
201
  version: '2.3'
202
202
  - !ruby/object:Gem::Dependency
203
203
  name: rspec
204
204
  requirement: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ~>
206
+ - - "~>"
207
207
  - !ruby/object:Gem::Version
208
208
  version: '2.12'
209
209
  type: :development
210
210
  prerelease: false
211
211
  version_requirements: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ~>
213
+ - - "~>"
214
214
  - !ruby/object:Gem::Version
215
215
  version: '2.12'
216
216
  - !ruby/object:Gem::Dependency
217
217
  name: sinatra
218
218
  requirement: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ~>
220
+ - - "~>"
221
221
  - !ruby/object:Gem::Version
222
222
  version: '1.3'
223
223
  type: :development
224
224
  prerelease: false
225
225
  version_requirements: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ~>
227
+ - - "~>"
228
228
  - !ruby/object:Gem::Version
229
229
  version: '1.3'
230
230
  - !ruby/object:Gem::Dependency
231
231
  name: rack-test
232
232
  requirement: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ~>
234
+ - - "~>"
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0.6'
237
237
  type: :development
238
238
  prerelease: false
239
239
  version_requirements: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ~>
241
+ - - "~>"
242
242
  - !ruby/object:Gem::Version
243
243
  version: '0.6'
244
244
  description: CLI and Ruby client library for Travis CI
@@ -328,6 +328,7 @@ files:
328
328
  - lib/travis/cli/enable.rb
329
329
  - lib/travis/cli/encrypt.rb
330
330
  - lib/travis/cli/endpoint.rb
331
+ - lib/travis/cli/env.rb
331
332
  - lib/travis/cli/help.rb
332
333
  - lib/travis/cli/history.rb
333
334
  - lib/travis/cli/init.rb
@@ -387,7 +388,9 @@ files:
387
388
  - lib/travis/client/cache.rb
388
389
  - lib/travis/client/commit.rb
389
390
  - lib/travis/client/entity.rb
391
+ - lib/travis/client/env_var.rb
390
392
  - lib/travis/client/error.rb
393
+ - lib/travis/client/has_uuid.rb
391
394
  - lib/travis/client/job.rb
392
395
  - lib/travis/client/lint_result.rb
393
396
  - lib/travis/client/listener.rb
@@ -456,14 +459,14 @@ require_paths:
456
459
  - lib
457
460
  required_ruby_version: !ruby/object:Gem::Requirement
458
461
  requirements:
459
- - - ! '>='
462
+ - - ">="
460
463
  - !ruby/object:Gem::Version
461
464
  version: '0'
462
465
  required_rubygems_version: !ruby/object:Gem::Requirement
463
466
  requirements:
464
- - - ! '>'
467
+ - - ">="
465
468
  - !ruby/object:Gem::Version
466
- version: 1.3.1
469
+ version: '0'
467
470
  requirements: []
468
471
  rubyforge_project:
469
472
  rubygems_version: 2.2.2
@@ -471,3 +474,4 @@ signing_key:
471
474
  specification_version: 4
472
475
  summary: Travis CI client
473
476
  test_files: []
477
+ has_rdoc: