Skip to content

Commit

Permalink
renamed test/integration + test/unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannis-Mittenzwei committed Oct 18, 2024
1 parent 6dbd767 commit 2cba8c8
Show file tree
Hide file tree
Showing 75 changed files with 1,935 additions and 1,015 deletions.
14 changes: 7 additions & 7 deletions exasol_script_languages_container_ci_setup/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from exasol_script_languages_container_ci_setup.cli.commands import (
health,
generate_buildspec,
generate_release_buildspec,
deploy_source_credentials,
deploy_ci_build,
deploy_release_build,
deploy_source_credentials,
generate_buildspec,
generate_release_buildspec,
health,
start_ci_build,
start_release_build,
start_test_release_build,
validate_ci_build,
validate_release_build,
validate_source_credentials,
start_release_build,
start_test_release_build,
start_ci_build
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,38 @@

from exasol_script_languages_container_ci_setup.cli.cli import cli
from exasol_script_languages_container_ci_setup.cli.common import add_options
from exasol_script_languages_container_ci_setup.cli.options.logging import logging_options, set_log_level
from exasol_script_languages_container_ci_setup.cli.options.aws_options import (
aws_options,
)
from exasol_script_languages_container_ci_setup.cli.options.logging import (
logging_options,
set_log_level,
)
from exasol_script_languages_container_ci_setup.lib.aws.aws_access import AwsAccess
from exasol_script_languages_container_ci_setup.lib.ci_build import run_deploy_ci_build
from exasol_script_languages_container_ci_setup.cli.options.aws_options import aws_options


@cli.command()
@add_options(aws_options)
@add_options(logging_options)
@click.option('--project', type=str, required=True,
help="""The project for which the stack will be created.""")
@click.option('--project-url', type=str, required=True,
help="""The URL of the project on Github.""")
@click.option(
"--project",
type=str,
required=True,
help="""The project for which the stack will be created.""",
)
@click.option(
"--project-url",
type=str,
required=True,
help="""The URL of the project on Github.""",
)
def deploy_ci_build(
aws_profile: Optional[str],
log_level: str,
project: str,
project_url: str):
aws_profile: Optional[str], log_level: str, project: str, project_url: str
):
set_log_level(log_level)
try:
run_deploy_ci_build(AwsAccess(aws_profile), project,
project_url)
run_deploy_ci_build(AwsAccess(aws_profile), project, project_url)
except Exception:
logging.error("run_deploy_ci_build failed.")
sys.exit(1)
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,37 @@

from exasol_script_languages_container_ci_setup.cli.cli import cli
from exasol_script_languages_container_ci_setup.cli.common import add_options
from exasol_script_languages_container_ci_setup.cli.options.logging import logging_options, set_log_level
from exasol_script_languages_container_ci_setup.cli.options.aws_options import (
aws_options,
)
from exasol_script_languages_container_ci_setup.cli.options.logging import (
logging_options,
set_log_level,
)
from exasol_script_languages_container_ci_setup.lib.aws.aws_access import AwsAccess
from exasol_script_languages_container_ci_setup.cli.options.aws_options import aws_options
from exasol_script_languages_container_ci_setup.lib.release_build import run_deploy_release_build
from exasol_script_languages_container_ci_setup.lib.release_build import (
run_deploy_release_build,
)


