All Projects → liquidz → dad

liquidz / dad

Licence: EPL-2.0 license
Small configuration management tool for Clojure

Programming Languages

clojure
4091 projects
shell
77523 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to dad

dragon
DRAGON Stack manager
Stars: ✭ 20 (-83.61%)
Mutual labels:  graalvm
stein
A linter for config files with a customizable rule set
Stars: ✭ 92 (-24.59%)
Mutual labels:  infrastructure-as-code
vertx-graalvm-native-image-test
GraalVM - Substrate VM - Test project for Vert.x
Stars: ✭ 38 (-68.85%)
Mutual labels:  graalvm
terraform-pb
Programmatic management of infrastructure using Terraform and Protocol Buffers
Stars: ✭ 18 (-85.25%)
Mutual labels:  infrastructure-as-code
mysql-mle-demos
Demos for the MySQL Multi-Lingual Environment
Stars: ✭ 16 (-86.89%)
Mutual labels:  graalvm
aws-cfn-custom-resource-lambda-edge
🏗 AWS CloudFormation custom resource that allows deploying Lambda@Edge from any region
Stars: ✭ 19 (-84.43%)
Mutual labels:  infrastructure-as-code
tfu
tfu is a terraform helper to update the providers.
Stars: ✭ 13 (-89.34%)
Mutual labels:  infrastructure-as-code
mojito-admin-starter
此项目主要为了演示如何自动化 Fullstack project 的 Infrastructure。
Stars: ✭ 17 (-86.07%)
Mutual labels:  infrastructure-as-code
www.go.cd
Github pages repo
Stars: ✭ 39 (-68.03%)
Mutual labels:  infrastructure-as-code
scala-graalvm-lambda
Sample application of Native Scala with GraalVM.
Stars: ✭ 15 (-87.7%)
Mutual labels:  graalvm
one-click-microservice
A starting point for automating the creation of microservices and all its Ops costs with a single click.
Stars: ✭ 27 (-77.87%)
Mutual labels:  infrastructure-as-code
awesome-iac-testing
A list of awesome IaC testing articles, speeches & links. Especially about Ansible.
Stars: ✭ 56 (-54.1%)
Mutual labels:  infrastructure-as-code
aztack
Terraform module for creating Kubernetes clusters running on Azure
Stars: ✭ 69 (-43.44%)
Mutual labels:  infrastructure-as-code
nixcfg
My nix configuration(s), using flakes. It's my laptop, it's my servers, it's my everything, in code.
Stars: ✭ 44 (-63.93%)
Mutual labels:  infrastructure-as-code
aws-cloudformation-simplified
AWS CloudFormation - Simplified | Hands On Learning !!
Stars: ✭ 51 (-58.2%)
Mutual labels:  infrastructure-as-code
terraform-modules
Terraform Modules by Peak
Stars: ✭ 16 (-86.89%)
Mutual labels:  infrastructure-as-code
tools-deps-native
Run tools-deps-alpha as a native binary.
Stars: ✭ 30 (-75.41%)
Mutual labels:  graalvm
molecule-demo
Molecule for Ansible Role Testing Demonstration for AnsibleFest 2017
Stars: ✭ 18 (-85.25%)
Mutual labels:  infrastructure-as-code
springboot-keycloak-openldap
The goal of this project is to create a simple Spring Boot REST API, called simple-service, and secure it with Keycloak. Furthermore, the API users will be loaded into Keycloak from OpenLDAP server.
Stars: ✭ 96 (-21.31%)
Mutual labels:  graalvm
gruntwork-io.github.io
The gruntwork.io website
Stars: ✭ 38 (-68.85%)
Mutual labels:  infrastructure-as-code

Dad

badge badge badge dad

My father is a greate chef :)

Dad is a small configuration management tool for Clojure. This project is heavily inspired by mitamae.

Concept

🤯 Minimum to remember

  • May not write code for Dad often.

  • Write codes as a babashka pod.

    • You can gain benefits from code completion and docstring references.

🍟 Easy to start

  • Download single binary and run it.

  • Run the code written as a babashka pod as it is.

    • Dad ignores codes related to loading pods.

Getting Started

Download binary from releases.

# Download latest dad to the current working directory
curl -L https://raw.githubusercontent.com/liquidz/dad/main/script/download | bash
./dad your_task.clj

Here is a example to install Clojure command line tools.

You can generate a template file by ./dad --init example.core.

#!/usr/bin/env dad --no-color --dry-run
(ns example.core
  (:require
   [babashka.pods :as pods]))

;; Load dad as a babashka pod
(pods/load-pod "dad")
(require '[pod.liquidz.dad :as dad])

(dad/package {:name ["curl" "rlwrap"]})

;; You can define function as you like
(defn curl [m]
  (let [{:keys [path url]} m]
    ;; `file-exists?` is a built-in function in dad.
    (when (and (not (dad/file-exists? path))
               (string? url))
      (dad/execute {:command (str "curl -sfLo " path " " url)}))))

(curl {:path "/tmp/install.sh"
       :url "https://download.clojure.org/install/linux-install-1.10.3.1087.sh"})

(dad/file {:path "/tmp/install.sh" :mode "755"})
(dad/execute {:cwd "/tmp" :command "./install.sh"})
(dad/file {:path "/tmp/install.sh" :action :delete})

Supports

Reference

Note
You can refer all documents in codes. (evaluate (dad/doc) or (help))

Built-in vars / functions

Name Var/Func Description

doc

Func

Print dad documents.

file-exists?

Func

Return true if the specified path exists.

os-type

Func

OS name string such as "linux" or "mac".

render

Func

Render a template string with a data.

load-file

Func

Load another recipe file.

See sci/impl/namespaces.cljc for other core functions.

Resources

Resource name Description

directory

Create directories.

download

Download a file from remote host.

execute

Execute a shell command.

file

Create a file.

git

Execute git command.

link

Create a symbolic link.

package

Install packages.

template

Create a text file from the specified template files.

REPL

Dad also provides REPL mode that does not affect your environment. (same as --dry-run option)

$ dad --repl

user=> (println "hello from dad")
hello from dad
nil

user=> (+ 1 2 3)
6

user=> (package "sl")
apt-update [sl] ... will change
package-install [sl] ... will change

user=> (package "sl" {:action :uninstall})
package-uninstall [sl] ... WILL NOT change

License

Copyright © 2019-2022 Masashi Iizuka

This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.

This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].