use pyb
This commit is contained in:
parent
e4e635d45b
commit
c1267ac17e
2 changed files with 73 additions and 2 deletions
|
@ -32,8 +32,7 @@ build:
|
|||
<<: *kotlin
|
||||
stage: build
|
||||
script:
|
||||
- echo "---------- build stage ----------"
|
||||
- ./gradlew assemble
|
||||
- pyb build
|
||||
artifacts:
|
||||
paths:
|
||||
- build/libs/*.jar
|
||||
|
|
72
build.py
Normal file
72
build.py
Normal file
|
@ -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)
|
Loading…
Reference in a new issue