dda-devops-build/build.py

46 lines
1 KiB
Python
Raw Normal View History

2023-02-08 09:33:39 +00:00
from pybuilder.core import task, init
from ddadevops import *
2023-02-16 13:21:27 +00:00
from version import *
2023-02-16 14:59:38 +00:00
from release_mixin import *
2023-02-08 09:57:40 +00:00
2023-02-16 14:59:38 +00:00
CONFIG_FILE = ''
2023-02-22 13:10:19 +00:00
MAIN_BRANCH = 'main'
2023-02-16 14:59:38 +00:00
class MyBuild(ReleaseMixin):
pass
2023-02-08 09:57:40 +00:00
2023-02-08 09:33:39 +00:00
@init
def initialize(project):
2023-02-08 09:57:40 +00:00
project.build_depends_on('ddadevops>=3.1.2')
2023-02-22 13:10:19 +00:00
config = create_release_mixin_config(CONFIG_FILE, MAIN_BRANCH)
build = MyBuild(project, config)
build.init()
2023-02-08 09:33:39 +00:00
2023-02-22 13:10:19 +00:00
@task
def release(project):
build = get_devops_build(project)
2023-02-16 14:59:38 +00:00
2023-02-22 13:10:19 +00:00
prepare_release(build)
tag_and_push_release(build)
2023-02-16 14:59:38 +00:00
2023-02-22 13:10:19 +00:00
prepare_version_bump(build)
tag_and_push_version_bump(build)
2023-02-22 13:10:19 +00:00
def prepare_release(build):
release_version = build.release_version
build.prepare(release_version)
def tag_and_push_release(build):
release_version = build.release_version
build.tag_and_push(release_version)
def prepare_version_bump(build):
bump_version = build.bump_version
build.prepare(bump_version)
def tag_and_push_version_bump(build):
bump_version = build.bump_version
build.tag_and_push(bump_version)
2023-02-08 09:33:39 +00:00
2023-02-08 09:57:40 +00:00