Skip to content

Commit

Permalink
Merge pull request #66 from uptick/bugfix/fix-issue-#64
Browse files Browse the repository at this point in the history
Fix issue #64
  • Loading branch information
mdesouky authored Dec 11, 2023
2 parents fc76338 + 3d01233 commit b7bde5d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/gitops/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.0"
description: GitOps Server Helm chart.
name: gitops
version: 0.9.21
version: 0.9.22
2 changes: 1 addition & 1 deletion gitops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from . import monkeypatches # NOQA
from .utils.cli import success, warning

__version__ = "0.9.21"
__version__ = "0.9.22"


# Checking gitops version matches cluster repo version.
Expand Down
9 changes: 9 additions & 0 deletions gitops/utils/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from pathlib import PosixPath
from typing import List, Union

from colorama import Fore
Expand All @@ -15,6 +16,12 @@
from .tags import colour_tags, validate_tags


def is_valid_app_directory(directory: PosixPath) -> bool:
files = ["deployment.yml", "secrets.yml"]
file_paths = [(directory / file).is_file() for file in files]
return all(file_paths)


def get_app_details(app_name: str, load_secrets: bool = True) -> App:
account_id = get_account_id() if load_secrets else "UNKNOWN"
try:
Expand Down Expand Up @@ -89,6 +96,8 @@ def get_apps(
for entry in directory:
if not entry.is_dir():
continue
elif not is_valid_app_directory(entry):
continue
app = get_app_details(entry.name, load_secrets=load_secrets)

pseudotags = [app.name, app.cluster]
Expand Down
1 change: 0 additions & 1 deletion gitops_server/workers/deployer/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ async def handle_successful_deploy(
async def handle_failed_deploy(app: App, result: UpdateAppResult, deployer) -> UpdateAppResult:
github_deployment_url = str(app.values.get("github/deployment_url", ""))
if github_deployment_url:

await github.update_deployment(
github_deployment_url,
status=github.STATUSES.failure,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gitops"
version = "0.9.21"
version = "0.9.22"
description = "Manage multiple apps across one or more k8s clusters."
authors = ["Jarek Głowacki <jarekwg@gmail.com>"]
license = "BSD"
Expand Down

0 comments on commit b7bde5d

Please sign in to comment.