travis-akerl 1.8.9
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 +7 -0
- data/LICENSE +22 -0
- data/README.md +2512 -0
- data/Rakefile +64 -0
- data/assets/cacert.pem +69 -0
- data/assets/init/c.yml +4 -0
- data/assets/init/clojure.yml +1 -0
- data/assets/init/cpp.yml +4 -0
- data/assets/init/erlang.yml +3 -0
- data/assets/init/go.yml +4 -0
- data/assets/init/groovy.yml +1 -0
- data/assets/init/haskell.yml +1 -0
- data/assets/init/java.yml +4 -0
- data/assets/init/node_js.yml +5 -0
- data/assets/init/objective-c.yml +1 -0
- data/assets/init/perl.yml +4 -0
- data/assets/init/php.yml +4 -0
- data/assets/init/python.yml +5 -0
- data/assets/init/ruby.yml +6 -0
- data/assets/init/scala.yml +4 -0
- data/assets/notifications/Travis CI.app/Contents/Info.plist +52 -0
- data/assets/notifications/Travis CI.app/Contents/MacOS/Travis CI +0 -0
- data/assets/notifications/Travis CI.app/Contents/PkgInfo +1 -0
- data/assets/notifications/Travis CI.app/Contents/Resources/Travis CI.icns +0 -0
- data/assets/notifications/Travis CI.app/Contents/Resources/en.lproj/Credits.rtf +29 -0
- data/assets/notifications/Travis CI.app/Contents/Resources/en.lproj/InfoPlist.strings +0 -0
- data/assets/notifications/Travis CI.app/Contents/Resources/en.lproj/MainMenu.nib +0 -0
- data/assets/notifications/Travis CI.app/Contents/_CodeSignature/CodeResources +173 -0
- data/assets/notifications/Travis CI.app/Contents/embedded.provisionprofile +0 -0
- data/assets/notifications/icon.png +0 -0
- data/assets/travis.sh +163 -0
- data/assets/travis.sh.erb +64 -0
- data/bin/travis +18 -0
- data/examples/org_overview.rb +3 -0
- data/examples/pro_auth.rb +23 -0
- data/examples/stream.rb +6 -0
- data/lib/travis/auto_login.rb +3 -0
- data/lib/travis/cli/accounts.rb +31 -0
- data/lib/travis/cli/api_command.rb +182 -0
- data/lib/travis/cli/branches.rb +25 -0
- data/lib/travis/cli/cache.rb +76 -0
- data/lib/travis/cli/cancel.rb +18 -0
- data/lib/travis/cli/command.rb +422 -0
- data/lib/travis/cli/console.rb +33 -0
- data/lib/travis/cli/disable.rb +15 -0
- data/lib/travis/cli/enable.rb +31 -0
- data/lib/travis/cli/encrypt.rb +115 -0
- data/lib/travis/cli/encrypt_file.rb +140 -0
- data/lib/travis/cli/endpoint.rb +35 -0
- data/lib/travis/cli/env.rb +66 -0
- data/lib/travis/cli/help.rb +23 -0
- data/lib/travis/cli/history.rb +49 -0
- data/lib/travis/cli/init.rb +82 -0
- data/lib/travis/cli/lint.rb +49 -0
- data/lib/travis/cli/login.rb +76 -0
- data/lib/travis/cli/logout.rb +14 -0
- data/lib/travis/cli/logs.rb +65 -0
- data/lib/travis/cli/monitor.rb +111 -0
- data/lib/travis/cli/open.rb +39 -0
- data/lib/travis/cli/parser.rb +43 -0
- data/lib/travis/cli/pubkey.rb +30 -0
- data/lib/travis/cli/raw.rb +20 -0
- data/lib/travis/cli/repo_command.rb +154 -0
- data/lib/travis/cli/report.rb +101 -0
- data/lib/travis/cli/repos.rb +53 -0
- data/lib/travis/cli/requests.rb +47 -0
- data/lib/travis/cli/restart.rb +18 -0
- data/lib/travis/cli/settings.rb +79 -0
- data/lib/travis/cli/setup/anynines.rb +21 -0
- data/lib/travis/cli/setup/appfog.rb +19 -0
- data/lib/travis/cli/setup/artifacts.rb +23 -0
- data/lib/travis/cli/setup/biicode.rb +19 -0
- data/lib/travis/cli/setup/cloud_66.rb +20 -0
- data/lib/travis/cli/setup/cloud_control.rb +21 -0
- data/lib/travis/cli/setup/cloud_files.rb +20 -0
- data/lib/travis/cli/setup/cloud_foundry.rb +23 -0
- data/lib/travis/cli/setup/code_deploy.rb +55 -0
- data/lib/travis/cli/setup/deis.rb +20 -0
- data/lib/travis/cli/setup/divshot.rb +18 -0
- data/lib/travis/cli/setup/elastic_beanstalk.rb +23 -0
- data/lib/travis/cli/setup/engine_yard.rb +24 -0
- data/lib/travis/cli/setup/gcs.rb +22 -0
- data/lib/travis/cli/setup/hackage.rb +18 -0
- data/lib/travis/cli/setup/heroku.rb +20 -0
- data/lib/travis/cli/setup/modulus.rb +18 -0
- data/lib/travis/cli/setup/ninefold.rb +20 -0
- data/lib/travis/cli/setup/nodejitsu.rb +27 -0
- data/lib/travis/cli/setup/npm.rb +20 -0
- data/lib/travis/cli/setup/open_shift.rb +20 -0
- data/lib/travis/cli/setup/opsworks.rb +22 -0
- data/lib/travis/cli/setup/pypi.rb +22 -0
- data/lib/travis/cli/setup/releases.rb +35 -0
- data/lib/travis/cli/setup/ruby_gems.rb +25 -0
- data/lib/travis/cli/setup/s3.rb +25 -0
- data/lib/travis/cli/setup/sauce_connect.rb +21 -0
- data/lib/travis/cli/setup/service.rb +73 -0
- data/lib/travis/cli/setup.rb +66 -0
- data/lib/travis/cli/show.rb +57 -0
- data/lib/travis/cli/sshkey.rb +118 -0
- data/lib/travis/cli/status.rb +19 -0
- data/lib/travis/cli/sync.rb +30 -0
- data/lib/travis/cli/token.rb +14 -0
- data/lib/travis/cli/version.rb +17 -0
- data/lib/travis/cli/whatsup.rb +30 -0
- data/lib/travis/cli/whoami.rb +15 -0
- data/lib/travis/cli.rb +126 -0
- data/lib/travis/client/account.rb +56 -0
- data/lib/travis/client/artifact.rb +88 -0
- data/lib/travis/client/auto_login.rb +45 -0
- data/lib/travis/client/broadcast.rb +14 -0
- data/lib/travis/client/build.rb +47 -0
- data/lib/travis/client/cache.rb +25 -0
- data/lib/travis/client/commit.rb +28 -0
- data/lib/travis/client/entity.rb +238 -0
- data/lib/travis/client/env_var.rb +102 -0
- data/lib/travis/client/error.rb +38 -0
- data/lib/travis/client/has_uuid.rb +13 -0
- data/lib/travis/client/job.rb +61 -0
- data/lib/travis/client/lint_result.rb +25 -0
- data/lib/travis/client/listener.rb +183 -0
- data/lib/travis/client/methods.rb +104 -0
- data/lib/travis/client/namespace.rb +85 -0
- data/lib/travis/client/not_loadable.rb +13 -0
- data/lib/travis/client/repository.rb +224 -0
- data/lib/travis/client/request.rb +36 -0
- data/lib/travis/client/restartable.rb +23 -0
- data/lib/travis/client/session.rb +339 -0
- data/lib/travis/client/settings.rb +25 -0
- data/lib/travis/client/singleton_setting.rb +36 -0
- data/lib/travis/client/ssh_key.rb +11 -0
- data/lib/travis/client/states.rb +98 -0
- data/lib/travis/client/user.rb +67 -0
- data/lib/travis/client/weak_entity.rb +26 -0
- data/lib/travis/client.rb +38 -0
- data/lib/travis/pro/auto_login.rb +3 -0
- data/lib/travis/pro.rb +5 -0
- data/lib/travis/tools/assets.rb +21 -0
- data/lib/travis/tools/completion.rb +54 -0
- data/lib/travis/tools/formatter.rb +50 -0
- data/lib/travis/tools/github.rb +293 -0
- data/lib/travis/tools/notification.rb +69 -0
- data/lib/travis/tools/safe_string.rb +22 -0
- data/lib/travis/tools/ssl_key.rb +48 -0
- data/lib/travis/tools/system.rb +88 -0
- data/lib/travis/version.rb +3 -0
- data/lib/travis.rb +8 -0
- data/spec/cli/api_command_spec.rb +38 -0
- data/spec/cli/cancel_spec.rb +15 -0
- data/spec/cli/encrypt_spec.rb +49 -0
- data/spec/cli/endpoint_spec.rb +39 -0
- data/spec/cli/help_spec.rb +33 -0
- data/spec/cli/history_spec.rb +38 -0
- data/spec/cli/init_spec.rb +227 -0
- data/spec/cli/login_spec.rb +13 -0
- data/spec/cli/logs_spec.rb +8 -0
- data/spec/cli/open_spec.rb +33 -0
- data/spec/cli/repo_command_spec.rb +25 -0
- data/spec/cli/restart_spec.rb +15 -0
- data/spec/cli/setup_spec.rb +5 -0
- data/spec/cli/show_spec.rb +9 -0
- data/spec/cli/status_spec.rb +28 -0
- data/spec/cli/token_spec.rb +22 -0
- data/spec/cli/version_spec.rb +18 -0
- data/spec/cli/whoami_spec.rb +34 -0
- data/spec/client/account_spec.rb +32 -0
- data/spec/client/auto_login_spec.rb +25 -0
- data/spec/client/broadcast_spec.rb +10 -0
- data/spec/client/build_spec.rb +31 -0
- data/spec/client/commit_spec.rb +22 -0
- data/spec/client/job_spec.rb +30 -0
- data/spec/client/methods_spec.rb +15 -0
- data/spec/client/namespace_spec.rb +19 -0
- data/spec/client/repository_spec.rb +39 -0
- data/spec/client/session_spec.rb +165 -0
- data/spec/client/user_spec.rb +16 -0
- data/spec/client_spec.rb +17 -0
- data/spec/pro_spec.rb +10 -0
- data/spec/spec_helper.rb +29 -0
- data/spec/support/fake_api.rb +731 -0
- data/spec/support/fake_github.rb +24 -0
- data/spec/support/fake_travis_config.yml +14 -0
- data/spec/support/helpers.rb +45 -0
- data/spec/travis_spec.rb +10 -0
- data/travis.gemspec +371 -0
- metadata +534 -0
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'travis/cli'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Settings < RepoCommand
|
6
|
+
attr_accessor :setting
|
7
|
+
|
8
|
+
description "access repository settings"
|
9
|
+
on('--keys', 'always use setting key instead of description')
|
10
|
+
on('-t', '--enable', 'enable boolean setting(s)') { |c | c.setting = true }
|
11
|
+
on('-f', '--disable', 'disable boolean setting(s)') { |c | c.setting = false }
|
12
|
+
on('-s', '--set VALUE', 'set to given value') { |c,v| c.setting = v }
|
13
|
+
on('-c', '--configure', 'change settings interactively')
|
14
|
+
|
15
|
+
DESCRIPTIONS = {
|
16
|
+
:builds_only_with_travis_yml => "Only run builds with a .travis.yml",
|
17
|
+
:build_pushes => "Build pushes",
|
18
|
+
:build_pull_requests => "Build pull requests",
|
19
|
+
:maximum_number_of_builds => "Maximum number of concurrent builds",
|
20
|
+
:auto_cancel_pushes => "Cancel older push builds that are not yet running",
|
21
|
+
:auto_cancel_pull_requests => "Cancel older pull request builds that are not yet running"
|
22
|
+
}
|
23
|
+
|
24
|
+
def run(*keys)
|
25
|
+
exit 1 if interactive? and keys.empty? and !setting.nil? and !all_settings? and !configure?
|
26
|
+
authenticate
|
27
|
+
say repository.slug, "Settings for %s:"
|
28
|
+
repository.settings.to_h.each do |key, value|
|
29
|
+
next unless keys.empty? or keys.include? key
|
30
|
+
if configure?
|
31
|
+
if boolean? key
|
32
|
+
repository.settings[key] = agree("#{describe(key, "enable #{key}")}? ") do |q|
|
33
|
+
default = setting.nil? ? value : setting
|
34
|
+
q.default = default ? "yes" : "no"
|
35
|
+
end
|
36
|
+
else
|
37
|
+
repository.settings[key] = ask("#{describe(key, "Value for #{key}")}: ", Integer) do |q|
|
38
|
+
default = setting.to_i if setting and setting.respond_to? :to_i
|
39
|
+
default ||= value
|
40
|
+
default ||= 0
|
41
|
+
q.default = default
|
42
|
+
end
|
43
|
+
end
|
44
|
+
else
|
45
|
+
value = repository.settings[key] = setting unless setting.nil?
|
46
|
+
descr = color(describe(key, color(key, :info)) { |s| key.ljust(30) + " " + color(s, [:reset, :bold]) }, :info)
|
47
|
+
say format_value(value) << " " << descr
|
48
|
+
end
|
49
|
+
end
|
50
|
+
repository.settings.save if configure? or !setting.nil?
|
51
|
+
end
|
52
|
+
|
53
|
+
def boolean?(key)
|
54
|
+
key.to_sym != :maximum_number_of_builds
|
55
|
+
end
|
56
|
+
|
57
|
+
def format_value(value)
|
58
|
+
case value
|
59
|
+
when false, nil then color("[-]", [ :bold, :red ])
|
60
|
+
when true then color("[+]", [ :bold, :green ])
|
61
|
+
else color(value.to_s.rjust(3), [ :bold, :blue ])
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def all_settings?
|
66
|
+
agree("Really #{setting ? "enable" : "disable"} all settings? ") do |q|
|
67
|
+
q.default = "no"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def describe(key, description = key)
|
72
|
+
return description if keys?
|
73
|
+
desc = DESCRIPTIONS[key.to_sym]
|
74
|
+
desc &&= yield(desc) if block_given?
|
75
|
+
desc || description
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Anynines < Service
|
7
|
+
description "automatic deployment to anynines"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'anynines' do |config|
|
11
|
+
config['username'] ||= ask("anynines username: ").to_s
|
12
|
+
config['password'] ||= ask("anynines password: ") { |q| q.echo = "*" }.to_s
|
13
|
+
config['organization'] ||= ask("anynines organization: ").to_s
|
14
|
+
config['space'] ||= ask("anynines space: ").to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Appfog < Service
|
7
|
+
description "automatic deployment to Appfog"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'appfog' do |config|
|
11
|
+
config['email'] = ask("Email address: ").to_s
|
12
|
+
config['password'] = ask("Password: ") { |q| q.echo = "*" }.to_s
|
13
|
+
config['app'] = ask("App name: ") { |q| q.default = repository.name }.to_s
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Artifacts < Service
|
7
|
+
description 'automatic artifact shipping to S3'
|
8
|
+
service_name 'artifacts'
|
9
|
+
|
10
|
+
def run
|
11
|
+
travis_config['addons'] ||= {}
|
12
|
+
configure 'artifacts', {}, travis_config['addons'] do |config|
|
13
|
+
config['key'] = ask("Access key ID: ").to_s
|
14
|
+
config['secret'] = ask("Secret access key: ") { |q| q.echo = "*" }.to_s
|
15
|
+
config['bucket'] = ask("Bucket: ").to_s
|
16
|
+
encrypt(config, 'key') if agree("Encrypt access key ID? ") { |q| q.default = 'yes' }
|
17
|
+
encrypt(config, 'secret') if agree("Encrypt secret access key? ") { |q| q.default = 'yes' }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Biicode < Service
|
7
|
+
description "automatic publish to biicode"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'biicode', 'release' do |config|
|
11
|
+
config['user'] ||= ask("biicode username: ") { |q| q }.to_s
|
12
|
+
config['password'] ||= ask("biicode password: ") { |q| q.echo = "*" }.to_s
|
13
|
+
on("publish only tagged commits? ", config, 'tags' => true)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Cloud_66 < Service
|
7
|
+
description "Automatic deployment to Cloud 66"
|
8
|
+
service_name 'cloud66'
|
9
|
+
|
10
|
+
def run
|
11
|
+
deploy 'cloud66', 'release' do |config|
|
12
|
+
config['redeployment_hook'] ||= ask("Cloud 66 Redeployment Hook Url: ") { |q| q.echo = "*" }.to_s
|
13
|
+
|
14
|
+
encrypt(config, 'redeployment_hook') if agree("Encrypt Redeployment Hook?") { |q| q.default = 'yes' }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class CloudControl < Service
|
7
|
+
description "automatic deployment to cloudControl"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'cloudcontrol' do |config|
|
11
|
+
config['email'] = ask("cloudControl email: ").to_s
|
12
|
+
config['password'] = ask("cloudControl password: ") { |q| q.echo = "*" }.to_s
|
13
|
+
app = ask("cloudControl application: ") { |q| q.default = repository.name }.to_s
|
14
|
+
dep = ask("cloudControl deployment: ") { |q| q.default = "default" }.to_s
|
15
|
+
config['deployment'] = "#{app}/#{dep}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class CloudFiles < Service
|
7
|
+
description "automatic pushing to Rackspace Cloud Files"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'cloudfiles' do |config|
|
11
|
+
config['username'] = ask("Rackspace Username: ").to_s
|
12
|
+
config['api_key'] = ask("Rackspace Api Key: ") { |q| q.echo = "*" }.to_s
|
13
|
+
config['region'] = ask("Cloud Files Region: ").to_s
|
14
|
+
config['container'] = ask("Container: ").to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class CloudFoundry < Service
|
7
|
+
description "automatic deployment to Cloud Foundry"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'cloudfoundry' do |config|
|
11
|
+
target_file = File.expand_path('.cf/config.json', Dir.home)
|
12
|
+
config['api'] ||= JSON.parse(File.read(target_file))["Target"] if File.exist? target_file
|
13
|
+
config['api'] ||= ask("Cloud Foundry api: ").to_s
|
14
|
+
config['username'] ||= ask("Cloud Foundry username: ").to_s
|
15
|
+
config['password'] ||= ask("Cloud Foundry password: ") { |q| q.echo = "*" }.to_s
|
16
|
+
config['organization'] ||= ask("Cloud Foundry organization: ").to_s
|
17
|
+
config['space'] ||= ask("Cloud Foundry space: ").to_s
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
require 'shellwords'
|
3
|
+
|
4
|
+
module Travis
|
5
|
+
module CLI
|
6
|
+
class Setup
|
7
|
+
class CodeDeploy < Service
|
8
|
+
description "triggering a new deployment on Amazon CodeDeploy"
|
9
|
+
AWS_CONFIG = File.expand_path('.aws/config', ENV['HOME'])
|
10
|
+
|
11
|
+
def run
|
12
|
+
if File.readable? AWS_CONFIG
|
13
|
+
content = File.read(AWS_CONFIG)
|
14
|
+
access_key = content[/aws_access_key_id = (\S+)\n/, 1]
|
15
|
+
secret_access_key = content[/aws_secret_access_key = (\S+)\n/, 1]
|
16
|
+
end
|
17
|
+
|
18
|
+
deploy 'codedeploy' do |config|
|
19
|
+
config['access_key_id'] = ask("Access key ID: ") { |q| q.default = access_key if access_key }.to_s
|
20
|
+
secret_access_key = nil unless access_key == config['access_key_id']
|
21
|
+
config['secret_access_key'] = secret_access_key || ask("Secret access key: ") { |q| q.echo = "*" }.to_s
|
22
|
+
config['bucket'] = ask("S3 Bucket: ").to_s
|
23
|
+
config['key'] = ask("S3 Key: ").to_s
|
24
|
+
config['bundle_type'] = ask("Bundle Type: ") { |q| q.default = config['key'][/\.(zip|tar|tgz)$/, 1] }.to_s
|
25
|
+
config['application'] = ask("Application Name: ") { |q| q.default = repository.name }.to_s
|
26
|
+
config['deployment_group'] = ask("Deployment Group Name: ").to_s
|
27
|
+
encrypt(config, 'secret_access_key') if agree("Encrypt secret access key? ") { |q| q.default = 'yes' }
|
28
|
+
end
|
29
|
+
|
30
|
+
if agree("Also push bundle to S3? ")
|
31
|
+
cd = travis_config['deploy']
|
32
|
+
s3 = {
|
33
|
+
'provider' => 's3',
|
34
|
+
'access_key_id' => cd['access_key_id'],
|
35
|
+
'secret_access_key' => cd['secret_access_key'],
|
36
|
+
'local_dir' => 'dpl_cd_upload',
|
37
|
+
'skip_cleanup' => true,
|
38
|
+
'on' => cd['on'],
|
39
|
+
'bucket' => cd['bucket']
|
40
|
+
}
|
41
|
+
|
42
|
+
s3['upload_dir'] = File.dirname(cd['key']) if cd['key'].include? '/'
|
43
|
+
travis_config['deploy'] = [ s3, cd ]
|
44
|
+
upload_file_name = File.basename(cd['key'])
|
45
|
+
source_file = ask("Source File: ") { |q| q.default = upload_file_name }
|
46
|
+
travis_config['before_deploy'] = [
|
47
|
+
"mkdir -p dpl_cd_upload",
|
48
|
+
"mv #{Shellwords.escape(source_file)} dpl_cd_upload/#{Shellwords.escape(upload_file_name)}"
|
49
|
+
]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Deis < Service
|
7
|
+
description "automatic deployment to a deis app"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'deis' do |config|
|
11
|
+
config['controller'] ||= ask("Deis Controller: ").to_s
|
12
|
+
config['app'] ||= ask("Deis App: ").to_s
|
13
|
+
config['username'] ||= ask("Deis Username: ").to_s
|
14
|
+
config['password'] ||= ask("Deis Password: ") { |q| q.echo = "*" }.to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Divshot < Service
|
7
|
+
description "deployment to Divshot.io"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'divshot' do |config|
|
11
|
+
config['api_key'] = ask("Divshot Api Key: ") { |q| q.echo = "*" }.to_s
|
12
|
+
config['environment'] = ask("Divshot Environment: ").to_s
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class ElasticBeanstalk < Service
|
7
|
+
description "deployment to AWS Elastic Beanstalk"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'elasticbeanstalk' do |config|
|
11
|
+
config['access_key_id'] = ask("Access key ID: ").to_s
|
12
|
+
config['secret_access_key'] = ask("Secret access key: ") { |q| q.echo = "*" }.to_s
|
13
|
+
config['region'] = ask("Elastic Beanstalk region: ") {|q| q.default = 'us-east-1'}.to_s
|
14
|
+
config['app'] = ask("Elastic Beanstalk application name: ").to_s
|
15
|
+
config['env'] = ask("Elastic Beanstalk environment to update: ").to_s
|
16
|
+
|
17
|
+
encrypt(config, 'secret_access_key') if agree("Encrypt secret access key? ") { |q| q.default = 'yes' }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
module Travis
|
5
|
+
module CLI
|
6
|
+
class Setup
|
7
|
+
class EngineYard < Service
|
8
|
+
description "automatic deployment to Engine Yard"
|
9
|
+
|
10
|
+
def run
|
11
|
+
deploy 'engineyard' do |config|
|
12
|
+
eyrc = File.expand_path(".eyrc", Dir.home)
|
13
|
+
config['api_key'] = YAML.load_file(eyrc)["api_token"] if File.exists?(eyrc)
|
14
|
+
config['api_key'] = ask("API token: ") { |q| q.echo = "*" }.to_s unless config['api_key']
|
15
|
+
env = ask("Environment (optional): ").to_s
|
16
|
+
config['environment'] = env unless env.empty?
|
17
|
+
migrate = agree("Run migrations on deploy? ") { |q| q.default = 'yes' }
|
18
|
+
config['migrate'] = ask("Migration command: ") { |q| q.default = "rake db:migrate" } if migrate
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class GCS < Service
|
7
|
+
description "automatic pushing to Google Cloud Storage"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'gcs' do |config|
|
11
|
+
config['access_key_id'] = ask("Access key ID: ").to_s
|
12
|
+
config['secret_access_key'] = ask("Secret access key: ") { |q| q.echo = "*" }.to_s
|
13
|
+
config['bucket'] = ask("Bucket: ").to_s
|
14
|
+
local_dir = ask("Local project directory to upload (Optional): ").to_s
|
15
|
+
config['local-dir'] = local_dir unless local_dir.empty?
|
16
|
+
encrypt(config, 'secret_access_key') if agree("Encrypt secret access key? ") { |q| q.default = 'yes' }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Hackage < Service
|
7
|
+
description "automatic deployment of hackage packages"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'hackage' do |config|
|
11
|
+
config['username'] ||= ask("Hackage Username: ").to_s
|
12
|
+
config['password'] ||= ask("Hackage Password: ") { |q| q.echo = "*" }.to_s
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Heroku < Service
|
7
|
+
description "automatic deployment to Heroku"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'heroku' do |config|
|
11
|
+
config['api_key'] = `heroku auth:token 2>/dev/null`.strip
|
12
|
+
config['api_key'] = ask("Heroku API token: ") { |q| q.echo = "*" }.to_s if config['api_key'].empty?
|
13
|
+
config['app'] = `heroku apps:info 2>/dev/null`.scan(/^=== (.+)$/).flatten.first
|
14
|
+
config['app'] = ask("Heroku application name: ") { |q| q.default = repository.name }.to_s if config['app'].nil?
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Modulus < Service
|
7
|
+
description "deployment to Modulus"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'modulus' do |config|
|
11
|
+
config['api_key'] = ask("Modulus Api Key: ") { |q| q.echo = "*" }.to_s
|
12
|
+
config['project_name'] = ask("Modulus Project Name: ").to_s
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class Ninefold < Service
|
7
|
+
description "Automatic deployment to Ninefold"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'ninefold', 'release' do |config|
|
11
|
+
config['app_id'] ||= ask("Ninefold App ID: ").to_s
|
12
|
+
config['auth_token'] ||= ask("Ninefold Auth Token: ") { |q| q.echo = "*" }.to_s
|
13
|
+
|
14
|
+
encrypt(config, 'auth_token') if agree("Encrypt Auth Token? ") { |q| q.default = 'yes' }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module Travis
|
5
|
+
module CLI
|
6
|
+
class Setup
|
7
|
+
class Nodejitsu < Service
|
8
|
+
description "automatic deployment to Nodejitsu"
|
9
|
+
|
10
|
+
def run
|
11
|
+
deploy 'nodejitsu' do |config|
|
12
|
+
jitsu_file = File.expand_path('.jitsuconf', ENV['HOME'])
|
13
|
+
|
14
|
+
if File.exist? jitsu_file
|
15
|
+
jitsu_conf = JSON.parse(File.read(jitsu_file))
|
16
|
+
config['user'] = jitsu_conf['username']
|
17
|
+
config['api_key'] = jitsu_conf['apiToken']
|
18
|
+
end
|
19
|
+
|
20
|
+
config['user'] ||= ask("Nodejitsu user: ").to_s
|
21
|
+
config['api_key'] ||= ask("Nodejitsu API token: ") { |q| q.echo = "*" }.to_s
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class NPM < Service
|
7
|
+
description "automatic release to NPM"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'npm', 'release' do |config|
|
11
|
+
config['email'] ||= ask("NPM email address: ") { |q| q }.to_s
|
12
|
+
config['api_key'] ||= ask("NPM api key: ") { |q| q.echo = "*" }.to_s
|
13
|
+
|
14
|
+
on("release only tagged commits? ", config, 'tags' => true)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class OpenShift < Service
|
7
|
+
description "automatic deployment to OpenShfit"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'openshift' do |config|
|
11
|
+
config['user'] = ask("OpenShift user: ").to_s
|
12
|
+
config['password'] = ask("OpenShift password: ") { |q| q.echo = "*" }.to_s
|
13
|
+
config['app'] = ask("OpenShift application name: ") { |q| q.default = repository.name }.to_s
|
14
|
+
config['domain'] = ask("OpenShift domain: ").to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class OpsWorks < Service
|
7
|
+
description "deployment to OpsWorks"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'opsworks' do |config|
|
11
|
+
config['access_key_id'] = ask("Access key ID: ").to_s
|
12
|
+
config['secret_access_key'] = ask("Secret access key: ") { |q| q.echo = "*" }.to_s
|
13
|
+
config['app-id'] = ask("App ID: ").to_s
|
14
|
+
config['migrate'] = true if agree("Migrate the Database? ") { |q| q.default = 'no' }
|
15
|
+
|
16
|
+
encrypt(config, 'secret_access_key') if agree("Encrypt secret access key? ") { |q| q.default = 'yes' }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
|
3
|
+
module Travis
|
4
|
+
module CLI
|
5
|
+
class Setup
|
6
|
+
class PyPI < Service
|
7
|
+
description "automatic deployment to PyPI"
|
8
|
+
|
9
|
+
def run
|
10
|
+
deploy 'pypi', 'release' do |config|
|
11
|
+
config['user'] ||= ask("Username: ").to_s
|
12
|
+
config['password'] ||= ask("Password: ") { |q| q.echo = "*" }.to_s
|
13
|
+
|
14
|
+
on("release only tagged commits? ", config, 'tags' => true)
|
15
|
+
# the default of pypi `setup.py build` is the `sdist`
|
16
|
+
on("deploy as wheel file too? ", config, 'distributions' => 'sdist bdist_wheel')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'travis/cli/setup'
|
2
|
+
require 'travis/tools/github'
|
3
|
+
|
4
|
+
module Travis
|
5
|
+
module CLI
|
6
|
+
class Setup
|
7
|
+
class Releases < Service
|
8
|
+
description "Upload Assets to GitHub Releases"
|
9
|
+
|
10
|
+
def run
|
11
|
+
deploy 'releases' do |config|
|
12
|
+
github.with_token { |t| config['api_key'] = t }
|
13
|
+
config['file'] = ask("File to Upload: ").to_s
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def github
|
18
|
+
@github ||= begin
|
19
|
+
load_gh
|
20
|
+
Tools::Github.new(session.config['github']) do |g|
|
21
|
+
g.drop_token = false
|
22
|
+
g.ask_login = proc { ask("Username: ") }
|
23
|
+
g.ask_password = proc { |user| ask("Password for #{user}: ") { |q| q.echo = "*" } }
|
24
|
+
g.ask_otp = proc { |user| ask("Two-factor authentication code for #{user}: ") }
|
25
|
+
g.debug = proc { |log| debug(log) }
|
26
|
+
g.after_tokens = proc { g.explode = true and error("no suitable github token found") }
|
27
|
+
g.scopes = org? ? ['public_repo'] : ['repo']
|
28
|
+
g.note = "automatic releases for #{repository.slug}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|