@cli.command()
@add_options(aws_options)
@add_options(logging_options)
@click.option('--project', type=str, required=True,
help="""The project for which the stack will be created.""")
@click.option('--project-url', type=str, required=True,
help="""The URL of the project on Github.""")
@click.option(
"--project",
type=str,
required=True,
help="""The project for which the stack will be created.""",
)
@click.option(
"--project-url",
type=str,
required=True,
help="""The URL of the project on Github.""",
)
def deploy_release_build(
aws_profile: Optional[str],
log_level: str,
project: str,
project_url: str):
aws_profile: Optional[str], log_level: str, project: str, project_url: str
):
set_log_level(log_level)
try:
run_deploy_release_build(AwsAccess(aws_profile), project, project_url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,52 @@

from exasol_script_languages_container_ci_setup.cli.cli import cli
from exasol_script_languages_container_ci_setup.cli.common import add_options
from exasol_script_languages_container_ci_setup.cli.options.logging import logging_options, set_log_level
from exasol_script_languages_container_ci_setup.cli.options.aws_options import (
aws_options,
)
from exasol_script_languages_container_ci_setup.cli.options.logging import (
logging_options,
set_log_level,
)
from exasol_script_languages_container_ci_setup.lib.aws.aws_access import AwsAccess
from exasol_script_languages_container_ci_setup.lib.source_credentials import run_deploy_source_credentials
from exasol_script_languages_container_ci_setup.cli.options.aws_options import aws_options
from exasol_script_languages_container_ci_setup.lib.source_credentials import (
run_deploy_source_credentials,
)


@cli.command()
@add_options(aws_options)
@add_options(logging_options)
@click.option('--secret-name', required=True, type=str,
help="Secret stored in AWS Secret Manager.")
@click.option('--secret-user-key', required=True, type=str,
help="User key stored as secret in AWS Secret Manager.")
@click.option('--secret-token-key', required=True, type=str,
help="Token key stored as secret in AWS Secret Manager.")
@click.option(
"--secret-name",
required=True,
type=str,
help="Secret stored in AWS Secret Manager.",
)
@click.option(
"--secret-user-key",
required=True,
type=str,
help="User key stored as secret in AWS Secret Manager.",
)
@click.option(
"--secret-token-key",
required=True,
type=str,
help="Token key stored as secret in AWS Secret Manager.",
)
def deploy_source_credentials(
aws_profile: Optional[str],
log_level: str,
secret_name: str,
secret_user_key: str,
secret_token_key: str):
aws_profile: Optional[str],
log_level: str,
secret_name: str,
secret_user_key: str,
secret_token_key: str,
):
set_log_level(log_level)
try:
run_deploy_source_credentials(AwsAccess(aws_profile), secret_name, secret_user_key, secret_token_key)
run_deploy_source_credentials(
AwsAccess(aws_profile), secret_name, secret_user_key, secret_token_key
)
except Exception:
logging.error("deploy_source_credentials failed.")
sys.exit(1)

Original file line number Diff line number Diff line change
@@ -1,33 +1,51 @@
from pathlib import Path
from typing import Tuple, Optional
from typing import (
Optional,
Tuple,
)

import click

from exasol_script_languages_container_ci_setup.cli.cli import cli
from exasol_script_languages_container_ci_setup.cli.common import add_options
from exasol_script_languages_container_ci_setup.cli.options.logging import logging_options, set_log_level
from exasol_script_languages_container_ci_setup.lib.run_generate_buildspec import run_generate_buildspec
from exasol_script_languages_container_ci_setup.cli.options.logging import (
logging_options,
set_log_level,
)
from exasol_script_languages_container_ci_setup.lib.run_generate_buildspec import (
run_generate_buildspec,
)


@cli.command()
@add_options(logging_options)
@click.option('--flavor-root-path', required=True, multiple=True,
type=click.Path(file_okay=False, dir_okay=True, exists=True),
help="Path where script language container flavors are located.")
@click.option('--output-path', type=click.Path(file_okay=False, dir_okay=True, exists=True, writable=True),
default="./aws-code-build/ci", show_default=True,
help="Path where buildspec files will be deployed.")
@click.option('--config-file', type=click.Path(file_okay=True, dir_okay=False, exists=True),
help="Configuration file for build (project specific).")
@click.option(
"--flavor-root-path",
required=True,
multiple=True,
type=click.Path(file_okay=False, dir_okay=True, exists=True),
help="Path where script language container flavors are located.",
)
@click.option(
"--output-path",
type=click.Path(file_okay=False, dir_okay=True, exists=True, writable=True),
default="./aws-code-build/ci",
show_default=True,
help="Path where buildspec files will be deployed.",
)
@click.option(
"--config-file",
type=click.Path(file_okay=True, dir_okay=False, exists=True),
help="Configuration file for build (project specific).",
)
def generate_buildspecs(
flavor_root_path: Tuple[str, ...],
log_level: str,
output_path: str,
config_file: Optional[str]
):
flavor_root_path: Tuple[str, ...],
log_level: str,
output_path: str,
config_file: Optional[str],
):
"""
This command generates the buildspec file(s) for AWS CodeBuild based on the flavors located in path "flavor_root_path".
"""
set_log_level(log_level)
run_generate_buildspec(flavor_root_path, output_path, config_file)

