Skip to content

Commit

Permalink
Handle users with no SSH keys
Browse files Browse the repository at this point in the history
  • Loading branch information
tddium committed Feb 2, 2015
1 parent c010c90 commit e944acf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tmp
coverage

.rvmrc
.solano*
.tddium*
.tddium-deploy-key*

Expand Down
9 changes: 6 additions & 3 deletions lib/tddium/cli/commands/spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2011, 2012, 2013, 2014 Solano Labs All Rights Reserved
# Copyright (c) 2011-2015 Solano Labs All Rights Reserved
require 'digest'

module Tddium
Expand Down Expand Up @@ -27,7 +27,10 @@ def spec(*pattern)
suite_auto_configure unless options[:machine]

exit_failure unless suite_for_current_branch?
exit_failure(Text::Error::NO_SSH_KEY) if @tddium_api.get_keys.empty?

if !options[:machine] && @tddium_api.get_keys.empty? then
warn(Text::Warning::NO_SSH_KEY)
end

if @scm.changes?(options) then
exit_failure(Text::Error::SCM_CHANGES_NOT_COMMITTED) if !options[:force]
Expand Down Expand Up @@ -274,7 +277,7 @@ def read_and_encode_cache_control
cache_key_paths.reject!{|x| x =~ /(solano|tddium).yml$/}
cache_control_data = {}
cache_key_paths.each do |p|
if File.exists?(p)
if File.exists?(p) then
cache_control_data[p] = Digest::SHA1.file(p).to_s
end
end
Expand Down
7 changes: 3 additions & 4 deletions lib/tddium/constant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ module Warning
SCM_UNABLE_TO_DETECT = "Unable to detect uncommitted changes"
YAML_PARSE_FAILED = "Unable to parse %s as YAML"
TEST_CONFIGS_MUST_BE_LIST = "The test_configs section of solano.yml must be a list of configurations"
NO_SSH_KEY =<<EOF
You have not set an ssh key for your user. Please add an ssh key using `solano keys:add` or visit http://ci.solanolabs.com/user_settings/ssh_keys
EOF
end

module Process
Expand Down Expand Up @@ -493,10 +496,6 @@ module Error
EOF
CONFIG_PATHS_COLLISION =<<EOF
You have both solano.yml and tddium.yml in your repo. We don't support merging the configuration from both of these files, so you'll have to pick one. The tddium.yml file will soon be deprecated, so we recommend migrating all of your configuration to solano.yml.
EOF
NO_SSH_KEY =<<EOF
Aborting. You don't have any ssh key.
Add an ssh key first, using `tddium keys:add` or visit web-site http://ci.solanolabs.com/user_settings/ssh_keys
EOF
end
end
Expand Down

0 comments on commit e944acf

Please sign in to comment.