Class: SafeDb::Docker
- Inherits:
-
QueryVerse
- Object
- Controller
- QueryVerse
- SafeDb::Docker
- Defined in:
- lib/controller/api/docker/docker.rb
Overview
This docker use case handles the …
safe docker login
safe docker logout
Instance Attribute Summary collapse
-
#command ⇒ Object
writeonly
The command which currently must be login, logout or an empty string.
Instance Method Summary collapse
Methods inherited from QueryVerse
Methods inherited from Controller
#check_post_conditions, #check_pre_conditions, #execute, #flow, #initialize, #open_remote_backend_location, #post_validation, #pre_validation, #read_verse, #set_verse, #update_verse
Constructor Details
This class inherits a constructor from SafeDb::Controller
Instance Attribute Details
#command=(value) ⇒ Object (writeonly)
The command which currently must be login, logout or an empty string.
14 15 16 |
# File 'lib/controller/api/docker/docker.rb', line 14 def command=(value) @command = value end |
Instance Method Details
#query_verse ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/controller/api/docker/docker.rb', line 16 def query_verse() docker_username = @verse[ "docker.username" ] docker_password = @verse[ "@docker.password" ] docker_login_cmd = "docker login --username #{docker_username} --password #{docker_password} 2>/dev/null" docker_logout_cmd = "docker logout" docker_cmd = @command.eql?( "logout" ) ? docker_logout_cmd : docker_login_cmd system docker_cmd end |