diff --git a/.github/workflows/release-integrations.yml b/.github/workflows/release-integrations.yml index 793a50966c..f69b33afb2 100644 --- a/.github/workflows/release-integrations.yml +++ b/.github/workflows/release-integrations.yml @@ -39,14 +39,20 @@ jobs: if [ "$MANIFEST" = "200" ]; then echo "Image already exists in $repository: port-ocean-$type:$version" else + + dockerfile_path=integrations/_infra/Dockerfile + if test -e $folder/../Dockerfile; then + dockerfile_path=$folder/../Dockerfile + fi # Check if the 'version' variable contains any character other than digits and "." + if [[ ! "$version" =~ ^[0-9.]+$ ]]; then # If 'version' contains non-numeric and non-dot characters, skip building 'latest' tag echo "Version contains non-numeric characters. Building without 'latest' tag." - docker build -t "ghcr.io/port-labs/port-ocean-$type:$version" "$folder/.." + docker buildx build -f $dockerfile_path -t "ghcr.io/port-labs/port-ocean-$type:$version" --build-arg="BUILD_CONTEXT=$folder/.." . else # If 'version' contains only digits and dots, build with both 'latest' and version tags - docker build -t "ghcr.io/port-labs/port-ocean-$type:$version" -t "ghcr.io/port-labs/port-ocean-$type:latest" "$folder/.." + docker buildx build -f $dockerfile_path -t "ghcr.io/port-labs/port-ocean-$type:$version" -t "ghcr.io/port-labs/port-ocean-$type:latest" --build-arg="BUILD_CONTEXT=$folder/.." . fi docker push "ghcr.io/port-labs/port-ocean-$type" --all-tags fi diff --git a/Makefile b/Makefile index 7bf35f76e6..5ea4ad3e53 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,7 @@ run: lint $(ACTIVATE) && poetry run ocean sail ./integrations/example new: - $(ACTIVATE) && poetry run ocean new ./integrations + $(ACTIVATE) && poetry run ocean new ./integrations --remove-docker-files test: lint $(ACTIVATE) && pytest diff --git a/changelog/PORT-5453.improvement.md b/changelog/PORT-5453.improvement.md new file mode 100644 index 0000000000..8bf4114e8c --- /dev/null +++ b/changelog/PORT-5453.improvement.md @@ -0,0 +1,7 @@ +Added a way to create the integration without the Dockerfile and .dockerignore to use the global Docker files when scaffolding a new integration. + + + + + + diff --git a/integrations/firehydrant/Dockerfile b/integrations/_infra/Dockerfile similarity index 67% rename from integrations/firehydrant/Dockerfile rename to integrations/_infra/Dockerfile index 1436f8b004..0804f454c7 100644 --- a/integrations/firehydrant/Dockerfile +++ b/integrations/_infra/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.11-slim-buster +ARG BUILD_CONTEXT ENV LIBRDKAFKA_VERSION 1.9.2 WORKDIR /app @@ -8,8 +9,11 @@ RUN apt update && \ apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \ apt-get clean -COPY . /app +COPY ./integrations/_infra/init.sh /app/init.sh +RUN chmod +x /app/init.sh + +COPY ./${BUILD_CONTEXT} /app RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge -ENTRYPOINT ocean sail \ No newline at end of file +ENTRYPOINT ./init.sh \ No newline at end of file diff --git a/integrations/_infra/Dockerfile.dockerignore b/integrations/_infra/Dockerfile.dockerignore new file mode 100644 index 0000000000..c0fb179461 --- /dev/null +++ b/integrations/_infra/Dockerfile.dockerignore @@ -0,0 +1,94 @@ + +# 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 + +# Vim swap files +**/*.swp + +# VS Code +**/.vscode/ + +**/*.md +**/.ruff_cache +**/cahangelog +**/tests \ No newline at end of file diff --git a/integrations/_infra/init.sh b/integrations/_infra/init.sh new file mode 100644 index 0000000000..701f61ae1c --- /dev/null +++ b/integrations/_infra/init.sh @@ -0,0 +1,5 @@ +if test -e /usr/local/share/ca-certificates/cert.crt; then + update-ca-certificates +fi + +ocean sail \ No newline at end of file diff --git a/integrations/argocd/.dockerignore b/integrations/argocd/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/argocd/.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/integrations/argocd/Dockerfile b/integrations/argocd/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/argocd/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/azure/.dockerignore b/integrations/azure/.dockerignore deleted file mode 100644 index 2ceaf5c08d..0000000000 --- a/integrations/azure/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -.vscode/ -assets/ -*.md -.git -.gitignore -.env \ No newline at end of file diff --git a/integrations/azure/Dockerfile b/integrations/azure/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/azure/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/firehydrant/.dockerignore b/integrations/firehydrant/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/firehydrant/.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/integrations/gitlab/.dockerignore b/integrations/gitlab/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/gitlab/.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/integrations/gitlab/Dockerfile b/integrations/gitlab/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/gitlab/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/jira/.dockerignore b/integrations/jira/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/jira/.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/integrations/jira/Dockerfile b/integrations/jira/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/jira/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/jira/log.txt b/integrations/jira/log.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/integrations/kafka/.dockerignore b/integrations/kafka/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/kafka/.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/integrations/kafka/Dockerfile b/integrations/kafka/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/kafka/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/kubecost/.dockerignore b/integrations/kubecost/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/kubecost/.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/integrations/kubecost/Dockerfile b/integrations/kubecost/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/kubecost/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/newrelic/.dockerignore b/integrations/newrelic/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/newrelic/.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/integrations/newrelic/Dockerfile b/integrations/newrelic/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/newrelic/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/opencost/.dockerignore b/integrations/opencost/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/opencost/.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/integrations/opencost/Dockerfile b/integrations/opencost/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/opencost/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/opsgenie/.dockerignore b/integrations/opsgenie/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/opsgenie/.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/integrations/opsgenie/Dockerfile b/integrations/opsgenie/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/opsgenie/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/pagerduty/.dockerignore b/integrations/pagerduty/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/pagerduty/.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/integrations/pagerduty/Dockerfile b/integrations/pagerduty/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/pagerduty/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/sentry/.dockerignore b/integrations/sentry/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/sentry/.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/integrations/sentry/Dockerfile b/integrations/sentry/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/sentry/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/snyk/.dockerignore b/integrations/snyk/.dockerignore deleted file mode 100644 index dc28c4f316..0000000000 --- a/integrations/snyk/.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/integrations/snyk/Dockerfile b/integrations/snyk/Dockerfile deleted file mode 100644 index 1436f8b004..0000000000 --- a/integrations/snyk/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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/integrations/sonarqube/.dockerignore b/integrations/sonarqube/.dockerignore deleted file mode 100644 index 2ceaf5c08d..0000000000 --- a/integrations/sonarqube/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -.vscode/ -assets/ -*.md -.git -.gitignore -.env \ No newline at end of file diff --git a/integrations/sonarqube/Dockerfile b/integrations/sonarqube/Dockerfile deleted file mode 100644 index 72896360dd..0000000000 --- a/integrations/sonarqube/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.11-slim-buster - -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 diff --git a/port_ocean/cli/commands/new.py b/port_ocean/cli/commands/new.py index 263f887756..48678a2a70 100644 --- a/port_ocean/cli/commands/new.py +++ b/port_ocean/cli/commands/new.py @@ -9,7 +9,14 @@ @cli_start.command() @click.argument("path", default=".", type=click.Path(exists=True)) -def new(path: str) -> None: +@click.option( + "--remove-docker-files", + "remove_docker_files", + is_flag=True, + default=False, + help="Remove Docker files from the generated project. (Used for contributing to Ocean)", +) +def new(path: str, remove_docker_files: bool) -> None: """ Scaffold a new integration in the given PATH. @@ -24,6 +31,9 @@ def new(path: str) -> None: result = cookiecutter( f"{cli_root_path}/cookiecutter", output_dir=path, + extra_context={ + "remove_docker_files": remove_docker_files, + }, ) name = result.split("/")[-1] diff --git a/port_ocean/cli/cookiecutter/cookiecutter.json b/port_ocean/cli/cookiecutter/cookiecutter.json index fa04c8b8ee..02762eddfb 100644 --- a/port_ocean/cli/cookiecutter/cookiecutter.json +++ b/port_ocean/cli/cookiecutter/cookiecutter.json @@ -5,6 +5,7 @@ "full_name": "Your name", "email": "Your address email ", "release_date": "{% now 'local' %}", + "remove_docker_files": false, "_extensions": [ "jinja2_time.TimeExtension", "extensions.VersionExtension" diff --git a/port_ocean/cli/cookiecutter/hooks/post_gen_project.py b/port_ocean/cli/cookiecutter/hooks/post_gen_project.py new file mode 100644 index 0000000000..29bbabdad9 --- /dev/null +++ b/port_ocean/cli/cookiecutter/hooks/post_gen_project.py @@ -0,0 +1,11 @@ +import os + + +def delete_docker_files(): + if "{{ cookiecutter.public_integration }}" == "True": + os.remove("Dockerfile") + os.remove(".dockerignore") + + +if __name__ == "__main__": + delete_docker_files() diff --git a/pyproject.toml b/pyproject.toml index a067a0921d..afd2b737a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "port-ocean" -version = "0.4.8" +version = "0.4.9" description = "Port Ocean is a CLI tool for managing your Port projects." readme = "README.md" homepage = "https://app.getport.io"