From 5cd3a3b9fd701eaa52fe2a6cfdfd9250b1c584bc Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 6 Jul 2023 17:53:19 +0200 Subject: [PATCH] add ci to test --- .gitlab-ci.yml | 20 ++++++++++++++++++++ README.md | 11 +++++++++++ build.py | 35 ++++++++++++++++++++++++++++------- 3 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 README.md diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..fe8b09d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +stages: + - build_on_main + - build_on_tag + +build_on_main: + image: domaindrivenarchitecture/devops-build:latest + stage: build_on_main + script: + - echo "buld on main" + +build_on_tag: + image: domaindrivenarchitecture/devops-build:latest + stage: build_on_tag + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/' + script: + - echo "buld on tag" + diff --git a/README.md b/README.md new file mode 100644 index 0000000..5954a6e --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Release Testing +## NoRelease + +``` +pyb dev prepare_release publish tag_bump_and_push_release +``` +## Release + +``` +pyb [patch|minor|major] prepare_release tag_bump_and_push_release +``` \ No newline at end of file diff --git a/build.py b/build.py index a5cbb7c..aa0257d 100644 --- a/build.py +++ b/build.py @@ -6,9 +6,6 @@ name = "buildtest" MODULE = "release" PROJECT_ROOT_PATH = "." -class MyBuild(ReleaseMixin): - pass - @init def initialize(project): @@ -20,24 +17,48 @@ def initialize(project): "project_root_path": PROJECT_ROOT_PATH, "build_types": [], "mixin_types": ["RELEASE"], - "release_type": "MINOR", "release_primary_build_file": "project.clj", "release_secondary_build_files": ["package.json"], } project.build_depends_on("ddadevops>=4.0.0-dev") - build = MyBuild(project, input) + 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 after_publish(project): +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)