diff --git a/deploy.sh b/deploy.sh index e4430f85c..1e23abe1c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -51,7 +51,7 @@ python3 setup.py bdist_wheel pip install --upgrade --force-reinstall dist/sonar_tools-*-py3-*.whl if [ "$build_image" == "1" ]; then - docker build -t olivierkorach/sonar-tools:3.4 -t olivierkorach/sonar-tools:latest -f snapshot.Dockerfile . + docker build -t olivierkorach/sonar-tools:3.5 -t olivierkorach/sonar-tools:latest -f snapshot.Dockerfile . --load fi if [ "$build_docs" == "1" ]; then @@ -69,5 +69,5 @@ if [ "$release" = "1" ]; then fi if [ "$release_docker" = "1" ]; then - docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-tools:3.4 -t olivierkorach/sonar-tools:latest -f release.Dockerfile . + docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-tools:3.5 -t olivierkorach/sonar-tools:latest -f release.Dockerfile . fi \ No newline at end of file diff --git a/doc/README.sonar-migration.md b/migration/README.md similarity index 100% rename from doc/README.sonar-migration.md rename to migration/README.md diff --git a/migration/__init__.py b/migration/__init__.py new file mode 100644 index 000000000..205618ccc --- /dev/null +++ b/migration/__init__.py @@ -0,0 +1,19 @@ +# +# sonar-tools +# Copyright (C) 2022-2024 Olivier Korach +# mailto:olivier.korach AT gmail DOT com +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# diff --git a/deploy-migration.sh b/migration/deploy.sh similarity index 88% rename from deploy-migration.sh rename to migration/deploy.sh index 5f84c3ec7..278bf1be5 100755 --- a/deploy-migration.sh +++ b/migration/deploy.sh @@ -47,7 +47,7 @@ python3 setup_migration.py bdist_wheel pip install --upgrade --force-reinstall dist/sonar_migration-*-py3-*.whl if [ "$build_image" == "1" ]; then - docker build -t sonar-migration:latest -f migration.Dockerfile . + docker build -t olivierkorach/sonar-migration:latest -f migration/snapshot.Dockerfile . --load fi # Deploy on pypi.org once released @@ -60,5 +60,5 @@ if [ "$release" = "1" ]; then fi if [ "$release_docker" = "1" ]; then - docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-migration:0.1 -t olivierkorach/sonar-migration:latest -f migration-release.Dockerfile . + docker buildx build --push --platform linux/amd64,linux/arm64 -t olivierkorach/sonar-migration:0.2 -t olivierkorach/sonar-migration:latest -f migration/release.Dockerfile . fi \ No newline at end of file diff --git a/cli/migration.py b/migration/migration.py similarity index 100% rename from cli/migration.py rename to migration/migration.py diff --git a/migration-release.Dockerfile b/migration/release.Dockerfile similarity index 94% rename from migration-release.Dockerfile rename to migration/release.Dockerfile index 9d758981c..f8edec8c8 100644 --- a/migration-release.Dockerfile +++ b/migration/release.Dockerfile @@ -31,7 +31,7 @@ COPY ./LICENSE . COPY ./sonar/audit sonar/audit RUN pip install --upgrade pip \ -&& pip install sonar-migration==0.1 --force-reinstall +&& pip install sonar-migration==0.2 --force-reinstall USER ${USERNAME} WORKDIR /home/${USERNAME} diff --git a/migration-snapshot.Dockerfile b/migration/snapshot.Dockerfile similarity index 87% rename from migration-snapshot.Dockerfile rename to migration/snapshot.Dockerfile index 35cb679c8..fa028bb08 100644 --- a/migration-snapshot.Dockerfile +++ b/migration/snapshot.Dockerfile @@ -23,18 +23,16 @@ WORKDIR /opt/sonar-migration COPY ./sonar sonar COPY ./requirements.txt . +COPY ./migration migration +COPY ./LICENSE . COPY ./cli cli COPY ./setup_migration.py . -COPY ./sonar_migration . -COPY ./README.md . -COPY ./LICENSE . -COPY ./sonar/audit sonar/audit RUN pip install --upgrade pip \ && pip install --no-cache-dir -r requirements.txt \ && pip install --no-cache-dir --upgrade pip setuptools wheel \ && python setup_migration.py bdist_wheel \ -&& pip install dist/sonar_migration-py3-*.whl --force-reinstall +&& pip install dist/sonar_migration-*-py3-*.whl --force-reinstall USER ${USERNAME} WORKDIR /home/${USERNAME} diff --git a/sonar_migration b/migration/sonar_migration similarity index 100% rename from sonar_migration rename to migration/sonar_migration diff --git a/doc/what-is-new.sonar-migration.md b/migration/what-is-new.md similarity index 100% rename from doc/what-is-new.sonar-migration.md rename to migration/what-is-new.md diff --git a/setup_migration.py b/setup_migration.py index 8c662e3f2..d60fdef03 100644 --- a/setup_migration.py +++ b/setup_migration.py @@ -26,12 +26,12 @@ import setuptools from sonar import version -with open("README.md", "r", encoding="utf-8") as fh: +with open("migration/README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="sonar-migration", version=version.MIGRATION_TOOL_VERSION, - scripts=["sonar_migration"], + scripts=["migration/sonar_migration"], author="Olivier Korach", author_email="olivier.korach@gmail.com", description="A SonarQube collection tool to use in the context of SonarQube to SonarCloud migration", @@ -40,7 +40,7 @@ url="https://github.com/okorach/sonar-tools", project_urls={ "Bug Tracker": "https://github.com/okorach/sonar-tools/issues", - "Documentation": "https://github.com/okorach/sonar-tools/doc/README.sonar-migration.md", + "Documentation": "https://github.com/okorach/sonar-tools/migration/README.md", "Source Code": "https://github.com/okorach/sonar-tools", }, packages=setuptools.find_packages(), @@ -59,7 +59,7 @@ ], entry_points={ "console_scripts": [ - "sonar-migration = cli.migration:main", + "sonar-migration = migration.migration:main", ] }, python_requires=">=3.8", diff --git a/sonar-project.properties b/sonar-project.properties index 678afc5ed..94f35155f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -13,6 +13,6 @@ sonar.python.pylint.reportPaths=build/pylint-report.out # sonar.python.bandit.reportPaths=build/bandit-report.json sonar.exclusions=api-doc/**/*, build/**/*, test/**/* -sonar.coverage.exclusions=test/**/*, shellcheck2sonar.py, cli/cust_measures.py, sonar/custom_measures.py, cli/support.py, cli/projects_export.py, , cli/projects_import.py, cli/migration.py, setup*.py -sonar.cpd.exclusions = setup*.py, cli/migration.py +sonar.coverage.exclusions=setup*.py, migration/migration.py, test/**/*, shellcheck2sonar.py, cli/cust_measures.py, sonar/custom_measures.py, cli/support.py, cli/projects_export.py, , cli/projects_import.py +sonar.cpd.exclusions=setup*.py, migration/migration.py sonar.tests=test diff --git a/test/test_migration.py b/test/test_migration.py index 053ffe325..db6aae362 100644 --- a/test/test_migration.py +++ b/test/test_migration.py @@ -30,7 +30,7 @@ import utilities as util from sonar import errcodes import cli.options as opt -from cli import migration +from migration import migration CMD = "migration.py" OPTS = [CMD] + util.STD_OPTS + [f"-{opt.REPORT_FILE_SHORT}", util.JSON_FILE]