travis 1.11.1 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -3
- data/Rakefile +22 -20
- data/bin/travis +5 -3
- data/examples/org_overview.rb +2 -0
- data/examples/pro_auth.rb +3 -1
- data/examples/stream.rb +5 -3
- data/lib/travis/auto_login.rb +2 -0
- data/lib/travis/cli/accounts.rb +12 -9
- data/lib/travis/cli/api_command.rb +85 -81
- data/lib/travis/cli/branches.rb +8 -6
- data/lib/travis/cli/cache.rb +48 -44
- data/lib/travis/cli/cancel.rb +4 -2
- data/lib/travis/cli/command.rb +170 -142
- data/lib/travis/cli/console.rb +5 -5
- data/lib/travis/cli/disable.rb +4 -2
- data/lib/travis/cli/enable.rb +14 -12
- data/lib/travis/cli/encrypt.rb +57 -57
- data/lib/travis/cli/encrypt_file.rb +29 -18
- data/lib/travis/cli/endpoint.rb +9 -7
- data/lib/travis/cli/env.rb +13 -8
- data/lib/travis/cli/help.rb +10 -8
- data/lib/travis/cli/history.rb +19 -15
- data/lib/travis/cli/init.rb +27 -24
- data/lib/travis/cli/lint.rb +10 -8
- data/lib/travis/cli/login.rb +17 -11
- data/lib/travis/cli/logout.rb +4 -2
- data/lib/travis/cli/logs.rb +28 -19
- data/lib/travis/cli/monitor.rb +11 -8
- data/lib/travis/cli/open.rb +17 -14
- data/lib/travis/cli/parser.rb +2 -0
- data/lib/travis/cli/pubkey.rb +13 -11
- data/lib/travis/cli/raw.rb +4 -3
- data/lib/travis/cli/repo_command.rb +123 -112
- data/lib/travis/cli/report.rb +40 -33
- data/lib/travis/cli/repos.rb +14 -9
- data/lib/travis/cli/requests.rb +13 -12
- data/lib/travis/cli/restart.rb +4 -2
- data/lib/travis/cli/settings.rb +41 -35
- data/lib/travis/cli/setup/anynines.rb +7 -6
- data/lib/travis/cli/setup/appfog.rb +6 -4
- data/lib/travis/cli/setup/artifacts.rb +7 -5
- data/lib/travis/cli/setup/biicode.rb +6 -4
- data/lib/travis/cli/setup/cloud_66.rb +6 -4
- data/lib/travis/cli/setup/cloud_control.rb +8 -6
- data/lib/travis/cli/setup/cloud_files.rb +7 -5
- data/lib/travis/cli/setup/cloud_foundry.rb +9 -7
- data/lib/travis/cli/setup/code_deploy.rb +33 -29
- data/lib/travis/cli/setup/deis.rb +8 -6
- data/lib/travis/cli/setup/divshot.rb +20 -18
- data/lib/travis/cli/setup/elastic_beanstalk.rb +10 -8
- data/lib/travis/cli/setup/engine_yard.rb +9 -7
- data/lib/travis/cli/setup/gcs.rb +9 -7
- data/lib/travis/cli/setup/hackage.rb +6 -4
- data/lib/travis/cli/setup/heroku.rb +10 -4
- data/lib/travis/cli/setup/modulus.rb +5 -3
- data/lib/travis/cli/setup/ninefold.rb +7 -5
- data/lib/travis/cli/setup/nodejitsu.rb +6 -4
- data/lib/travis/cli/setup/npm.rb +6 -4
- data/lib/travis/cli/setup/open_shift.rb +8 -6
- data/lib/travis/cli/setup/opsworks.rb +24 -22
- data/lib/travis/cli/setup/pypi.rb +7 -5
- data/lib/travis/cli/setup/releases.rb +6 -6
- data/lib/travis/cli/setup/ruby_gems.rb +7 -5
- data/lib/travis/cli/setup/s3.rb +12 -8
- data/lib/travis/cli/setup/sauce_connect.rb +7 -5
- data/lib/travis/cli/setup/service.rb +36 -25
- data/lib/travis/cli/setup.rb +7 -3
- data/lib/travis/cli/show.rb +10 -8
- data/lib/travis/cli/sshkey.rb +31 -27
- data/lib/travis/cli/status.rb +5 -3
- data/lib/travis/cli/sync.rb +9 -7
- data/lib/travis/cli/token.rb +4 -2
- data/lib/travis/cli/version.rb +4 -3
- data/lib/travis/cli/whatsup.rb +10 -8
- data/lib/travis/cli/whoami.rb +2 -2
- data/lib/travis/cli.rb +39 -36
- data/lib/travis/client/account.rb +8 -6
- data/lib/travis/client/artifact.rb +16 -12
- data/lib/travis/client/auto_login.rb +7 -4
- data/lib/travis/client/broadcast.rb +2 -0
- data/lib/travis/client/build.rb +7 -3
- data/lib/travis/client/cache.rb +4 -2
- data/lib/travis/client/commit.rb +5 -2
- data/lib/travis/client/entity.rb +50 -46
- data/lib/travis/client/env_var.rb +13 -8
- data/lib/travis/client/error.rb +5 -3
- data/lib/travis/client/has_uuid.rb +3 -1
- data/lib/travis/client/job.rb +8 -3
- data/lib/travis/client/lint_result.rb +2 -0
- data/lib/travis/client/listener.rb +70 -55
- data/lib/travis/client/methods.rb +10 -5
- data/lib/travis/client/namespace.rb +20 -16
- data/lib/travis/client/not_loadable.rb +3 -1
- data/lib/travis/client/repository.rb +34 -22
- data/lib/travis/client/request.rb +5 -2
- data/lib/travis/client/restartable.rb +2 -0
- data/lib/travis/client/session.rb +118 -88
- data/lib/travis/client/settings.rb +8 -3
- data/lib/travis/client/singleton_setting.rb +2 -0
- data/lib/travis/client/ssh_key.rb +2 -0
- data/lib/travis/client/states.rb +8 -6
- data/lib/travis/client/user.rb +2 -0
- data/lib/travis/client/weak_entity.rb +6 -3
- data/lib/travis/client.rb +4 -1
- data/lib/travis/pro/auto_login.rb +2 -0
- data/lib/travis/pro.rb +2 -0
- data/lib/travis/tools/assets.rb +6 -3
- data/lib/travis/tools/completion.rb +10 -6
- data/lib/travis/tools/formatter.rb +20 -14
- data/lib/travis/tools/github.rb +59 -49
- data/lib/travis/tools/notification.rb +18 -13
- data/lib/travis/tools/safe_string.rb +4 -1
- data/lib/travis/tools/ssl_key.rb +5 -2
- data/lib/travis/tools/system.rb +11 -6
- data/lib/travis/version.rb +3 -1
- data/lib/travis.rb +3 -1
- data/spec/cli/api_command_spec.rb +11 -8
- data/spec/cli/cancel_spec.rb +2 -4
- data/spec/cli/encrypt_file_spec.rb +9 -7
- data/spec/cli/encrypt_spec.rb +19 -17
- data/spec/cli/endpoint_spec.rb +12 -10
- data/spec/cli/help_spec.rb +14 -12
- data/spec/cli/history_spec.rb +2 -0
- data/spec/cli/init_spec.rb +35 -33
- data/spec/cli/logs_spec.rb +2 -0
- data/spec/cli/open_spec.rb +6 -4
- data/spec/cli/repo_command_spec.rb +8 -4
- data/spec/cli/restart_spec.rb +2 -4
- data/spec/cli/setup/service_spec.rb +17 -18
- data/spec/cli/setup_spec.rb +2 -4
- data/spec/cli/show_spec.rb +4 -2
- data/spec/cli/status_spec.rb +7 -5
- data/spec/cli/token_spec.rb +7 -5
- data/spec/cli/version_spec.rb +2 -0
- data/spec/cli/whoami_spec.rb +9 -7
- data/spec/client/account_spec.rb +28 -20
- data/spec/client/auto_login_spec.rb +12 -9
- data/spec/client/broadcast_spec.rb +5 -3
- data/spec/client/build_spec.rb +28 -24
- data/spec/client/commit_spec.rb +17 -14
- data/spec/client/job_spec.rb +27 -23
- data/spec/client/methods_spec.rb +8 -4
- data/spec/client/namespace_spec.rb +8 -4
- data/spec/client/repository_spec.rb +33 -30
- data/spec/client/session_spec.rb +71 -67
- data/spec/client/user_spec.rb +13 -10
- data/spec/client_spec.rb +6 -4
- data/spec/pro_spec.rb +5 -3
- data/spec/spec_helper.rb +3 -1
- data/spec/support/fake_api.rb +662 -662
- data/spec/support/fake_github.rb +6 -3
- data/spec/support/helpers.rb +13 -8
- data/spec/travis_spec.rb +5 -3
- data/travis.gemspec +400 -399
- metadata +30 -50
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
require 'shellwords'
|
3
5
|
|
@@ -5,7 +7,7 @@ module Travis
|
|
5
7
|
module CLI
|
6
8
|
class Setup
|
7
9
|
class CodeDeploy < Service
|
8
|
-
description
|
10
|
+
description 'triggering a new deployment on Amazon CodeDeploy'
|
9
11
|
AWS_CONFIG = File.expand_path('.aws/config', ENV['HOME'])
|
10
12
|
|
11
13
|
def run
|
@@ -16,38 +18,40 @@ module Travis
|
|
16
18
|
end
|
17
19
|
|
18
20
|
deploy 'codedeploy' do |config|
|
19
|
-
config['access_key_id'] = ask(
|
21
|
+
config['access_key_id'] = ask('Access key ID: ') { |q| q.default = access_key if access_key }.to_s
|
20
22
|
secret_access_key = nil unless access_key == config['access_key_id']
|
21
|
-
config['secret_access_key'] = secret_access_key || ask(
|
22
|
-
config['bucket'] = ask(
|
23
|
-
config['key'] = ask(
|
24
|
-
config['bundle_type'] = ask(
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
config['secret_access_key'] = secret_access_key || ask('Secret access key: ') { |q| q.echo = '*' }.to_s
|
24
|
+
config['bucket'] = ask('S3 Bucket: ').to_s
|
25
|
+
config['key'] = ask('S3 Key: ').to_s
|
26
|
+
config['bundle_type'] = ask('Bundle Type: ') do |q|
|
27
|
+
q.default = config['key'][/\.(zip|tar|tgz)$/, 1]
|
28
|
+
end.to_s
|
29
|
+
config['application'] = ask('Application Name: ') { |q| q.default = repository.name }.to_s
|
30
|
+
config['deployment_group'] = ask('Deployment Group Name: ').to_s
|
31
|
+
encrypt(config, 'secret_access_key') if agree('Encrypt secret access key? ') { |q| q.default = 'yes' }
|
28
32
|
end
|
29
33
|
|
30
|
-
|
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
|
-
}
|
34
|
+
return unless agree('Also push bundle to S3? ')
|
41
35
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
]
|
50
|
-
|
36
|
+
cd = travis_config['deploy']
|
37
|
+
s3 = {
|
38
|
+
'provider' => 's3',
|
39
|
+
'access_key_id' => cd['access_key_id'],
|
40
|
+
'secret_access_key' => cd['secret_access_key'],
|
41
|
+
'local_dir' => 'dpl_cd_upload',
|
42
|
+
'skip_cleanup' => true,
|
43
|
+
'on' => cd['on'],
|
44
|
+
'bucket' => cd['bucket']
|
45
|
+
}
|
46
|
+
|
47
|
+
s3['upload_dir'] = File.dirname(cd['key']) if cd['key'].include? '/'
|
48
|
+
travis_config['deploy'] = [s3, cd]
|
49
|
+
upload_file_name = File.basename(cd['key'])
|
50
|
+
source_file = ask('Source File: ') { |q| q.default = upload_file_name }
|
51
|
+
travis_config['before_deploy'] = [
|
52
|
+
'mkdir -p dpl_cd_upload',
|
53
|
+
"mv #{Shellwords.escape(source_file)} dpl_cd_upload/#{Shellwords.escape(upload_file_name)}"
|
54
|
+
]
|
51
55
|
end
|
52
56
|
end
|
53
57
|
end
|
@@ -1,20 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class Deis < Service
|
7
|
-
description
|
9
|
+
description 'automatic deployment to a deis app'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'deis' do |config|
|
11
|
-
config['controller'] ||= ask(
|
12
|
-
config['app'] ||= ask(
|
13
|
-
config['username'] ||= ask(
|
14
|
-
config['password'] ||= ask(
|
13
|
+
config['controller'] ||= ask('Deis Controller: ').to_s
|
14
|
+
config['app'] ||= ask('Deis App: ').to_s
|
15
|
+
config['username'] ||= ask('Deis Username: ').to_s
|
16
|
+
config['password'] ||= ask('Deis Password: ') { |q| q.echo = '*' }.to_s
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
20
|
-
end
|
22
|
+
end
|
@@ -1,18 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'travis/cli/setup'
|
4
|
+
|
5
|
+
module Travis
|
6
|
+
module CLI
|
7
|
+
class Setup
|
8
|
+
class Divshot < Service
|
9
|
+
description 'deployment to Divshot.io'
|
10
|
+
|
11
|
+
def run
|
12
|
+
deploy 'divshot' do |config|
|
13
|
+
config['api_key'] = ask('Divshot Api Key: ') { |q| q.echo = '*' }.to_s
|
14
|
+
config['environment'] = ask('Divshot Environment: ').to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,21 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class ElasticBeanstalk < Service
|
7
|
-
description
|
9
|
+
description 'deployment to AWS Elastic Beanstalk'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'elasticbeanstalk' do |config|
|
11
|
-
config['access_key_id'] = ask(
|
12
|
-
config['secret_access_key'] = ask(
|
13
|
-
config['region'] = ask(
|
14
|
-
config['app'] = ask(
|
15
|
-
config['env'] = ask(
|
16
|
-
config['bucket_name'] = ask(
|
13
|
+
config['access_key_id'] = ask('Access key ID: ').to_s
|
14
|
+
config['secret_access_key'] = ask('Secret access key: ') { |q| q.echo = '*' }.to_s
|
15
|
+
config['region'] = ask('Elastic Beanstalk region: ') { |q| q.default = 'us-east-1' }.to_s
|
16
|
+
config['app'] = ask('Elastic Beanstalk application name: ').to_s
|
17
|
+
config['env'] = ask('Elastic Beanstalk environment to update: ').to_s
|
18
|
+
config['bucket_name'] = ask('Bucket name to upload app to: ').to_s
|
17
19
|
|
18
|
-
encrypt(config, 'secret_access_key') if agree(
|
20
|
+
encrypt(config, 'secret_access_key') if agree('Encrypt secret access key? ') { |q| q.default = 'yes' }
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
require 'yaml'
|
3
5
|
|
@@ -5,17 +7,17 @@ module Travis
|
|
5
7
|
module CLI
|
6
8
|
class Setup
|
7
9
|
class EngineYard < Service
|
8
|
-
description
|
10
|
+
description 'automatic deployment to Engine Yard'
|
9
11
|
|
10
12
|
def run
|
11
13
|
deploy 'engineyard' do |config|
|
12
|
-
eyrc = File.expand_path(
|
13
|
-
config['api_key'] = YAML.load_file(eyrc)[
|
14
|
-
config['api_key'] = ask(
|
15
|
-
env = ask(
|
14
|
+
eyrc = File.expand_path('.eyrc', Dir.home)
|
15
|
+
config['api_key'] = YAML.load_file(eyrc)['api_token'] if File.exist?(eyrc)
|
16
|
+
config['api_key'] = ask('API token: ') { |q| q.echo = '*' }.to_s unless config['api_key']
|
17
|
+
env = ask('Environment (optional): ').to_s
|
16
18
|
config['environment'] = env unless env.empty?
|
17
|
-
migrate = agree(
|
18
|
-
config['migrate'] = ask(
|
19
|
+
migrate = agree('Run migrations on deploy? ') { |q| q.default = 'yes' }
|
20
|
+
config['migrate'] = ask('Migration command: ') { |q| q.default = 'rake db:migrate' } if migrate
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
data/lib/travis/cli/setup/gcs.rb
CHANGED
@@ -1,22 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class GCS < Service
|
7
|
-
description
|
9
|
+
description 'automatic pushing to Google Cloud Storage'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'gcs' do |config|
|
11
|
-
config['access_key_id'] = ask(
|
12
|
-
config['secret_access_key'] = ask(
|
13
|
-
config['bucket'] = ask(
|
14
|
-
local_dir = ask(
|
13
|
+
config['access_key_id'] = ask('Access key ID: ').to_s
|
14
|
+
config['secret_access_key'] = ask('Secret access key: ') { |q| q.echo = '*' }.to_s
|
15
|
+
config['bucket'] = ask('Bucket: ').to_s
|
16
|
+
local_dir = ask('Local project directory to upload (Optional): ').to_s
|
15
17
|
config['local-dir'] = local_dir unless local_dir.empty?
|
16
|
-
encrypt(config, 'secret_access_key') if agree(
|
18
|
+
encrypt(config, 'secret_access_key') if agree('Encrypt secret access key? ') { |q| q.default = 'yes' }
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
22
|
-
end
|
24
|
+
end
|
@@ -1,18 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class Hackage < Service
|
7
|
-
description
|
9
|
+
description 'automatic deployment of hackage packages'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'hackage' do |config|
|
11
|
-
config['username'] ||= ask(
|
12
|
-
config['password'] ||= ask(
|
13
|
+
config['username'] ||= ask('Hackage Username: ').to_s
|
14
|
+
config['password'] ||= ask('Hackage Password: ') { |q| q.echo = '*' }.to_s
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
18
|
-
end
|
20
|
+
end
|
@@ -1,20 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class Heroku < Service
|
7
|
-
description
|
9
|
+
description 'automatic deployment to Heroku'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'heroku' do |config|
|
11
13
|
config['api_key'] = `heroku auth:token 2>/dev/null`.strip
|
12
|
-
config['api_key'] = ask(
|
14
|
+
config['api_key'] = ask('Heroku API token: ') { |q| q.echo = '*' }.to_s if config['api_key'].empty?
|
13
15
|
config['app'] = `heroku apps:info 2>/dev/null`.scan(/^=== (.+)$/).flatten.first
|
14
|
-
|
16
|
+
if config['app'].nil?
|
17
|
+
config['app'] = ask('Heroku application name: ') do |q|
|
18
|
+
q.default = repository.name
|
19
|
+
end.to_s
|
20
|
+
end
|
15
21
|
end
|
16
22
|
end
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|
20
|
-
end
|
26
|
+
end
|
@@ -1,15 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class Modulus < Service
|
7
|
-
description
|
9
|
+
description 'deployment to Modulus'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'modulus' do |config|
|
11
|
-
config['api_key'] = ask(
|
12
|
-
config['project_name'] = ask(
|
13
|
+
config['api_key'] = ask('Modulus Api Key: ') { |q| q.echo = '*' }.to_s
|
14
|
+
config['project_name'] = ask('Modulus Project Name: ').to_s
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -1,20 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class Ninefold < Service
|
7
|
-
description
|
9
|
+
description 'Automatic deployment to Ninefold'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'ninefold', 'release' do |config|
|
11
|
-
config['app_id'] ||= ask(
|
12
|
-
config['auth_token'] ||= ask(
|
13
|
+
config['app_id'] ||= ask('Ninefold App ID: ').to_s
|
14
|
+
config['auth_token'] ||= ask('Ninefold Auth Token: ') { |q| q.echo = '*' }.to_s
|
13
15
|
|
14
|
-
encrypt(config, 'auth_token') if agree(
|
16
|
+
encrypt(config, 'auth_token') if agree('Encrypt Auth Token? ') { |q| q.default = 'yes' }
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
20
|
-
end
|
22
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
require 'json'
|
3
5
|
|
@@ -5,7 +7,7 @@ module Travis
|
|
5
7
|
module CLI
|
6
8
|
class Setup
|
7
9
|
class Nodejitsu < Service
|
8
|
-
description
|
10
|
+
description 'automatic deployment to Nodejitsu'
|
9
11
|
|
10
12
|
def run
|
11
13
|
deploy 'nodejitsu' do |config|
|
@@ -17,11 +19,11 @@ module Travis
|
|
17
19
|
config['api_key'] = jitsu_conf['apiToken']
|
18
20
|
end
|
19
21
|
|
20
|
-
config['user'] ||= ask(
|
21
|
-
config['api_key'] ||= ask(
|
22
|
+
config['user'] ||= ask('Nodejitsu user: ').to_s
|
23
|
+
config['api_key'] ||= ask('Nodejitsu API token: ') { |q| q.echo = '*' }.to_s
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
27
|
-
end
|
29
|
+
end
|
data/lib/travis/cli/setup/npm.rb
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class NPM < Service
|
7
|
-
description
|
9
|
+
description 'automatic release to npm'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'npm', 'release' do |config|
|
11
|
-
config['email'] ||= ask(
|
12
|
-
config['api_key'] ||= ask(
|
13
|
+
config['email'] ||= ask('npm email address: ') { |q| q }.to_s
|
14
|
+
config['api_key'] ||= ask('npm api key: ') { |q| q.echo = '*' }.to_s
|
13
15
|
|
14
|
-
on(
|
16
|
+
on('release only tagged commits? ', config, 'tags' => true)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -1,20 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class OpenShift < Service
|
7
|
-
description
|
9
|
+
description 'automatic deployment to OpenShfit'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'openshift' do |config|
|
11
|
-
config['user'] = ask(
|
12
|
-
config['password'] = ask(
|
13
|
-
config['app'] = ask(
|
14
|
-
config['domain'] = ask(
|
13
|
+
config['user'] = ask('OpenShift user: ').to_s
|
14
|
+
config['password'] = ask('OpenShift password: ') { |q| q.echo = '*' }.to_s
|
15
|
+
config['app'] = ask('OpenShift application name: ') { |q| q.default = repository.name }.to_s
|
16
|
+
config['domain'] = ask('OpenShift domain: ').to_s
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
20
|
-
end
|
22
|
+
end
|
@@ -1,22 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
config['
|
14
|
-
config['
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'travis/cli/setup'
|
4
|
+
|
5
|
+
module Travis
|
6
|
+
module CLI
|
7
|
+
class Setup
|
8
|
+
class OpsWorks < Service
|
9
|
+
description 'deployment to OpsWorks'
|
10
|
+
|
11
|
+
def run
|
12
|
+
deploy 'opsworks' do |config|
|
13
|
+
config['access_key_id'] = ask('Access key ID: ').to_s
|
14
|
+
config['secret_access_key'] = ask('Secret access key: ') { |q| q.echo = '*' }.to_s
|
15
|
+
config['app-id'] = ask('App ID: ').to_s
|
16
|
+
config['migrate'] = true if agree('Migrate the Database? ') { |q| q.default = 'no' }
|
17
|
+
|
18
|
+
encrypt(config, 'secret_access_key') if agree('Encrypt secret access key? ') { |q| q.default = 'yes' }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,19 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class PyPI < Service
|
7
|
-
description
|
9
|
+
description 'automatic deployment to PyPI'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'pypi', 'release' do |config|
|
11
|
-
config['user'] ||= ask(
|
12
|
-
config['password'] ||= ask(
|
13
|
+
config['user'] ||= ask('Username: ').to_s
|
14
|
+
config['password'] ||= ask('Password: ') { |q| q.echo = '*' }.to_s
|
13
15
|
|
14
|
-
on(
|
16
|
+
on('release only tagged commits? ', config, 'tags' => true)
|
15
17
|
# the default of pypi `setup.py build` is the `sdist`
|
16
|
-
on(
|
18
|
+
on('deploy as wheel file too? ', config, 'distributions' => 'sdist bdist_wheel')
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
require 'travis/tools/github'
|
3
5
|
|
@@ -5,16 +7,14 @@ module Travis
|
|
5
7
|
module CLI
|
6
8
|
class Setup
|
7
9
|
class Releases < Service
|
8
|
-
description
|
10
|
+
description 'Upload Assets to GitHub Releases'
|
9
11
|
|
10
12
|
def run
|
11
13
|
deploy 'releases' do |config|
|
12
14
|
github.with_token { |t| config['api_key'] = t }
|
13
|
-
if config['api_key'].nil?
|
14
|
-
raise Travis::Client::GitHubLoginFailed, 'all GitHub tokens given were invalid'
|
15
|
-
end
|
15
|
+
raise Travis::Client::GitHubLoginFailed, 'all GitHub tokens given were invalid' if config['api_key'].nil?
|
16
16
|
|
17
|
-
config['file'] = ask(
|
17
|
+
config['file'] = ask('File to Upload: ').to_s
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -25,7 +25,7 @@ module Travis
|
|
25
25
|
g.drop_token = false
|
26
26
|
g.github_token = github_token
|
27
27
|
g.debug = proc { |log| debug(log) }
|
28
|
-
g.after_tokens = proc { g.explode = true and error(
|
28
|
+
g.after_tokens = proc { g.explode = true and error('no suitable github token found') }
|
29
29
|
g.scopes = org? ? ['public_repo'] : ['repo']
|
30
30
|
g.note = "automatic releases for #{repository.slug}"
|
31
31
|
end
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class RubyGems < Service
|
7
|
-
description
|
9
|
+
description 'automatic release to RubyGems'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 'rubygems', 'release' do |config|
|
@@ -13,13 +15,13 @@ module Travis
|
|
13
15
|
|
14
16
|
config['api_key'] ||= File.read(authorization_file) if File.exist? authorization_file
|
15
17
|
config['api_key'] ||= YAML.load_file(credentials_file)[:rubygems_api_key] if File.exist? credentials_file
|
16
|
-
config['api_key'] ||= ask(
|
17
|
-
config['gem'] ||= ask(
|
18
|
+
config['api_key'] ||= ask('RubyGems API token: ') { |q| q.echo = '*' }.to_s
|
19
|
+
config['gem'] ||= ask('Gem name: ') { |q| q.default = repository.name }.to_s
|
18
20
|
|
19
|
-
on(
|
21
|
+
on('Release only tagged commits? ', config, 'tags' => true)
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
25
|
-
end
|
27
|
+
end
|
data/lib/travis/cli/setup/s3.rb
CHANGED
@@ -1,22 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'travis/cli/setup'
|
2
4
|
|
3
5
|
module Travis
|
4
6
|
module CLI
|
5
7
|
class Setup
|
6
8
|
class S3 < Service
|
7
|
-
description
|
9
|
+
description 'automatic pushing to S3'
|
8
10
|
|
9
11
|
def run
|
10
12
|
deploy 's3', 'push' do |config|
|
11
|
-
config['access_key_id'] = ask(
|
12
|
-
config['secret_access_key'] = ask(
|
13
|
-
config['bucket'] = ask(
|
14
|
-
local_dir = ask(
|
13
|
+
config['access_key_id'] = ask('Access key ID: ').to_s
|
14
|
+
config['secret_access_key'] = ask('Secret access key: ') { |q| q.echo = '*' }.to_s
|
15
|
+
config['bucket'] = ask('Bucket: ').to_s
|
16
|
+
local_dir = ask('Local project directory to upload (Optional): ').to_s
|
15
17
|
config['local-dir'] = local_dir unless local_dir.empty?
|
16
|
-
upload_dir = ask(
|
18
|
+
upload_dir = ask('S3 upload directory (Optional): ').to_s
|
17
19
|
config['upload-dir'] = upload_dir unless upload_dir.empty?
|
18
|
-
config['acl'] = ask(
|
19
|
-
|
20
|
+
config['acl'] = ask('S3 ACL Settings (private, public_read, public_read_write, authenticated_read, bucket_owner_read, bucket_owner_full_control): ').to_s do |q|
|
21
|
+
q.default = 'private'
|
22
|
+
end
|
23
|
+
encrypt(config, 'secret_access_key') if agree('Encrypt secret access key? ') { |q| q.default = 'yes' }
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|