2023-08-08 07:43:28 +00:00
|
|
|
from subprocess import run
|
|
|
|
from pybuilder.core import init, task
|
|
|
|
from ddadevops import *
|
|
|
|
|
|
|
|
default_task = "dev"
|
|
|
|
|
|
|
|
name = "provs"
|
|
|
|
PROJECT_ROOT_PATH = "."
|
|
|
|
|
|
|
|
|
|
|
|
@init
|
|
|
|
def initialize(project):
|
|
|
|
input = {
|
|
|
|
"name": name,
|
|
|
|
"module": "notused",
|
|
|
|
"stage": "notused",
|
|
|
|
"project_root_path": PROJECT_ROOT_PATH,
|
|
|
|
"build_types": [],
|
|
|
|
"mixin_types": ["RELEASE"],
|
|
|
|
"release_primary_build_file": "build.gradle",
|
|
|
|
"release_secondary_build_files": [],
|
2023-11-24 22:10:02 +00:00
|
|
|
# release artifacts
|
|
|
|
"release_artifact_server_url": "https://repo.prod.meissa.de",
|
|
|
|
"release_organisation": "meissa",
|
|
|
|
"release_repository_name": name,
|
|
|
|
"release_artifacts": [
|
|
|
|
"build/libs/provs-server.jar",
|
|
|
|
"build/libs/provs-desktop.jar",
|
|
|
|
"build/libs/provs-syspec.jar",
|
|
|
|
"build/libs/sha256sum.lst",
|
|
|
|
"build/libs/sha512sum.lst",
|
|
|
|
],
|
2023-08-08 07:43:28 +00:00
|
|
|
}
|
2023-11-25 10:39:13 +00:00
|
|
|
build = ReleaseMixin(project, input)
|
|
|
|
build.initialize_build_dir()
|
2023-08-08 07:43:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
@task
|
2023-11-24 22:10:02 +00:00
|
|
|
def build(project):
|
|
|
|
run("./gradlew assemble", shell=True)
|
2023-08-08 07:43:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
@task
|
2023-11-24 22:10:02 +00:00
|
|
|
def dev(project):
|
|
|
|
build(project)
|
2023-08-08 07:43:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
@task
|
2023-11-24 22:10:02 +00:00
|
|
|
def patch(project):
|
|
|
|
"""
|
|
|
|
updates version to next patch level, creates a tag, creates new SNAPSHOT version,
|
2023-11-25 11:07:50 +00:00
|
|
|
commits primary build file (build.gradle) and pushes to remote
|
2023-11-24 22:10:02 +00:00
|
|
|
"""
|
|
|
|
increase_version_number(project, "PATCH")
|
2023-08-08 07:43:28 +00:00
|
|
|
release(project)
|
|
|
|
|
|
|
|
|
|
|
|
@task
|
2023-11-24 22:10:02 +00:00
|
|
|
def minor(project):
|
2023-11-25 11:07:50 +00:00
|
|
|
"""
|
|
|
|
updates version to next minor level, creates a tag, creates new SNAPSHOT version,
|
|
|
|
commits primary build file (build.gradle) and pushes to remote
|
|
|
|
"""
|
2023-11-24 22:10:02 +00:00
|
|
|
increase_version_number(project, "MINOR")
|
|
|
|
release(project)
|
2023-08-08 07:43:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
@task
|
2023-11-24 22:10:02 +00:00
|
|
|
def major(project):
|
2023-11-25 11:07:50 +00:00
|
|
|
"""
|
|
|
|
updates version to next major level, creates a tag, creates new SNAPSHOT version,
|
|
|
|
commits primary build file (build.gradle) and pushes to remote
|
|
|
|
"""
|
2023-11-24 22:10:02 +00:00
|
|
|
increase_version_number(project, "MAJOR")
|
|
|
|
release(project)
|
2023-08-08 07:43:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
@task
|
|
|
|
def tag(project):
|
|
|
|
build = get_devops_build(project)
|
|
|
|
build.tag_bump_and_push_release()
|
|
|
|
|
2023-11-15 17:06:42 +00:00
|
|
|
|
2023-08-08 07:43:28 +00:00
|
|
|
@task
|
2023-11-24 22:10:02 +00:00
|
|
|
def release(project):
|
|
|
|
build = get_devops_build(project)
|
|
|
|
build.prepare_release()
|
|
|
|
tag(project)
|
2023-08-08 07:43:28 +00:00
|
|
|
|
2023-11-15 17:06:42 +00:00
|
|
|
|
|
|
|
@task
|
|
|
|
def package(project):
|
2023-11-24 22:10:02 +00:00
|
|
|
run("./gradlew assemble -x test jar", shell=True)
|
|
|
|
run("./gradlew assemble -x test uberjarDesktop", shell=True)
|
|
|
|
run("./gradlew assemble -x test uberjarServer", shell=True)
|
|
|
|
run("./gradlew assemble -x test uberjarSyspec", shell=True)
|
2023-11-15 17:06:42 +00:00
|
|
|
run("cd build/libs/ && find . -type f -exec sha256sum {} \; | sort > sha256sum.lst", shell=True)
|
|
|
|
run("cd build/libs/ && find . -type f -exec sha512sum {} \; | sort > sha512sum.lst", shell=True)
|
|
|
|
|
|
|
|
|
2023-11-24 22:10:02 +00:00
|
|
|
@task
|
2023-11-25 11:04:32 +00:00
|
|
|
def publish_release(project):
|
|
|
|
""" creates a release in repo.meissa and uploads artifacts (jar-files and checksum files) """
|
2023-11-24 22:10:02 +00:00
|
|
|
build = get_devops_build(project)
|
|
|
|
build.publish_artifacts()
|
|
|
|
|
2023-08-08 07:43:28 +00:00
|
|
|
|
2023-11-24 22:10:02 +00:00
|
|
|
def increase_version_number(project, release_type):
|
|
|
|
build = get_devops_build(project)
|
|
|
|
build.update_release_type(release_type)
|