-
Notifications
You must be signed in to change notification settings - Fork 7
Add global-services to service command #5
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 global-services to service command #5
Conversation
src/Service_Command.php
Outdated
| * Boots up the container if it is stopped or not running. | ||
| * @throws \EE\ExitException | ||
| */ | ||
| public static function nginx_proxy_check() { |
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.
I think it would be more appropriate to move it onto a seperate util file like service-utils.php(To maintain consistency with other packages where functions which can be invoked by other packages are moved to a util file)
src/Service_Command.php
Outdated
| * | ||
| * @param Filesystem $fs Filesystem object to write file | ||
| */ | ||
| public static function generate_global_docker_compose_yml( Filesystem $fs ) { |
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.
Since this function is also invoked by above function, it should also be moved to util file
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
src/helper/service-utills.php
Outdated
| ], | ||
| ], | ||
| [ | ||
| 'name' => 'elasticsearch', |
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.
Remove Elasticsearch
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
src/helper/service-utils.php
Outdated
| } | ||
|
|
||
| $EE_CONF_ROOT = EE_CONF_ROOT; | ||
| if ( ! EE::docker()::docker_network_exists( GLOBAL_BACKEND_NETWORK ) ) { |
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.
Why did you use two if conditions one after another instead of just using && ?
if (
! EE::docker()::docker_network_exists( GLOBAL_BACKEND_NETWORK ) &&
! EE::docker()::create_network( GLOBAL_BACKEND_NETWORK )
) {
src/helper/service-utils.php
Outdated
| EE::error( 'Unable to create network ' . GLOBAL_BACKEND_NETWORK ); | ||
| } | ||
| } | ||
| if ( ! EE::docker()::docker_network_exists( GLOBAL_FRONTEND_NETWORK ) ) { |
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.
Same two if condition instead of just &&.
src/helper/service-utils.php
Outdated
| $container = 'ee-' . $service; | ||
| } | ||
| if ( ! EE::docker()::docker_network_exists( GLOBAL_BACKEND_NETWORK ) ) { | ||
| if ( ! EE::docker()::create_network( GLOBAL_BACKEND_NETWORK ) ) { |
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.
Same.. two if condition instead of just &&.
mbtamuli
left a comment
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.
Docker and config related changes look good to me.
Issue reference: EasyEngine/easyengine#1228