Adds nginx test on container restart and makes use of EE_DOCKER methods#315
Closed
geekodour wants to merge 1 commit intoEasyEngine:developfrom
geekodour:use-ee-dc-commands
Closed
Adds nginx test on container restart and makes use of EE_DOCKER methods#315geekodour wants to merge 1 commit intoEasyEngine:developfrom geekodour:use-ee-dc-commands
geekodour wants to merge 1 commit intoEasyEngine:developfrom
geekodour:use-ee-dc-commands
Conversation
* removed `run_compose_command` and replaced the required with methods added in EasyEngine/easyengine#1428 * also closes https://github.com/rtCamp/sys/issues/96 by adding nginx test before container restart Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
mrrobot47
requested changes
Jul 15, 2019
| if ( in_array( 'nginx', $containers ) ) { | ||
| $nginx_test_command = "sh -c 'nginx -t'"; | ||
| if ( ! \EE_DOCKER::docker_compose_exec( $this->site_data['site_fs_path'], 'nginx', $nginx_test_command ) ) { | ||
| throw new \Exception( 'There was some error in docker-compose exec.' ); |
Member
There was a problem hiding this comment.
A better error message on failure would be: Nginx configuration test failed. Please check the site's nginx config.
There was some error in docker-compose exec is a very generic message and does not convey anything helpful to the end user using EasyEngine.
| $this->reload_services( $whitelisted_containers, $reload_commands ); | ||
| foreach ( $whitelisted_containers as $container ) { | ||
| if ( ! \EE_DOCKER::docker_compose_exec( $this->site_data['site_fs_path'], $container, $reload_commands[ $container ] ) ) { | ||
| throw new \Exception( 'There was some error in docker-compose exec.' ); |
Member
There was a problem hiding this comment.
Again something useful can be added here like: Reloading service for $container failed.
| EE::exec( "docker-compose $action $container", true, true ); | ||
| $stopped = \EE_DOCKER::docker_compose_stop( $site_fs_path, $all_containers ); | ||
| $forcermd = \EE_DOCKER::docker_compose_forcerm( $site_fs_path, $all_containers ); | ||
| if ( ! (stopped && forcermd) ) { |
Member
There was a problem hiding this comment.
Missing $ in variable names. Also, fix phpcs issues.
Contributor
|
Closing this PR as there are multiple issues and has been left unresolved > 1 year |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run_compose_commandand replaced the required with methods added in Added few functions related to docker-compose to avoid some hard-coded EE::exec calls easyengine#1428this PR is tightly related to the changes made in EasyEngine/easyengine#1428
Signed-off-by: Hrishikesh Barman hrishikeshbman@gmail.com