buildtest/build.py

81 lines
No EOL
1.6 KiB
Python

from os import environ
from pybuilder.core import task, init
from ddadevops import *
name = "buildtest"
MODULE = "release"
PROJECT_ROOT_PATH = "."
@init
def initialize(project):
input = {
"name": name,
"module": MODULE,
"stage": "notused",
"project_root_path": PROJECT_ROOT_PATH,
"build_types": [],
"mixin_types": ["RELEASE"],
"release_primary_build_file": "build_to_test.py",
"release_secondary_build_files": ["package.json", "project.clj"],
"release_artifacts": [],
"release_artifact_server_url": "https://repo.prod.meissa.de",
"release_organisation": "meissa",
"release_repository_name": name,
}
project.build_depends_on("ddadevops>=4.0.0-dev")
build = ReleaseMixin(project, input)
build.initialize_build_dir()
@task
def patch(project):
build(project, "PATCH")
@task
def minor(project):
build(project, "MINOR")
@task
def major(project):
build(project, "MAJOR")
@task
def dev(project):
build(project, "NONE")
@task
def nothing(project):
pass
@task
def prepare_release(project):
build = get_devops_build(project)
build.prepare_release()
@task
def tag_bump_and_push_release(project):
build = get_devops_build(project)
build.tag_bump_and_push_release()
def build(project, release_type):
build = get_devops_build(project)
build.update_release_type(release_type)
nothing(project)
@task
def publish_artifacts(project):
build = get_devops_build(project)
print("RELEASE_ARTIFACT_TOKEN" in environ)
print(environ.get("RELEASE_ARTIFACT_TOKEN"))
build.publish_artifacts()