Skip to content
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

Merged
merged 2 commits into from
May 6, 2019
Merged

Add hot reload dev docker #78

merged 2 commits into from
May 6, 2019

Conversation

TheFehr
Copy link
Member

@TheFehr TheFehr commented May 6, 2019

closes #69

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))
Copy link

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]


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))
Copy link

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]

@@ -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))
Copy link

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]


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]
Copy link

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]

@codeclimate
Copy link

codeclimate bot commented May 6, 2019

Code Climate has analyzed commit 80bfe14 and detected 0 issues on this pull request.

View more on Code Climate.

@TheFehr TheFehr merged commit 69cae94 into develop May 6, 2019
@TheFehr TheFehr deleted the feature/devHotReload branch May 6, 2019 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for backend development docker
1 participant