diff --git a/Makefile b/Makefile index b9d3be75d6..9b9d01d705 100644 --- a/Makefile +++ b/Makefile @@ -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"; \ diff --git a/integrations/_infra/Makefile b/integrations/_infra/Makefile index 8f369d8b07..5497f37150 100644 --- a/integrations/_infra/Makefile +++ b/integrations/_infra/Makefile @@ -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 \ diff --git a/port_ocean/cli/cookiecutter/hooks/post_gen_project.py b/port_ocean/cli/cookiecutter/hooks/post_gen_project.py index 0055ce20ba..38b3fb0e29 100644 --- a/port_ocean/cli/cookiecutter/hooks/post_gen_project.py +++ b/port_ocean/cli/cookiecutter/hooks/post_gen_project.py @@ -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__": diff --git a/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore b/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore +++ /dev/null @@ -1,94 +0,0 @@ -# Git -.git -.gitignore -.gitattributes - - -# CI -.codeclimate.yml -.travis.yml -.taskcluster.yml - -# Docker -docker-compose.yml -Dockerfile -.docker -.dockerignore - -# Byte-compiled / optimized / DLL files -**/__pycache__/ -**/*.py[cod] - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.cache -nosetests.xml -coverage.xml - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Virtual environment -.env -.venv/ -venv/ - -# PyCharm -.idea - -# Python mode for VIM -.ropeproject -**/.ropeproject - -# Vim swap files -**/*.swp - -# VS Code -.vscode/ - -*.md -**/.ruff_cache -**/cahangelog -**/tests \ No newline at end of file diff --git a/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile b/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile deleted file mode 100644 index 86ddcc540f..0000000000 --- a/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-bookworm - -ENV LIBRDKAFKA_VERSION 1.9.2 - -WORKDIR /app - -RUN apt update && \ - apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \ - apt-get clean - -COPY . /app - -RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge - -ENTRYPOINT ocean sail \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7536041b2e..2812ccaeca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -11,6 +11,10 @@ packages = [ { include = "port_ocean", from = "." } ] +include = [ + { path = "./integrations/_infra/*", format = ["sdist", "wheel"] } +] + keywords = ["ocean", "port-ocean", "port"] classifiers = [ "Framework :: FastAPI",