diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3f1e6e..e773745 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,8 +32,7 @@ build: <<: *kotlin stage: build script: - - echo "---------- build stage ----------" - - ./gradlew assemble + - pyb build artifacts: paths: - build/libs/*.jar diff --git a/build.py b/build.py new file mode 100644 index 0000000..b06edd4 --- /dev/null +++ b/build.py @@ -0,0 +1,72 @@ +from os import environ +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": [], + } + + build = ReleaseMixin(project, input) + build.initialize_build_dir() + +@task +def patch(project): + linttest(project, "PATCH") + release(project) + + +@task +def minor(project): + linttest(project, "MINOR") + release(project) + + +@task +def major(project): + linttest(project, "MAJOR") + release(project) + + +@task +def dev(project): + linttest(project, "NONE") + + +@task +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() + +@task +def build(project): + print("---------- build stage ----------") + run("./gradlew assemble", shell=True) + +def release(project): + prepare(project) + tag(project) + +def linttest(project, release_type): + build(project) \ No newline at end of file