Class: SimpleDeployer::Config
- Inherits:
-
Object
- Object
- SimpleDeployer::Config
- Defined in:
- lib/simple_deployer/config.rb
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Returns the value of attribute access_key.
-
#aws_access_key ⇒ Object
Returns the value of attribute aws_access_key.
-
#aws_secret_key ⇒ Object
Returns the value of attribute aws_secret_key.
-
#host ⇒ Object
Returns the value of attribute host.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
Instance Method Summary collapse
- #config_file ⇒ Object
- #read ⇒ Object
- #s3 ⇒ Object
- #s3_bucket ⇒ Object
- #s3_bucket_name ⇒ Object
- #save_config ⇒ Object
Instance Attribute Details
#access_key ⇒ Object
Returns the value of attribute access_key.
3 4 5 |
# File 'lib/simple_deployer/config.rb', line 3 def access_key @access_key end |
#aws_access_key ⇒ Object
Returns the value of attribute aws_access_key.
3 4 5 |
# File 'lib/simple_deployer/config.rb', line 3 def aws_access_key @aws_access_key end |
#aws_secret_key ⇒ Object
Returns the value of attribute aws_secret_key.
3 4 5 |
# File 'lib/simple_deployer/config.rb', line 3 def aws_secret_key @aws_secret_key end |
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/simple_deployer/config.rb', line 3 def host @host end |
#project_id ⇒ Object
Returns the value of attribute project_id.
3 4 5 |
# File 'lib/simple_deployer/config.rb', line 3 def project_id @project_id end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
3 4 5 |
# File 'lib/simple_deployer/config.rb', line 3 def secret_key @secret_key end |
Instance Method Details
#config_file ⇒ Object
38 39 40 |
# File 'lib/simple_deployer/config.rb', line 38 def config_file Dir.pwd + "/.sd/config.yaml" end |
#read ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/simple_deployer/config.rb', line 11 def read credentials = read_from_file if credentials parse(credentials) else credentials = read_from_cli write_to_file(credentials) parse(credentials) end end |
#s3 ⇒ Object
28 29 30 |
# File 'lib/simple_deployer/config.rb', line 28 def s3 Aws::S3.new(aws_access_key, aws_secret_key, {:connection_mode => :per_request}) end |
#s3_bucket ⇒ Object
23 24 25 |
# File 'lib/simple_deployer/config.rb', line 23 def s3_bucket return s3.bucket(s3_bucket_name, true) end |
#s3_bucket_name ⇒ Object
33 34 35 |
# File 'lib/simple_deployer/config.rb', line 33 def s3_bucket_name 'sd_store' end |
#save_config ⇒ Object
43 44 45 |
# File 'lib/simple_deployer/config.rb', line 43 def save_config write_to_file({"access_key"=>self.access_key, "secret_key"=>self.secret_key, "aws_access_key"=>self.aws_access_key, "aws_secret_key"=>self.aws_secret_key, "project_id"=>self.project_id}) end |