• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    Clojure
  • License
    Eclipse Public Li...
  • Created about 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Small configuration management tool for Clojure

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.

More Repositories

1

vim-iced

Clojure Interactive Development Environment for Vim8/Neovim
Vim Script
490
star
2

antq

Point out your outdated dependencies.
Clojure
334
star
3

misaki

Jekyll inspired static site generator in Clojure
Clojure
319
star
4

clj-jwt

Clojure library for JSON Web Token(JWT)
Clojure
119
star
5

jubot

Chatbot framework in Clojure
Clojure
68
star
6

build.edn

Make your Clojure library build process easy.
Clojure
63
star
7

merr

🔥 Minimal and good enough error handling library for Clojure/ClojureScript
Clojure
48
star
8

cuma

Extensible micro template engine for Clojure
Clojure
31
star
9

testdoc

Yet another doctest implementation in Clojure
Clojure
25
star
10

vivi.vim

Support to setup Elixir development environment in Vim.
Vim Script
22
star
11

babashka-test-action

Github Action to run clojure.test by Babashka
Clojure
14
star
12

clj-xmas

🎄 🎄 🎄
Clojure
14
star
13

iced-nrepl

nREPL middleware to support vim-iced.
Clojure
13
star
14

vim-iced-coc-source

vim-iced plugin for completing with coc.nvim
Vim Script
13
star
15

clj-gravatar

gravatar api wrapper for clojure
Clojure
9
star
16

vim-iced-fern-debugger

vim-iced debugging plugin powered by fern.vim
Vim Script
9
star
17

thrempl

A proof of concept for simple template engine using threading macros
Clojure
9
star
18

clj-vimhelp

Vim help file parser/convertor written by Clojure
Clojure
8
star
19

kaocha-nrepl

nREPL middleware for kaocha
Clojure
8
star
20

docker-asciidoctor-jp

Makefile
7
star
21

clj-text-decoration

Text decoration library
Clojure
7
star
22

frontmatter

Parse front matter from a file
Clojure
6
star
23

corne

Commandline argument parser for Common Lisp
Common Lisp
6
star
24

dps-parinfer

WIP
TypeScript
5
star
25

shelltest

Shell testing tool inspired by doctest.
Go
5
star
26

vim-iced-kaocha

vim-iced plugin for testing with kaocha
Vim Script
5
star
27

selenium-ide-pretty-report

JavaScript
5
star
28

ddu-source-custom-list

Custom list source for ddu.vim
TypeScript
5
star
29

gauche

source for gauche
Scheme
4
star
30

antq-action

Shell
4
star
31

deno-nrepl-client

TypeScript
4
star
32

clj-password-check

password checker library for clojure
Clojure
4
star
33

vim-textimer

Text based timer vim plugin heaviliy inspired by Efforless.
Vim Script
4
star
34

rewrite-indented

Clojure
4
star
35

vim-iced-project-namespaces

vim-iced plugin to jump to namespace in your project
Vim Script
4
star
36

liquidz

Clojure
4
star
37

lein-vim

vim plugin for leiningen
Vim Script
4
star
38

vim-icedon

TypeScript
4
star
39

misaki-markdown

Markdown Compiler for Misaki
Clojure
4
star
40

opera-widgets

source code for opera widgets
JavaScript
3
star
41

dotfiles

Vim Script
3
star
42

default

default repository
3
star
43

vimfiler-sendto

sendto plugin for vimfiler
Vim Script
3
star
44

misaki-clostache

misaki compiler using Clostache
Clojure
3
star
45

vim-iced-multi-session

vim-iced plugin to add support for multi session
Vim Script
3
star
46

template-scala-gae

scala project template for google app engine
Scala
3
star
47

pod-uochan-tarayo

Clojure
3
star
48

vim-iced-ddc-source

vim-iced plugin for completing with ddc.vim
TypeScript
3
star
49

debug-reader

Gauche like debug print reader
Clojure
3
star
50

liquidz.github.com

Clojure
3
star
51

Titanium-BookMemo

JavaScript
2
star
52

deno-bencode

Bencode decoder/encode for Deno
TypeScript
2
star
53

heroku-template

Clojure
2
star
54

neelm

Clojure
2
star
55

_dead_repo_pipette_

new_data = pipette(data, template)
Elixir
2
star
56

vim-iced-neil

vim-iced plugin to add support for babashka/neil
Vim Script
2
star
57

yuruyomi

lazy management tool for reading books
Clojure
2
star
58

lein-autotest-notify

leiningen plugin for auto testing and notifying test result with growl
Clojure
2
star
59

unitaskpapera

task paper clone for opera unite
JavaScript
2
star
60

lp

Lazy Presentation Tool
JavaScript
2
star
61

docker-heroku-toolbelt

Shell
2
star
62

namakemono

lazy language "NAMAKEMONO"
C
2
star
63

vim-iced-function-list

Vim Script
1
star
64

collepi

Clojure
1
star
65

plojuctor

presentation tool in clojure repl
Clojure
1
star
66

unite-bookmark-file

Vim Script
1
star
67

practical-compojure-sample

Clojure
1
star
68

family-bot

Elixir
1
star
69

kininaru-hon

Clojure
1
star
70

vim-elin

Clojure
1
star
71

clojure-twitter

twitter4j wrapper for clojure
Clojure
1
star
72

vim-iced-asyncomplete

vim-iced plugin for completing with asyncomplete.vim
Vim Script
1
star
73

vim-colors-uochan

Vim Script
1
star
74

favook

JavaScript
1
star
75

digitalocean

Makefile
1
star
76

kansobun

Clojure
1
star
77

clj-error-checker

Clojure
1
star
78

testframework

library package to build web application easily
Clojure
1
star
79

clojure-ical

icalendar library for clojure
Clojure
1
star
80

clj-htmltpl

Clojure
1
star
81

vim-file-to-file

A vim plugin to write part of a file to a separete file
Vim Script
1
star
82

unite-circleci

Unite candidates for CircleCI
Vim Script
1
star
83

cl-docset-generator

Common Lisp
1
star
84

clojure-simply

write clojure code more simply
Clojure
1
star
85

nrepl-json

nREPL JSON Transport
Clojure
1
star
86

clj-digest

digest functions for clojure
Clojure
1
star
87

jubot-sample

Clojure
1
star
88

clj-spymemcached

simple spymemcached wrapper
Clojure
1
star
89

mixi_app_test

JavaScript
1
star
90

clj-pretty-error

Library to controll exception and stack traces for Clojure
Clojure
1
star
91

smile-celtic

Clojure
1
star
92

lt-note

JavaScript
1
star
93

collepi-android

Java
1
star
94

hello-nrepl-middleware

Clojure
1
star
95

clj-path

Clojure
1
star
96

dps-paredit

TypeScript
1
star
97

docker-jupyter

Makefile
1
star
98

norosi

WIP: Notification, work logging, and etc.
Clojure
1
star