-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hot reload dev docker #78
Conversation
cli/commands/start.rb
Outdated
end | ||
|
||
def start_backend(directory) | ||
build_backend(directory) unless backend_image_exists? | ||
execute_command(%W[docker run --rm -p 4560:4560 #{BACKEND_IMAGE_NAME} --verbose], &method(:backend_log)) | ||
end | ||
|
||
def start_dev_backend(directory) | ||
build_dev_backend(directory) unless backend_dev_image_exists? | ||
execute_command(%W[docker run --rm -p 4560:4560 -v #{directory}/backend:/go/src/github.com/orsa-scholis/orsum-inflandi-II/backend #{BACKEND_DEV_IMAGE_NAME}], &method(:backend_log)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [188/120]
cli/commands/start.rb
Outdated
|
||
def build_dev_backend(directory) | ||
backend_log('Building dev image') | ||
execute_command(%W[docker build -f #{directory}/backend/dev.Dockerfile -t #{BACKEND_DEV_IMAGE_NAME} #{directory}/backend], &method(:backend_log)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [153/120]
cli/commands/start.rb
Outdated
@@ -38,14 +40,24 @@ def execute_command(command, &block) | |||
|
|||
def build_backend(directory) | |||
backend_log('Building image') | |||
execute_command(%W[docker build -t #{BACKEND_IMAGE_NAME} #{directory}/backend], &method(:backend_log)) | |||
execute_command(%W[docker build -f #{directory}/backend/prod.Dockerfile -t #{BACKEND_IMAGE_NAME} #{directory}/backend], &method(:backend_log)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [150/120]
cli/commands/start.rb
Outdated
|
||
def initialize(options) | ||
@options = options | ||
end | ||
|
||
def run | ||
threads = [] | ||
threads << Thread.new(Dir.pwd, &method(:start_backend)) if @options[:backend] | ||
threads << Thread.new(Dir.pwd) { |directory| @options[:dev] ? start_dev_backend(directory) : start_backend(directory) } if @options[:backend] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [149/120]
Code Climate has analyzed commit 80bfe14 and detected 0 issues on this pull request. View more on Code Climate. |
closes #69