Skip to content

Commit

Permalink
Merge branch 'main' into ft-61
Browse files Browse the repository at this point in the history
  • Loading branch information
joel5vega authored Jan 24, 2024
2 parents 1f4eeb5 + 40dace1 commit 526e04d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sugar/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def _call_compose_app(
def _check_config_file(self):
return Path(self.config_file).exists()


# Check if services item is given
def _check_services_item(self):
return bool(self.config.get('services'))
Expand All @@ -141,6 +142,7 @@ def _set_default_group(self):
self.config_group = self.config['groups']['main']
del self.config['services']


def _filter_service_group(self):
groups = self.config['groups']

Expand Down Expand Up @@ -192,6 +194,7 @@ def _load_config(self):
f_content = io.StringIO(content)
self.config = yaml.safe_load(f_content)


# check if either services or groups are present
if not (self.config.get('services') or self.config.get('groups')):
KxgrLogs.raise_error(
Expand All @@ -209,6 +212,7 @@ def _load_config(self):

self._filter_service_group()


def _load_compose_app(self):
compose_cmd = self.config.get('compose-app', '')
if compose_cmd.replace(' ', '-') != 'docker-compose':
Expand All @@ -224,6 +228,10 @@ def _load_compose_app(self):
self.compose_args.append('compose')

def _load_compose_args(self):

self._filter_service_group()


if 'env-file' in self.service_group:
self.compose_args.extend(
['--env-file', self.service_group['env-file']]
Expand Down

0 comments on commit 526e04d

Please sign in to comment.