forked from cerc-io/stack-orchestrator
change imports
This commit is contained in:
parent
b686540512
commit
f8f5030976
@ -15,8 +15,8 @@
|
||||
|
||||
import os
|
||||
from abc import ABC, abstractmethod
|
||||
from app.deploy import get_stack_status
|
||||
from decouple import config
|
||||
from .deploy import get_stack_status
|
||||
|
||||
|
||||
def get_stack(config, stack):
|
||||
|
@ -27,8 +27,8 @@ import subprocess
|
||||
import click
|
||||
import importlib.resources
|
||||
from pathlib import Path
|
||||
from app.util import include_exclude_check, get_parsed_stack_config
|
||||
from app.base import get_npm_registry_url
|
||||
from .util import include_exclude_check, get_parsed_stack_config
|
||||
from .base import get_npm_registry_url
|
||||
|
||||
# TODO: find a place for this
|
||||
# epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)"
|
||||
@ -67,7 +67,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args):
|
||||
print('Dev root directory doesn\'t exist, creating')
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from app import data
|
||||
from . import data
|
||||
with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file:
|
||||
all_containers = container_list_file.read().splitlines()
|
||||
|
||||
|
@ -25,8 +25,8 @@ from decouple import config
|
||||
import click
|
||||
import importlib.resources
|
||||
from python_on_whales import docker, DockerException
|
||||
from app.base import get_stack
|
||||
from app.util import include_exclude_check, get_parsed_stack_config
|
||||
from .base import get_stack
|
||||
from .util import include_exclude_check, get_parsed_stack_config
|
||||
|
||||
builder_js_image_name = "cerc/builder-js:local"
|
||||
|
||||
@ -83,7 +83,7 @@ def command(ctx, include, exclude, force_rebuild, extra_build_args):
|
||||
os.makedirs(build_root_path)
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from app import data
|
||||
from . import data
|
||||
with importlib.resources.open_text(data, "npm-package-list.txt") as package_list_file:
|
||||
all_packages = package_list_file.read().splitlines()
|
||||
|
||||
|
16
app/cli.py
16
app/cli.py
@ -15,14 +15,14 @@
|
||||
|
||||
import click
|
||||
|
||||
from app.command_types import CommandOptions
|
||||
from app import setup_repositories
|
||||
from app import build_containers
|
||||
from app import build_npms
|
||||
from app import deploy
|
||||
from app import version
|
||||
from app import deployment
|
||||
from app import update
|
||||
from .command_types import CommandOptions
|
||||
from . import setup_repositories
|
||||
from . import build_containers
|
||||
from . import build_npms
|
||||
from . import deploy
|
||||
from . import version
|
||||
from . import deployment
|
||||
from . import update
|
||||
|
||||
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
|
||||
|
||||
|
@ -13,11 +13,11 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
||||
|
||||
from app.util import get_yaml
|
||||
from app.deploy_types import DeployCommandContext, LaconicStackSetupCommand, DeploymentContext
|
||||
from app.stack_state import State
|
||||
from app.deploy_util import VolumeMapping, run_container_command
|
||||
from app.command_types import CommandOptions
|
||||
from laconic_stack_orchestrator.util import get_yaml
|
||||
from laconic_stack_orchestrator.deploy_types import DeployCommandContext, LaconicStackSetupCommand, DeploymentContext
|
||||
from laconic_stack_orchestrator.stack_state import State
|
||||
from laconic_stack_orchestrator.deploy_util import VolumeMapping, run_container_command
|
||||
from laconic_stack_orchestrator.command_types import CommandOptions
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from shutil import copyfile, copytree
|
||||
|
@ -13,10 +13,10 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
||||
|
||||
from app.util import get_yaml
|
||||
from app.deploy_types import DeployCommandContext
|
||||
from app.stack_state import State
|
||||
from app.deploy_util import VolumeMapping, run_container_command
|
||||
from laconic_stack_orchestrator.util import get_yaml
|
||||
from laconic_stack_orchestrator.deploy_types import DeployCommandContext
|
||||
from laconic_stack_orchestrator.stack_state import State
|
||||
from laconic_stack_orchestrator.deploy_util import VolumeMapping, run_container_command
|
||||
from pathlib import Path
|
||||
|
||||
default_spec_file_content = """config:
|
||||
|
@ -26,11 +26,11 @@ import subprocess
|
||||
from python_on_whales import DockerClient, DockerException
|
||||
import click
|
||||
from pathlib import Path
|
||||
from app.util import include_exclude_check, get_parsed_stack_config, global_options2
|
||||
from app.deploy_types import ClusterContext, DeployCommandContext
|
||||
from app.deployment_create import create as deployment_create
|
||||
from app.deployment_create import init as deployment_init
|
||||
from app.deployment_create import setup as deployment_setup
|
||||
from .util import include_exclude_check, get_parsed_stack_config, global_options2
|
||||
from .deploy_types import ClusterContext, DeployCommandContext
|
||||
from .deployment_create import create as deployment_create
|
||||
from .deployment_create import init as deployment_init
|
||||
from .deployment_create import setup as deployment_setup
|
||||
|
||||
|
||||
@click.group()
|
||||
@ -263,7 +263,7 @@ def _make_cluster_context(ctx, stack, include, exclude, cluster, env_file):
|
||||
print(f"Using cluster name: {cluster}")
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from app import data
|
||||
from . import data
|
||||
with resources.open_text(data, "pod-list.txt") as pod_list_file:
|
||||
all_pods = pod_list_file.read().splitlines()
|
||||
|
||||
|
@ -17,7 +17,7 @@ from typing import List
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from python_on_whales import DockerClient
|
||||
from app.command_types import CommandOptions
|
||||
from .command_types import CommandOptions
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
import os
|
||||
from typing import List
|
||||
from app.deploy_types import DeployCommandContext, VolumeMapping
|
||||
from app.util import get_parsed_stack_config, get_yaml, get_compose_file_dir
|
||||
from .deploy_types import DeployCommandContext, VolumeMapping
|
||||
from .util import get_parsed_stack_config, get_yaml, get_compose_file_dir
|
||||
|
||||
|
||||
def _container_image_from_service(stack: str, service: str):
|
||||
|
@ -17,8 +17,8 @@ import click
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from app.deploy import up_operation, down_operation, ps_operation, port_operation
|
||||
from app.deploy import exec_operation, logs_operation, create_deploy_context
|
||||
from .deploy import up_operation, down_operation, ps_operation, port_operation
|
||||
from .deploy import exec_operation, logs_operation, create_deploy_context
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@ -20,9 +20,9 @@ from pathlib import Path
|
||||
import random
|
||||
from shutil import copyfile, copytree
|
||||
import sys
|
||||
from app.util import get_stack_file_path, get_parsed_deployment_spec, get_parsed_stack_config, global_options, get_yaml
|
||||
from app.util import get_compose_file_dir
|
||||
from app.deploy_types import DeploymentContext, LaconicStackSetupCommand
|
||||
from .util import get_stack_file_path, get_parsed_deployment_spec, get_parsed_stack_config, global_options, get_yaml
|
||||
from .util import get_compose_file_dir
|
||||
from .deploy_types import DeploymentContext, LaconicStackSetupCommand
|
||||
|
||||
|
||||
def _make_default_deployment_dir():
|
||||
|
@ -25,7 +25,7 @@ import click
|
||||
import importlib.resources
|
||||
from pathlib import Path
|
||||
import yaml
|
||||
from app.util import include_exclude_check
|
||||
from .util import include_exclude_check
|
||||
|
||||
|
||||
class GitProgress(git.RemoteProgress):
|
||||
@ -232,7 +232,7 @@ def command(ctx, include, exclude, git_ssh, check_only, pull, branches, branches
|
||||
os.makedirs(dev_root_path)
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from app import data
|
||||
from . import data
|
||||
with importlib.resources.open_text(data, "repository-list.txt") as repository_list_file:
|
||||
all_repos = repository_list_file.read().splitlines()
|
||||
|
||||
|
@ -23,7 +23,7 @@ import sys
|
||||
import stat
|
||||
import shutil
|
||||
import validators
|
||||
from app.util import get_yaml
|
||||
from .util import get_yaml
|
||||
|
||||
|
||||
def _download_url(url: str, file_path: Path):
|
||||
|
@ -23,7 +23,7 @@ def command(ctx):
|
||||
'''print tool version'''
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from app import data
|
||||
from . import data
|
||||
with importlib.resources.open_text(data, "build_tag.txt") as version_file:
|
||||
# TODO: code better version that skips comment lines
|
||||
version_string = version_file.read().splitlines()[1]
|
||||
|
Loading…
Reference in New Issue
Block a user