aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-04-25 13:23:44 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-04-25 13:23:44 +0200
commitaeff0194ccb415904b1e37039e86a19f038dc708 (patch)
tree693eb4bfc55d845e4a978c4cdf4a253f310e646d /lib
parentfff6fb24c624d0e434481d641313c196b8254a82 (diff)
Rename bootstrap to init
Diffstat (limited to 'lib')
-rw-r--r--lib/main.bash16
-rw-r--r--lib/subcommands/init.bash (renamed from lib/subcommands/bootstrap.bash)20
2 files changed, 18 insertions, 18 deletions
diff --git a/lib/main.bash b/lib/main.bash
index 9a2d676..b5d6cc3 100644
--- a/lib/main.bash
+++ b/lib/main.bash
@@ -76,8 +76,8 @@ usage() {
Usage:
$BASHTARD_NAME -h
$BASHTARD_NAME add <playbook>
- $BASHTARD_NAME bootstrap [repository]
$BASHTARD_NAME del <playbook>
+ $BASHTARD_NAME init [repository]
$BASHTARD_NAME ssh <command>
$BASHTARD_NAME sync [playbook]
$BASHTARD_NAME sysinfo
@@ -85,13 +85,13 @@ Usage:
Perform maintenance on your infra.
Commands:
- add Add a configuration playbook to this machine.
- bootstrap Bootstrap the $BASHTARD_NAME configuration system.
- del Remove a configuration playbook from this machine.
- ssh Run a given command on all known hosts.
- sync Pull latest changes through git, and synchronize all added
- playbooks.
- sysinfo Show gathered information about this system.
+ add Add a configuration playbook to this machine.
+ init Initialize the $BASHTARD_NAME configuration system.
+ del Remove a configuration playbook from this machine.
+ ssh Run a given command on all known hosts.
+ sync Pull latest changes through git, and synchronize all added
+ playbooks.
+ sysinfo Show gathered information about this system.
Playbooks:
EOF
diff --git a/lib/subcommands/bootstrap.bash b/lib/subcommands/init.bash
index 5a0f4ae..9194076 100644
--- a/lib/subcommands/bootstrap.bash
+++ b/lib/subcommands/init.bash
@@ -10,15 +10,15 @@ subcommand()
if [[ -z "$remote" ]]
then
- info "bootstrap" "No remote given, bootstrapping from scratch"
- bootstrap_local
+ info "init" "No remote given, initping from scratch"
+ init_local
return
fi
- bootstrap_remote "$remote"
+ init_remote "$remote"
}
-bootstrap_local()
+init_local()
{
local dirs=(
"$BASHTARD_ETCDIR"
@@ -39,22 +39,22 @@ bootstrap_local()
for dir in "${dirs[@]}"
do
- notice "bashtard/bootstrap" "Creating $dir"
+ notice "bashtard/init" "Creating $dir"
mkdir -p -- "$dir"
done
for file in "${files[@]}"
do
- notice "bashtard/bootstrap" "Creating $file"
+ notice "bashtard/init" "Creating $file"
touch -- "$file"
done
}
-bootstrap_remote()
+init_remote()
{
local remote="$1" ; shift
- notice "bootstrap" "Cloning $remote to $BASHTARD_ETCDIR"
+ notice "init" "Cloning $remote to $BASHTARD_ETCDIR"
git clone "$remote" "$BASHTARD_ETCDIR"
local files=(
@@ -67,13 +67,13 @@ bootstrap_remote()
do
[[ -f "$file" ]] && continue
- notice "bashtard/bootstrap" "Creating $file"
+ notice "bashtard/init" "Creating $file"
touch -- "$file"
done
while read -r playbook url _
do
- notice "bashtard/bootstrap" "Cloning $playbook from $url"
+ notice "bashtard/init" "Cloning $playbook from $url"
git clone "$url" "$BASHTARD_ETCDIR/playbooks.d/$playbook"
# TODO: Clone appropriate branch