Class: Fastlane::Actions::DockerClient
- Inherits:
-
Object
- Object
- Fastlane::Actions::DockerClient
- Defined in:
- lib/fastlane/plugin/docker/actions/docker_client.rb
Instance Method Summary collapse
- #build(repository, path, tag: "latest") ⇒ Object
- #login(username, password, email: nil) ⇒ Object
- #push(repository, tag: nil) ⇒ Object
Instance Method Details
#build(repository, path, tag: "latest") ⇒ Object
4 5 6 7 8 9 |
# File 'lib/fastlane/plugin/docker/actions/docker_client.rb', line 4 def build(repository, path, tag: "latest") result = Actions.sh "docker build --pull -t #{repository.shellescape}:#{tag.shellescape} #{path.shellescape}" # Image ID is the last word of the last line return result.lines.last.split(" ").last end |
#login(username, password, email: nil) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/fastlane/plugin/docker/actions/docker_client.rb', line 11 def login(username, password, email: nil) cmd = "docker login --username=\"#{username}\" --password=\"#{password}\"" cmd << "--email=\"#{email}\"" unless email.nil? Actions.sh cmd end |
#push(repository, tag: nil) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/fastlane/plugin/docker/actions/docker_client.rb', line 18 def push(repository, tag: nil) cmd = "docker push #{repository}" cmd << ":#{tag}" unless tag.nil? Actions.sh cmd end |