Compare commits
39 commits
Author | SHA1 | Date | |
---|---|---|---|
|
0f6c2a5dcc | ||
|
f0b0fb958d | ||
|
def5427840 | ||
|
1e5c4d236d | ||
|
8f84454a84 | ||
|
67ed50a36f | ||
|
3860531bd4 | ||
|
52c65b54c2 | ||
|
e403015a30 | ||
|
60c5efe19b | ||
|
a7fbf02d7e | ||
|
82016d213b | ||
|
db0dde6251 | ||
|
b08e201a03 | ||
|
32ae618fd6 | ||
|
d48206f88c | ||
|
c356ddf7e3 | ||
|
07f901cd67 | ||
|
967aeb325a | ||
|
e6ebb0f9f4 | ||
|
67d5ddbae9 | ||
|
74a7137f00 | ||
|
01f730f648 | ||
|
ba17b46a01 | ||
|
0e5e5cc800 | ||
|
e25a682b3e | ||
|
c9675f5adf | ||
|
d86a6785f6 | ||
|
2dcf2ebebc | ||
|
90c3818d4a | ||
|
331dcaed69 | ||
|
1db967f690 | ||
|
fd546c0a5c | ||
|
67b18318ca | ||
|
be217035f2 | ||
|
318384979c | ||
|
7e89a94009 | ||
|
86dadb56a7 | ||
|
ce5cd6a245 |
5 changed files with 91 additions and 7 deletions
42
README.md
42
README.md
|
@ -1,3 +1,45 @@
|
||||||
|
This repo shows examples how dda-devops-build (https://repo.prod.meissa.de/meissa/dda-devops-build) can be used.
|
||||||
|
As a starting point, you may want to have a look at file [build.py](build.py) in this repo
|
||||||
|
and the tasks which are defined in this file.
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
You can trigger the build-task by
|
||||||
|
```
|
||||||
|
pyb dev
|
||||||
|
```
|
||||||
|
|
||||||
|
### Releases
|
||||||
|
|
||||||
|
With task `patch` you can create a patch-level release with one command, i.e. perform the following actions:
|
||||||
|
* create a commit for a patch-leve release version
|
||||||
|
* e.g. if current project version is 1.1.1-dev, the update version will be the release version 1.1.1
|
||||||
|
* the commit contains all build files specified in the build.py (primary as well as secondary build files),
|
||||||
|
where the primary build file contains the version number to be used for all build files
|
||||||
|
* create a tag for the release commit (e.g. tag 1.1.1 for the corresponding commit)
|
||||||
|
* a second commit for the next snapshot version (1.1.2-dev)
|
||||||
|
* push both commits and the tag to the remote git repo
|
||||||
|
|
||||||
|
```
|
||||||
|
pyb patch
|
||||||
|
```
|
||||||
|
|
||||||
|
Similarly you can create a minor or major version with:
|
||||||
|
|
||||||
|
```
|
||||||
|
pyb minor
|
||||||
|
```
|
||||||
|
resp.
|
||||||
|
```
|
||||||
|
pyb major
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Release Testing
|
# Release Testing
|
||||||
## NoRelease
|
## NoRelease
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
version = "3.4.3"
|
version = "4.0.1-SNAPSHOT"
|
||||||
group = "org.domaindrivenarchitecture.buildtest"
|
group = "org.domaindrivenarchitecture.buildtest"
|
||||||
|
|
||||||
|
|
||||||
|
|
50
build.py
50
build.py
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
from os import environ
|
from os import environ
|
||||||
from pybuilder.core import task, init
|
from pybuilder.core import task, init
|
||||||
from ddadevops import *
|
from ddadevops import *
|
||||||
|
@ -6,10 +7,29 @@ name = "buildtest"
|
||||||
MODULE = "release"
|
MODULE = "release"
|
||||||
PROJECT_ROOT_PATH = "."
|
PROJECT_ROOT_PATH = "."
|
||||||
|
|
||||||
version = "1.8.2"
|
version = "4.0.1-dev"
|
||||||
|
|
||||||
|
|
||||||
@init
|
@init
|
||||||
def initialize(project):
|
def initialize0(project):
|
||||||
|
"""
|
||||||
|
to avoid prompt for gopass if no artifacts need to be uploaded
|
||||||
|
usage: with option "-E ng" , e.g. "pyb -E artifacts patch_local"
|
||||||
|
"""
|
||||||
|
os.environ["RELEASE_ARTIFACT_TOKEN"] = "dummy" # avoids prompt for RELEASE_ARTIFACT_TOKEN
|
||||||
|
|
||||||
|
|
||||||
|
@init(environments=["artifacts"])
|
||||||
|
def initialize1(project):
|
||||||
|
"""
|
||||||
|
prompt for gopass if no artifacts need to be uploaded
|
||||||
|
usage: with option "-E artifacts" , e.g. "pyb -E artifacts patch_local"
|
||||||
|
"""
|
||||||
|
del os.environ["RELEASE_ARTIFACT_TOKEN"]
|
||||||
|
|
||||||
|
|
||||||
|
@init
|
||||||
|
def initialize2(project):
|
||||||
input = {
|
input = {
|
||||||
"name": name,
|
"name": name,
|
||||||
"module": MODULE,
|
"module": MODULE,
|
||||||
|
@ -18,7 +38,7 @@ def initialize(project):
|
||||||
"build_types": [],
|
"build_types": [],
|
||||||
"mixin_types": ["RELEASE"],
|
"mixin_types": ["RELEASE"],
|
||||||
"release_primary_build_file": "build_to_test.py",
|
"release_primary_build_file": "build_to_test.py",
|
||||||
"release_secondary_build_files": ["package.json", "project.clj", "build.gradle"],
|
"release_secondary_build_files": ["package.json", "project.clj", "build.gradle", "build.py"],
|
||||||
"release_artifacts": ["README.md"],
|
"release_artifacts": ["README.md"],
|
||||||
"release_artifact_server_url": "https://repo.prod.meissa.de",
|
"release_artifact_server_url": "https://repo.prod.meissa.de",
|
||||||
"release_organisation": "meissa",
|
"release_organisation": "meissa",
|
||||||
|
@ -26,25 +46,46 @@ def initialize(project):
|
||||||
}
|
}
|
||||||
|
|
||||||
project.build_depends_on("ddadevops>=4.10.7")
|
project.build_depends_on("ddadevops>=4.10.7")
|
||||||
|
|
||||||
build = ReleaseMixin(project, input)
|
build = ReleaseMixin(project, input)
|
||||||
build.initialize_build_dir()
|
build.initialize_build_dir()
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def patch(project):
|
def patch(project):
|
||||||
|
"""
|
||||||
|
updates version to next patch level, creates a tag, creates new SNAPSHOT version,
|
||||||
|
commits build files (primary and secondary) and pushes to remote
|
||||||
|
"""
|
||||||
linttest(project, "PATCH")
|
linttest(project, "PATCH")
|
||||||
release(project)
|
release(project)
|
||||||
|
|
||||||
|
|
||||||
|
@task
|
||||||
|
def patch_local(project):
|
||||||
|
"""
|
||||||
|
updates version to next patch level,
|
||||||
|
commits build files (primary and secondary), DOES NOT push to remote
|
||||||
|
"""
|
||||||
|
linttest(project, "PATCH")
|
||||||
|
prepare(project)
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def minor(project):
|
def minor(project):
|
||||||
|
"""
|
||||||
|
updates version to next minor level, creates a tag, creates new SNAPSHOT version,
|
||||||
|
commits build files (primary and secondary) and pushes to remote
|
||||||
|
"""
|
||||||
linttest(project, "MINOR")
|
linttest(project, "MINOR")
|
||||||
release(project)
|
release(project)
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def major(project):
|
def major(project):
|
||||||
|
"""
|
||||||
|
updates version to next major level, creates a tag, creates new SNAPSHOT version,
|
||||||
|
commits build files (primary and secondary) and pushes to remote
|
||||||
|
"""
|
||||||
linttest(project, "MAJOR")
|
linttest(project, "MAJOR")
|
||||||
release(project)
|
release(project)
|
||||||
|
|
||||||
|
@ -68,6 +109,7 @@ def tag(project):
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def publish_artifacts(project):
|
def publish_artifacts(project):
|
||||||
|
""" creates a release in <release_artifact_server_url> and uploads artifacts """
|
||||||
build = get_devops_build(project)
|
build = get_devops_build(project)
|
||||||
print("PROTECTED_TOKEN_EXAMPLE" in environ)
|
print("PROTECTED_TOKEN_EXAMPLE" in environ)
|
||||||
print(environ.get("PROTECTED_TOKEN_EXAMPLE"))
|
print(environ.get("PROTECTED_TOKEN_EXAMPLE"))
|
||||||
|
|
|
@ -33,7 +33,7 @@ default_task = "dev"
|
||||||
name = "ddadevops"
|
name = "ddadevops"
|
||||||
MODULE = "not-used"
|
MODULE = "not-used"
|
||||||
PROJECT_ROOT_PATH = "."
|
PROJECT_ROOT_PATH = "."
|
||||||
version = "3.4.3"
|
version = "4.0.1-dev"
|
||||||
summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud"
|
summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud"
|
||||||
description = __doc__
|
description = __doc__
|
||||||
authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")]
|
authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "c4k-jira",
|
"name": "c4k-jira",
|
||||||
"description": "Generate c4k yaml for a jira deployment.",
|
"description": "Generate c4k yaml for a jira deployment.",
|
||||||
"author": "meissa GmbH",
|
"author": "meissa GmbH",
|
||||||
"version": "3.4.3",
|
"version": "4.0.1-SNAPSHOT",
|
||||||
"homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-jira#readme",
|
"homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-jira#readme",
|
||||||
"repository": "https://www.npmjs.com/package/c4k-jira",
|
"repository": "https://www.npmjs.com/package/c4k-jira",
|
||||||
"license": "APACHE2",
|
"license": "APACHE2",
|
||||||
|
|
Loading…
Reference in a new issue