Class: Stax::Docker
Instance Method Summary collapse
-
#build ⇒ Object
override this method with the desired builder.
- #exists ⇒ Object
- #image ⇒ Object
- #login ⇒ Object
- #poll ⇒ Object
- #push ⇒ Object
- #registry ⇒ Object
- #repository ⇒ Object
Instance Method Details
#build ⇒ Object
override this method with the desired builder
74 |
# File 'lib/stax/docker.rb', line 74 desc 'build', 'build docker image' |
#exists ⇒ Object
95 96 97 |
# File 'lib/stax/docker.rb', line 95 def exists puts Aws::Ecr.exists?(docker_repository, Git.sha) end |
#image ⇒ Object
69 70 71 |
# File 'lib/stax/docker.rb', line 69 def image puts docker_image end |
#login ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/stax/docker.rb', line 81 def login Aws::Ecr.auth.each do |auth| debug("Login to ECR registry #{auth.proxy_endpoint}") user, pass = Base64.decode64(auth.).split(':') system "docker login -u #{user} -p #{pass} #{auth.proxy_endpoint}" end end |
#poll ⇒ Object
100 101 102 103 |
# File 'lib/stax/docker.rb', line 100 def poll debug("Waiting for image in ECR #{docker_repository}:#{Git.sha}") sleep 10 until Aws::Ecr.exists?(docker_repository, Git.sha) end |
#push ⇒ Object
90 91 92 |
# File 'lib/stax/docker.rb', line 90 def push docker_push end |
#registry ⇒ Object
59 60 61 |
# File 'lib/stax/docker.rb', line 59 def registry puts docker_registry end |
#repository ⇒ Object
64 65 66 |
# File 'lib/stax/docker.rb', line 64 def repository puts docker_repository end |