diff options
author | Patrick Spek <p.spek@tyil.nl> | 2022-04-25 13:23:44 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2022-04-25 13:23:44 +0200 |
commit | aeff0194ccb415904b1e37039e86a19f038dc708 (patch) | |
tree | 693eb4bfc55d845e4a978c4cdf4a253f310e646d | |
parent | fff6fb24c624d0e434481d641313c196b8254a82 (diff) |
Rename bootstrap to init
-rw-r--r-- | README.md | 18 | ||||
-rw-r--r-- | lib/main.bash | 16 | ||||
-rw-r--r-- | lib/subcommands/init.bash (renamed from lib/subcommands/bootstrap.bash) | 20 |
3 files changed, 27 insertions, 27 deletions
@@ -14,26 +14,26 @@ provided `Makefile`. make install -### Bootstrapping +### Initialization -When Bashtard is installed, the next step is bootstrapping the system. The -`bootstrap` subcommand will perform all necesary steps to create the desired -structure in `/etc/bashtard`. +When Bashtard is installed, the next step is initializing the system. The `init` +subcommand will perform all necesary steps to create the desired structure in +`/etc/bashtard`. - bashtard bootstrap + bashtard init It is recommended you create a `git` directory out of `/etc/bashtard` for -synchronization purposes. This will allow you to bootstrap Bashtard on other +synchronization purposes. This will allow you to initialize Bashtard on other systems by giving it the URL of the git repository as additional argument. - bashtard bootstrap https://git.tyil.nl/tyilnet.git + bashtard init https://git.tyil.nl/tyilnet.git With the additional argument, it will clone the repository to `/etc/bashtard`, -and then apply any additional steps for the machine you're bootstrapping. +and then apply any additional steps for the machine you're initping. ## General Usage -After bootstrapping, you can start using Bashtard. It has the concept of +After initializing, you can start using Bashtard. It has the concept of playbooks, which can either be local or cloned from a remote git repository. ### One-off updates 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 |