Setup build.py
This commit is contained in:
parent
238b0304b6
commit
03f8507968
1 changed files with 28 additions and 26 deletions
54
build.py
54
build.py
|
@ -4,40 +4,42 @@ from version import *
|
||||||
from release_mixin import *
|
from release_mixin import *
|
||||||
|
|
||||||
CONFIG_FILE = ''
|
CONFIG_FILE = ''
|
||||||
COMMIT_ID = ''
|
MAIN_BRANCH = 'main'
|
||||||
|
|
||||||
class MyBuild(ReleaseMixin):
|
class MyBuild(ReleaseMixin):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def main():
|
|
||||||
init_project()
|
|
||||||
|
|
||||||
@init
|
@init
|
||||||
def initialize(project):
|
def initialize(project):
|
||||||
project.build_depends_on('ddadevops>=3.1.2')
|
project.build_depends_on('ddadevops>=3.1.2')
|
||||||
|
config = create_release_mixin_config(CONFIG_FILE, MAIN_BRANCH)
|
||||||
if COMMIT_ID == '':
|
build = MyBuild(project, config)
|
||||||
COMMIT_ID = 'HEAD'
|
build.init()
|
||||||
|
|
||||||
config = create_release_mixin_config(CONFIG_FILE, COMMIT_ID)
|
|
||||||
|
|
||||||
|
|
||||||
build = MyBuild(project, config)
|
|
||||||
release_version, bump_version = build.init()
|
|
||||||
build.prepare()
|
|
||||||
build.tag_and_push()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def prepare(project):
|
def release(project):
|
||||||
build = get_devops_build(project)
|
build = get_devops_build(project)
|
||||||
build.prepare_release()
|
|
||||||
|
|
||||||
@task
|
prepare_release(build)
|
||||||
def tag_and_push(project):
|
tag_and_push_release(build)
|
||||||
build = get_devops_build(project)
|
|
||||||
build.tag_and_push()
|
prepare_version_bump(build)
|
||||||
|
tag_and_push_version_bump(build)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue