-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hourly tips to help discover and learn subcommands
New subcommand added as a hook and reordered some hooks Fixes #129
- Loading branch information
Showing
13 changed files
with
142 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh | ||
# Description: Display a tip, you may define custom tips by adding to the config key 'tips/custom' | ||
# vim: ft=sh ts=4 sw=4 sts=4 noet | ||
set -euf | ||
|
||
# shellcheck disable=SC1091 | ||
. ./lib/config.sh | ||
|
||
TIPS=" | ||
Tips can be disabled by setting the environment variable \$DAB_TIPS to 'no' | ||
Use 'dab repo list' to see which repositories are not on origin/master | ||
Try 'dab tools portainer' to manage and monitor docker containers in your browser | ||
Did you know the dab configuration is a tree structure, run 'dab config keys' to explore it | ||
You can explore the dab container with 'dab shell' which is helpful for testing commands | ||
You can explore the dab lab network with 'dab network shell' | ||
You do not need to do anything to ensure you are using the latest version of dab, but can trigger an update with 'dab update' | ||
Each repository can have any number of entrypoints defined | ||
Repository entry points can take parameters for extra customizability | ||
Services are backround applications that your repositories may want to build upon, see what is availale with 'dab services list' | ||
Tools provide helpful interfaces for accomplishing devops tasks, see what is available with 'dab tools list' | ||
Any git repository can be managed and orchestrated by Dab, even if it does not need to start a service | ||
When a group depends on a repositry you can give an additional parameter after name to customize the enrypoint that will be executed | ||
Services and Tools persist data by default where appropriate, if you want to wipe data try 'dab tools destroy' or 'dab services destroy' | ||
A public key infrastructure (pki) and secrets management engine backed by Hashicorp Vault and Consul is provided that persists across reboots | ||
The public key infrastructure (pki) is able to issue x509 certificates suitable for HTTPS that are only renewed when neccesary | ||
The public key infrastructure (pki) will generate a certificate authority only once (unless destroyed) and automatically install it into all local browsers | ||
Most Services and Tools have docker health checks so you can see at a glance if dependencies are behaving correctly | ||
Dab creates a customizable lab network, any container's your repositories starts should connect to it for instrumentation and tooling | ||
The lab network can be rebuilt with 'dab network recreate' with little ill effect as all containers are first detached then reattached to the new network | ||
Repository entry points might use \$DAB_UID and \$DAB_GID environment variables when running docker containers with bind mounts to prevent permissions issues | ||
You can set environment variables for all users of your config by setting for example the 'enironment/FOO' config key which defined the \$FOO environment variable | ||
You may specify custom tips specific to your config by adding to the 'tips/custom' config key one tip per line | ||
You may specify specific versions of services by setting an environment variable such as \$DAB_SERVICES_VAULT_TAG to a valid docker tag for the vault docker image for example | ||
You may specify specific versions of tools by setting an environment variable such as \$DAB_SERVICES_KIBANA_TAG to a valid docker tag for the kibana docker image for example | ||
Dab provides tab completion for bash, zsh, and fish which is automatically updated. For more information try 'dab completion' | ||
Groups are a collection of other groups, services, repositories, and tools that get started in that order | ||
Group dependencies are in First In First Out (FIFO) order making the top of the list the first to run | ||
To view the history of dab run 'dab changelog' | ||
Every subcommand accepts '-h' or '--help' or just 'help' to display usage information | ||
Every subcommand accepts '-v' or '--version' or just 'version' to display version and machine information | ||
Should you wish to wipe your public key infrustructure and certificate authority and start fresh you may run 'dab pki destroy' | ||
x509 Certificates are stored in the dab config for example the key 'pki/ca/certificate' for the certificate authority | ||
If you are running the built in influxdb service then all dab runs will be recorded as metric annotations | ||
Tools and Services can be updated to their latest image with 'dab tools update' and 'dab services update' respectively | ||
When a group is started all services and tools it depends on are first checked for updates | ||
Some Tools require specific services to be running, if so they will display it in 'dab tools list' | ||
Check the running service's statuses with 'dab services status' | ||
Check the running tools's statuses with 'dab tools status' | ||
Check the running service's logs with 'dab services logs' | ||
Check the running tools's logs with 'dab tools logs' | ||
" | ||
|
||
get_tip_corpus() { | ||
echo "$TIPS" | sed '/^\s*$/d' | awk '{ print "[tips:dab] " $0 }' | ||
config_get tips/custom | sed '/^\s*$/d' | awk '{ print "[tips:custom] " $0 }' | ||
} | ||
|
||
get_tip() { | ||
get_tip_corpus | sed '/^\s*$/d' | shuf -n 1 | ||
} | ||
|
||
echo_color "$COLOR_PURPLE" "$(get_tip)!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters