|
|
|
@ -22,63 +22,71 @@ from ddadevops import *
|
|
|
|
|
use_plugin("python.core")
|
|
|
|
|
use_plugin("copy_resources")
|
|
|
|
|
use_plugin("filter_resources")
|
|
|
|
|
#use_plugin("python.unittest")
|
|
|
|
|
#use_plugin("python.coverage")
|
|
|
|
|
# use_plugin("python.unittest")
|
|
|
|
|
# use_plugin("python.coverage")
|
|
|
|
|
use_plugin("python.distutils")
|
|
|
|
|
|
|
|
|
|
#use_plugin("python.install_dependencies")
|
|
|
|
|
# use_plugin("python.install_dependencies")
|
|
|
|
|
|
|
|
|
|
default_task = "dev"
|
|
|
|
|
|
|
|
|
|
name = "ddadevops"
|
|
|
|
|
MODULE = "not-used"
|
|
|
|
|
PROJECT_ROOT_PATH = "."
|
|
|
|
|
version = "4.0.17-dev"
|
|
|
|
|
version = "4.1.0-dev2"
|
|
|
|
|
summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud"
|
|
|
|
|
description = __doc__
|
|
|
|
|
authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")]
|
|
|
|
|
url = "https://repo.prod.meissa.de/meissa/dda-devops-build"
|
|
|
|
|
requires_python = ">=3.10" # CHECK IF NEW VERSION EXISTS
|
|
|
|
|
requires_python = ">=3.10" # CHECK IF NEW VERSION EXISTS
|
|
|
|
|
license = "Apache Software License"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@init
|
|
|
|
|
def initialize(project):
|
|
|
|
|
#project.build_depends_on('mockito')
|
|
|
|
|
#project.build_depends_on('unittest-xml-reporting')
|
|
|
|
|
# project.build_depends_on('mockito')
|
|
|
|
|
# project.build_depends_on('unittest-xml-reporting')
|
|
|
|
|
project.build_depends_on("ddadevops>=4.0.0")
|
|
|
|
|
|
|
|
|
|
project.set_property("verbose", True)
|
|
|
|
|
project.get_property("filter_resources_glob").append("main/python/ddadevops/__init__.py")
|
|
|
|
|
project.get_property("filter_resources_glob").append(
|
|
|
|
|
"main/python/ddadevops/__init__.py"
|
|
|
|
|
)
|
|
|
|
|
project.set_property("dir_source_unittest_python", "src/test/python")
|
|
|
|
|
|
|
|
|
|
project.set_property("copy_resources_target", "$dir_dist/ddadevops")
|
|
|
|
|
project.get_property("copy_resources_glob").append("LICENSE")
|
|
|
|
|
project.get_property("copy_resources_glob").append("src/main/resources/terraform/*")
|
|
|
|
|
project.get_property("copy_resources_glob").append("src/main/resources/docker/image/resources/*")
|
|
|
|
|
project.get_property("copy_resources_glob").append(
|
|
|
|
|
"src/main/resources/docker/image/resources/*"
|
|
|
|
|
)
|
|
|
|
|
project.include_file("ddadevops", "LICENSE")
|
|
|
|
|
project.include_file("ddadevops", "src/main/resources/terraform/*")
|
|
|
|
|
project.include_file("ddadevops", "src/main/resources/docker/image/resources/*")
|
|
|
|
|
|
|
|
|
|
#project.set_property('distutils_upload_sign', True)
|
|
|
|
|
#project.set_property('distutils_upload_sign_identity', '')
|
|
|
|
|
# project.set_property('distutils_upload_sign', True)
|
|
|
|
|
# project.set_property('distutils_upload_sign_identity', '')
|
|
|
|
|
project.set_property("distutils_readme_description", True)
|
|
|
|
|
project.set_property("distutils_description_overwrite", True)
|
|
|
|
|
project.set_property("distutils_classifiers", [
|
|
|
|
|
'License :: OSI Approved :: Apache Software License',
|
|
|
|
|
'Programming Language :: Python',
|
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
|
'Programming Language :: Python :: 3.8',
|
|
|
|
|
'Programming Language :: Python :: 3.10',
|
|
|
|
|
'Operating System :: POSIX :: Linux',
|
|
|
|
|
'Operating System :: OS Independent',
|
|
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
|
'Environment :: Console',
|
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
|
'License :: OSI Approved :: Apache Software License',
|
|
|
|
|
'Topic :: Software Development :: Build Tools',
|
|
|
|
|
'Topic :: Software Development :: Quality Assurance',
|
|
|
|
|
'Topic :: Software Development :: Testing'
|
|
|
|
|
])
|
|
|
|
|
project.set_property(
|
|
|
|
|
"distutils_classifiers",
|
|
|
|
|
[
|
|
|
|
|
"License :: OSI Approved :: Apache Software License",
|
|
|
|
|
"Programming Language :: Python",
|
|
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
|
"Programming Language :: Python :: 3.8",
|
|
|
|
|
"Programming Language :: Python :: 3.10",
|
|
|
|
|
"Operating System :: POSIX :: Linux",
|
|
|
|
|
"Operating System :: OS Independent",
|
|
|
|
|
"Development Status :: 5 - Production/Stable",
|
|
|
|
|
"Environment :: Console",
|
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
|
"License :: OSI Approved :: Apache Software License",
|
|
|
|
|
"Topic :: Software Development :: Build Tools",
|
|
|
|
|
"Topic :: Software Development :: Quality Assurance",
|
|
|
|
|
"Topic :: Software Development :: Testing",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
input = {
|
|
|
|
|
"name": name,
|
|
|
|
@ -88,54 +96,93 @@ def initialize(project):
|
|
|
|
|
"build_types": [],
|
|
|
|
|
"mixin_types": ["RELEASE"],
|
|
|
|
|
"release_primary_build_file": "build.py",
|
|
|
|
|
"release_secondary_build_files": [
|
|
|
|
|
"infrastructure/python/build.py",
|
|
|
|
|
"infrastructure/dind/build.py",
|
|
|
|
|
"infrastructure/ddadevops/build.py",
|
|
|
|
|
"infrastructure/clojure/build.py",
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
build = ReleaseMixin(project, input)
|
|
|
|
|
build.initialize_build_dir()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def test(project):
|
|
|
|
|
run("pytest", check=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def lint(project):
|
|
|
|
|
run("flake8 --max-line-length=120 --count --select=E9,F63,F7,F82 "+
|
|
|
|
|
"--show-source --statistics src/main/python/ddadevops/", shell=True, check=True)
|
|
|
|
|
run("flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 "+
|
|
|
|
|
"--per-file-ignores=\"__init__.py:F401\" "+
|
|
|
|
|
"--ignore=E722,W503 --statistics src/main/python/ddadevops/", shell=True, check=True)
|
|
|
|
|
run("python -m mypy src/main/python/ddadevops/ --ignore-missing-imports "+
|
|
|
|
|
"--disable-error-code=attr-defined --disable-error-code=union-attr", shell=True, check=True)
|
|
|
|
|
run("pylint -d W0511,R0903,C0301,W0614,C0114,C0115,C0116,similarities,W1203,W0702,W0702,"+
|
|
|
|
|
"R0913,R0902,R0914,R1732,R1705,W0707,C0123,W0703,C0103 src/main/python/ddadevops/", shell=True, check=True)
|
|
|
|
|
run(
|
|
|
|
|
"flake8 --max-line-length=120 --count --select=E9,F63,F7,F82 "
|
|
|
|
|
+ "--show-source --statistics src/main/python/ddadevops/",
|
|
|
|
|
shell=True,
|
|
|
|
|
check=True,
|
|
|
|
|
)
|
|
|
|
|
run(
|
|
|
|
|
"flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 "
|
|
|
|
|
+ '--per-file-ignores="__init__.py:F401" '
|
|
|
|
|
+ "--ignore=E722,W503 --statistics src/main/python/ddadevops/",
|
|
|
|
|
shell=True,
|
|
|
|
|
check=True,
|
|
|
|
|
)
|
|
|
|
|
run(
|
|
|
|
|
"python -m mypy src/main/python/ddadevops/ --ignore-missing-imports "
|
|
|
|
|
+ "--disable-error-code=attr-defined --disable-error-code=union-attr",
|
|
|
|
|
shell=True,
|
|
|
|
|
check=True,
|
|
|
|
|
)
|
|
|
|
|
run(
|
|
|
|
|
"pylint -d W0511,R0903,C0301,W0614,C0114,C0115,C0116,similarities,W1203,W0702,W0702,"
|
|
|
|
|
+ "R0913,R0902,R0914,R1732,R1705,W0707,C0123,W0703,C0103 src/main/python/ddadevops/",
|
|
|
|
|
shell=True,
|
|
|
|
|
check=True,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def patch(project):
|
|
|
|
|
build(project, "PATCH")
|
|
|
|
|
linttest(project, "PATCH")
|
|
|
|
|
release(project)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def minor(project):
|
|
|
|
|
build(project, "MINOR")
|
|
|
|
|
linttest(project, "MINOR")
|
|
|
|
|
release(project)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def major(project):
|
|
|
|
|
build(project, "MAJOR")
|
|
|
|
|
linttest(project, "MAJOR")
|
|
|
|
|
release(project)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def dev(project):
|
|
|
|
|
build(project, "NONE")
|
|
|
|
|
linttest(project, "NONE")
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def nothing(project):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def release(project):
|
|
|
|
|
def prepare(project):
|
|
|
|
|
build = get_devops_build(project)
|
|
|
|
|
build.prepare_release()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
|
def tag(project):
|
|
|
|
|
build = get_devops_build(project)
|
|
|
|
|
build.tag_bump_and_push_release()
|
|
|
|
|
|
|
|
|
|
def build(project, release_type):
|
|
|
|
|
|
|
|
|
|
def release(project):
|
|
|
|
|
prepare(project)
|
|
|
|
|
tag(project)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def linttest(project, release_type):
|
|
|
|
|
build = get_devops_build(project)
|
|
|
|
|
build.update_release_type(release_type)
|
|
|
|
|
test(project)
|
|
|
|
|