No description
Find a file
2024-09-06 10:44:55 +02:00
dev template 2024-07-26 17:46:37 +02:00
doc rename folder docs -> doc & add goals.md 2024-09-06 10:44:55 +02:00
src/dda add image install support fkts 2024-08-23 08:44:49 +02:00
test/dda/build parse output 2024-08-14 20:06:47 +02:00
.cljstyle template 2024-07-26 17:46:37 +02:00
.dir-locals.el template 2024-07-26 17:46:37 +02:00
.envrc add envrc 2024-07-26 17:47:40 +02:00
.gitattributes template 2024-07-26 17:46:37 +02:00
.gitignore rename folder docs -> doc & add goals.md 2024-09-06 10:44:55 +02:00
build.clj rename to dda-build 2024-08-16 08:16:41 +02:00
CHANGELOG.md template 2024-07-26 17:46:37 +02:00
deps.edn rename to dda-build 2024-08-16 08:16:41 +02:00
LICENSE template 2024-07-26 17:46:37 +02:00
Makefile template 2024-07-26 17:46:37 +02:00
pom.xml initial 2024-07-26 17:46:51 +02:00
README.md rename to dda-build 2024-08-16 08:28:38 +02:00
tests.edn template 2024-07-26 17:46:37 +02:00

dda-build

Clojars Project pipeline status

DeltaChat chat over e-mail | M meissa@social.meissa-gmbh.de | Blog | Website

Rationale

build integrates all the tools we use to work with development & clouds. We know many build tools like ant, gradle, mvn, make, leiningen or pybuilder.

But we have chosen to create & use one more due to this reasons:

  • No immature scripting languages: Our builds tend to be complex. So we decided that implementing build is worth to be done in real dev-language like clojure.
  • Fast runtime: We like runtime with simple setup & fast startup. For this reason we've chosen babashka
  • Input validation: We believe in good input validation & good messages. For this reason we use the coole clojure-spec for build config.
  • Fast feedback: The DevOps experience local compared to CI should be as equal as possible. We like working local for fast feedback cycles.
  • No source pollution: All generation stuff happens in a separated build dir.
  • Tool Support: As DevOps we are using many tools, all of them should be supported:
    • gitops & direnv: State of environments and systems is represented by a git repo. State is applied automatically.
    • terragrunt + opentofu: For setting up the plain infrastructure around.
    • docker + podman: For creating images
    • c4k-* or helm: For generating kubernetes manifests
    • provs: For one-shoot setup small single-node k3s clusters and a first application.
    • gopass: For credential management on devops computers
    • cloud providers: hetzner, digitalocean or aws

Status

Unstable

Try out

We use direnv for setting the environments:

export STAGE=test
export HETZNER_API_KEY=$(gopass show path-to-hetzner-api-token)
export DO_API_KEY=$(gopass show path-to-do-api-key)
export DO_SPACES_ACCESS_ID=$(gopass show path-to-do-s3-key id)
export DO_SPACES_SECRET_KEY=$(gopass show path-to-do-s3-key secret)
export TERRAGRUNT_TFPATH=tofu
export TERRAGRUNT_DOWNLOAD=~/.terragrunt
export TERRAGRUNT_PROVIDER_CACHE=1

Build taske looks like this:

{:deps {org.clojure/spec.alpha {:mvn/version "0.4.233"}
        orchestra/orchestra {:mvn/version "2021.01.01-1"}
        org.domaindrivenarchitecture/build {:mvn/version "0.1.1-SNAPSHOT"}}
 :tasks
 {:init (do (def project {:name "test"
                          :module (first *command-line-args*)
                          :project-root-path "../../.."
                          :build-dir-name "target"
                          :version "4.11.8-dev"
                          :debug true}))
  plan
  {:requires ([dda.build.terragrunt :as tg])
   :task (tg/plan! project)}
  apply
  {:requires ([dda.build.terragrunt :as tg])
   :task (tg/apply! project)}
  destroy
  {:requires ([dda.build.terragrunt :as tg])
   :task (tg/destroy! project)}}}

Execute the build

bb plan [module]

The gitops dir layout looks like

.
├── infrastructure
│   └── tenant
│       ├── prod
│       └── test
│           ├── bb.edn
│           ├── jitsi
│           │   ├── main.tf
│           │   └── terragrunt.hcl
│           ├── statistics
│           │   ├── main.tf
│           │   └── terragrunt.hcl
│           └── terragrunt.hcl
├── modules
│   └── app
│       ├── main.tf
│       ├── registry.tf
│       ├── remote_state.tf
│       └── variables.tf
└── target
    └── test
        ├── jitsi
        │   ├── generated_backend.tf
        │   ├── generated_provider.tf
        │   ├── generated_registry.tf
        │   ├── generated_variables.tf
        │   ├── main.tf
        │   └── terragrunt.hcl
        └── terragrunt.hcl

Development & mirrors

Development happens at: https://repo.prod.meissa.de/meissa/build

Mirrors are:

For more details about our repository model see: https://repo.prod.meissa.de/meissa/federate-your-repos

License

Copyright © 2024 meissa GmbH Licensed under the Apache License, Version 2.0 (the "License") Pls. find licenses of our subcomponents here