Skip to content

Added backend docker configs#168

Open
tk-hamaguchi wants to merge 2 commits intoitamae-kitchen:masterfrom
tk-hamaguchi:add_backend_docker_configs
Open

Added backend docker configs#168
tk-hamaguchi wants to merge 2 commits intoitamae-kitchen:masterfrom
tk-hamaguchi:add_backend_docker_configs

Conversation

@tk-hamaguchi
Copy link

  • Added tty: true to execute commands with docker.
  • Modified log format with docker results.
require 'docker'
require 'itamae'

@backend = Itamae::Backend.create(:docker, image: 'centos:7')
# => TypeError: no implicit conversion of Array into String
# Because Docker.logger.debug call with Array in  Docker::Connection#log_request.
# And set Itamae.logger to ::Docker.logger at Itamae::Backend::Docker#create_specinfra_backend.

@backend.run_command('yum install -y sudo')
@backend.run_command('sudo -H -u root -- /bin/sh -c cd /tmp/ && ls -l')
# => sudo: sorry, you must have a tty to run sudo
# Because Specinfra::Backend::Docker#run_command was not call with { tty: true}.

@tk-hamaguchi
Copy link
Author

I apologize for my poor English.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer raise

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll fix the code later.

* Modified log format with docker results.
@tk-hamaguchi tk-hamaguchi force-pushed the add_backend_docker_configs branch from a320c23 to 6591d75 Compare October 21, 2015 14:04
@ryotarai
Copy link
Member

@tk-hamaguchi Sorry for very late reply... Would you rebase the branch?

@umisora
Copy link
Contributor

umisora commented Nov 15, 2016

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants