dda-devops-build
chat over e-mail |
meissa@social.meissa-gmbh.de | Blog | Website
dda-devops-build integrates all the tools we use to work with clouds & provide some nice functions around.
Tools we support are
- terraform: for setting up the plain infrastructure around.
- docker: for creating images
- c4k: for generating kubernetes manifests
- provs: for setting up small single-node k3s clusters
- gopass: for credential management on devops computers
- cloud providers: hetzner, digitalocean, aws
In addition we provide a ReleaseMixin for release related tasks like tag / publish & version-bump
classDiagram
class DevopsBuild {
name()
build_path()
initialize_build_dir()
}
class DevopsTerraformBuild {
initialize_build_dir()
post_build()
read_output_json()
plan()
plan_fail_on_diff()
apply(auto_approve=False)
refresh()
destroy(auto_approve=False)
tf_import(tf_import_name,tf_import_resource)
}
class DevopsImageBuild {
initialize_build_dir()
image()
drun()
dockerhub_login()
dockerhub_publish()
test()
}
class ReleaseMixin {
prepare_release()
tag_and_push_release()
}
class ProvsK3sBuild {
def update_runtime_config(dns_record)
write_provs_config()
provs_apply(dry_run=False)
}
class C4kBuild {
def update_runtime_config(dns_record)
def write_c4k_config()
def write_c4k_auth()
c4k_apply(dry_run=False)
}
DevopsBuild <|-- DevopsImageBuild
DevopsBuild <|-- DevopsTerraformBuild
DevopsBuild <|-- ReleaseMixin
DevopsBuild <|-- ProvsK3sBuild
DevopsBuild <|-- C4kBuild
link DevopsBuild "dda-devops-build/src/doc/DevopsBuild.md"
link DevopsImageBuild "dda-devops-build/src/doc/DevopsImageBuild.md"
link DevopsTerraformBuild "dda-devops-build/src/doc/DevopsTerraformBuild.md"
link ReleaseMixin "dda-devops-build/src/doc/ReleaseMixin.md"
link ProvsK3sBuild "dda-devops-build/src/doc/ProvsK3sBuild.md"
link C4kBuild "dda-devops-build/src/doc/C4kBuild.md"
Principles we follow are:
- Seperate build artefacts from version controlled code
- Domain Driven Design - in order to stay sustainable
Example Project
An example project which is using dda-devops-build can be found at: https://repo.prod.meissa.de/meissa/buildtest
Installation
Ensure that yout python3 version is at least Python 3.10
sudo apt install python3-pip
pip3 install -r requirements.txt
export PATH=$PATH:~/.local/bin
Example Project
An example project which is using dda-devops-build can be found at: https://repo.prod.meissa.de/meissa/buildtest
Example Build
lets assume the following project structure
my-project
| -> my-module
| | -> build.py
| | -> some-terraform.tf
| -> an-other-module
| -> target (here will the build happen)
| | -> ...
from pybuilder.core import task, init
from ddadevops import *
name = 'my-project'
MODULE = 'my-module'
PROJECT_ROOT_PATH = '..'
@init
def initialize(project):
project.build_depends_on("ddadevops>=4.0.0-dev")
config = {
"credentials_mapping": [
{
"gopass_path": environ.get("DIGITALOCEAN_TOKEN_KEY_PATH", None),
"name": "do_api_key",
},
{
"gopass_path": environ.get("HETZNER_API_KEY_PATH", None),
"name": "hetzner_api_key",
},
],
"name": name,
"module": MODULE,
"stage": environ["STAGE"],
"project_root_path": PROJECT_ROOT_PATH,
"build_types": ["TERRAFORM"],
"mixin_types": [],
"tf_provider_types": ["DIGITALOCEAN", "HETZNER"],
"tf_use_workspace": False,
"tf_terraform_semantic_version": "1.4.2",
"do_as_backend": True,
"do_bucket": "your-bucket",
}
build = DevopsTerraformBuild(project, config)
build.initialize_build_dir()
@task
def plan(project):
build = get_devops_build(project)
build.plan()
@task
def apply(project):
build = get_devops_build(project)
build.apply(True)
@task
def destroy(project):
build = get_devops_build(project)
build.destroy(True)
Snapshot & Release
pyb dev publish upload
pip3 install --upgrade ddadevops --pre
pyb [patch|minor|major]
pip3 install --upgrade ddadevops
Reference
Development & mirrors
Development happens at: https://repo.prod.meissa.de/meissa/dda-devops-build
Mirrors are:
- https://codeberg.org/meissa/dda-devops-build (issues and PR)
- https://gitlab.com/domaindrivenarchitecture/dda-devops-build (CI)
For more details about our repository model see: https://repo.prod.meissa.de/meissa/federate-your-repos
License
Copyright © 2021-26 meissa GmbH Licensed under the Apache License, Version 2.0 (the "License")
Metadata
Release files for ddadevops 4.17.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ddadevops-4.17.0.tar.gz | 30.5 kB | Without provenance | Details for ddadevops-4.17.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ddadevops-4.17.0-py3-none-any.whl | Python 3 | none | any | Details for ddadevops-4.17.0-py3-none-any.whl |
Total release size: 72.9 kB
Release files / ddadevops-4.17.0.tar.gz
| Download URL | ddadevops-4.17.0.tar.gz |
|---|---|
| Size | 30.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64abe8f4f885c14a1521be6713a683b89ebd2370158a366ad59ac6fae4f2e8a3
|
|
BLAKE2b-256 checksum How to use checksums |
e2e3fe17beb96982dfbf29d21f0dfb24420be62bd84b7922f953308cc4ce92ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.20
|
Release files / ddadevops-4.17.0-py3-none-any.whl
| Download URL | ddadevops-4.17.0-py3-none-any.whl |
|---|---|
| Size | 42.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a9c79854f2a9dce053b5095d6023a10685a89e980be8b1d479adde0d31c3d39
|
|
BLAKE2b-256 checksum How to use checksums |
648e82b13d75c28d2fdaf6efa85ff7fa5249ed3f167bb1339c5eca4779b8ef39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.20
|
Security for ddadevops 4.17.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.