Original file line number Diff line number Diff line change
@@ -1,33 +1,51 @@
from typing import Tuple, Optional
from typing import (
Optional,
Tuple,
)

import click

from exasol_script_languages_container_ci_setup.cli.cli import cli
from exasol_script_languages_container_ci_setup.cli.common import add_options
from exasol_script_languages_container_ci_setup.cli.options.logging import logging_options, set_log_level
from exasol_script_languages_container_ci_setup.lib.run_generate_release_buildspec import run_generate_release_buildspec
from exasol_script_languages_container_ci_setup.cli.options.logging import (
logging_options,
set_log_level,
)
from exasol_script_languages_container_ci_setup.lib.run_generate_release_buildspec import (
run_generate_release_buildspec,
)


@cli.command()
@add_options(logging_options)
@click.option('--flavor-root-path', required=True, multiple=True,
type=click.Path(file_okay=False, dir_okay=True, exists=True),
help="Path where script language container flavors are located.")
@click.option('--output-path', type=click.Path(file_okay=False, dir_okay=True, exists=True, writable=True),
default="./aws-code-build/release", show_default=True,
help="Path where buildspec files will be deployed.")
@click.option('--config-file', type=click.Path(file_okay=True, dir_okay=False, exists=True),
help="Configuration file for build (project specific).")
@click.option(
"--flavor-root-path",
required=True,
multiple=True,
type=click.Path(file_okay=False, dir_okay=True, exists=True),
help="Path where script language container flavors are located.",
)
@click.option(
"--output-path",
type=click.Path(file_okay=False, dir_okay=True, exists=True, writable=True),
default="./aws-code-build/release",
show_default=True,
help="Path where buildspec files will be deployed.",
)
@click.option(
"--config-file",
type=click.Path(file_okay=True, dir_okay=False, exists=True),
help="Configuration file for build (project specific).",
)
def generate_release_buildspecs(
flavor_root_path: Tuple[str, ...],
log_level: str,
output_path: str,
config_file: Optional[str]
):
flavor_root_path: Tuple[str, ...],
log_level: str,
output_path: str,
config_file: Optional[str],
):
"""
This command generates the buildspec file(s) for the AWS CodeBuild Release build based
on the flavors located in path "flavor_root_path".
"""
set_log_level(log_level)
run_generate_release_buildspec(flavor_root_path, output_path, config_file)

Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

from exasol_script_languages_container_ci_setup.cli.cli import cli
from exasol_script_languages_container_ci_setup.cli.common import add_options
from exasol_script_languages_container_ci_setup.cli.options.aws_options import aws_options
from exasol_script_languages_container_ci_setup.health_check import (
health_checkup,
from exasol_script_languages_container_ci_setup.cli.options.aws_options import (
aws_options,
)
from exasol_script_languages_container_ci_setup.health_check import health_checkup


@cli.command()
Expand Down Expand Up @@ -34,11 +34,7 @@ def health(aws_profile: str):
"""
).format(
count=len(problems),
problems="\n".join(
(
str(p) for p in problems
)
),
problems="\n".join(str(p) for p in problems),
)
print(message)
sys.exit(failure)
Loading

0 comments on commit 2cba8c8

Please sign in to comment.