Class: SafeDb::Docker

Inherits:
QueryVerse show all
Defined in:
lib/controller/api/docker/docker.rb

Overview

This docker use case handles the …

safe docker 
safe docker logout

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from QueryVerse

#execute

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_verseObject



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 --username #{docker_username} --password #{docker_password} 2>/dev/null"
    docker_logout_cmd = "docker logout"
    docker_cmd = @command.eql?( "logout" ) ? docker_logout_cmd : 
    system docker_cmd

end