Skip to content

Commit

Permalink
[Core] Fix ocean new
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzaadi committed Nov 24, 2024
1 parent 6e438e6 commit ec3ab95
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 115 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ ACTIVATE := . .venv/bin/activate
define run_checks
exit_code=0; \
cd $1; \
echo "Running poetry check"; \
poetry check || exit_code=$$?;\
echo "Running mypy"; \
mypy . --exclude '/\.venv/' || exit_code=$$?; \
echo "Running ruff"; \
ruff check . || exit_code=$$?; \
echo "Running black"; \
black --check . || exit_code=$$?; \
echo "Running yamllint"; \
yamllint . || exit_code=$$?; \
if [ $$exit_code -eq 1 ]; then \
echo "\033[0;31mOne or more checks failed with exit code $$exit_code\033[0m"; \
Expand Down
8 changes: 7 additions & 1 deletion integrations/_infra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ ACTIVATE := . .venv/bin/activate
define run_checks
exit_code=0; \
cd $1; \
echo "Running poetry check"; \
poetry check || exit_code=$$?;\
mypy . || exit_code=$$?; \
echo "Running mypy"; \
mypy . --exclude '/\.venv/' || exit_code=$$?; \
echo "Running ruff"; \
ruff check . || exit_code=$$?; \
echo "Running black"; \
black --check . || exit_code=$$?; \
echo "Running yamllint"; \
yamllint . || exit_code=$$?; \
if [ $$exit_code -eq 1 ]; then \
echo "\033[0;31mOne or more checks failed with exit code $$exit_code\033[0m"; \
else \
Expand Down
18 changes: 14 additions & 4 deletions port_ocean/cli/cookiecutter/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,27 @@


def handle_private_integration_flags():
infra_make_file = "../_infra/Makefile"
target_link_make_file = os.path.join("./Makefile")
target_dir = os.path.join(
"{{cookiecutter._output_dir}}", "{{cookiecutter.integration_slug}}"
)
root_dir = os.path.join("{{ cookiecutter._repo_dir }}", "../../../")
infra_make_file = os.path.join(root_dir, "integrations/_infra/Makefile")
infra_dockerfile = os.path.join(root_dir, "integrations/_infra/Dockerfile.deb")
infra_dockerignore = os.path.join(
root_dir, "integrations/_infra/Dockerfile.dockerignore"
)
target_link_make_file = os.path.join(target_dir, "./Makefile")
target_link_dockerfile = os.path.join(target_dir, "./Dockerfile")
target_link_dockerignore = os.path.join(target_dir, "./.dockerignore")

if "{{ cookiecutter.is_private_integration }}" == "True":
shutil.copyfile(infra_make_file, target_link_make_file)
shutil.copyfile(infra_dockerfile, target_link_dockerfile)
shutil.copyfile(infra_dockerignore, target_link_dockerignore)
os.remove("sonar-project.properties")
return

os.symlink(infra_make_file, target_link_make_file)
os.remove("Dockerfile")
os.remove(".dockerignore")


if __name__ == "__main__":
Expand Down

This file was deleted.

This file was deleted.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "port-ocean"
version = "0.14.1"
version = "0.14.2"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
Expand All @@ -11,6 +11,10 @@ packages = [
{ include = "port_ocean", from = "." }
]

include = [
{ path = "./integrations/_infra/*", format = ["sdist", "wheel"] }
]

keywords = ["ocean", "port-ocean", "port"]
classifiers = [
"Framework :: FastAPI",
Expand Down

0 comments on commit ec3ab95

Please sign in to comment.