add ci to test

This commit is contained in:
Michael Jerger 2023-07-06 17:53:19 +02:00
parent 73a9a3ff6f
commit 5cd3a3b9fd
3 changed files with 59 additions and 7 deletions

20
.gitlab-ci.yml Normal file
View file

@ -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"

11
README.md Normal file
View file

@ -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
```

View file

@ -6,9 +6,6 @@ name = "buildtest"
MODULE = "release" MODULE = "release"
PROJECT_ROOT_PATH = "." PROJECT_ROOT_PATH = "."
class MyBuild(ReleaseMixin):
pass
@init @init
def initialize(project): def initialize(project):
@ -20,24 +17,48 @@ def initialize(project):
"project_root_path": PROJECT_ROOT_PATH, "project_root_path": PROJECT_ROOT_PATH,
"build_types": [], "build_types": [],
"mixin_types": ["RELEASE"], "mixin_types": ["RELEASE"],
"release_type": "MINOR",
"release_primary_build_file": "project.clj", "release_primary_build_file": "project.clj",
"release_secondary_build_files": ["package.json"], "release_secondary_build_files": ["package.json"],
} }
project.build_depends_on("ddadevops>=4.0.0-dev") project.build_depends_on("ddadevops>=4.0.0-dev")
build = MyBuild(project, input) build = ReleaseMixin(project, input)
build.initialize_build_dir() 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 @task
def prepare_release(project): def prepare_release(project):
build = get_devops_build(project) build = get_devops_build(project)
build.prepare_release() build.prepare_release()
@task @task
def after_publish(project): def tag_bump_and_push_release(project):
build = get_devops_build(project) build = get_devops_build(project)
build.tag_bump_and_push_release() build.tag_bump_and_push_release()
def build(project, release_type):
build = get_devops_build(project)
build.update_release_type(release_type)
nothing(project)