make tense in command descriptions more consistent

This commit is contained in:
Benjamin Atkin
2021-05-11 16:50:12 -04:00
committed by Jose Diaz-Gonzalez
parent 1b37774e05
commit 952036bbaa
10 changed files with 68 additions and 68 deletions

View File

@@ -5,7 +5,7 @@ set -eo pipefail
source "$PLUGIN_AVAILABLE_PATH/config/functions"
docker_ports_options() {
declare desc="Exports a list of exposed ports"
declare desc="export a list of exposed ports"
declare PORTS=("$@")
for ((i = 0; i < ${#PLUGIN_DATASTORE_PORTS[@]}; i++)); do
echo -n "-p ${PORTS[i]}:${PLUGIN_DATASTORE_PORTS[i]} "
@@ -13,13 +13,13 @@ docker_ports_options() {
}
get_container_ip() {
declare desc="Retrieves the ip address of a container"
declare desc="retrieve the ip address of a container"
declare CONTAINER_ID="$1"
docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$CONTAINER_ID" 2>/dev/null
}
get_database_name() {
declare desc="Retrieves a sanitized database name"
declare desc="retrieve a sanitized database name"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
@@ -31,7 +31,7 @@ get_database_name() {
}
get_random_ports() {
declare desc="Retrieves N random ports"
declare desc="retrieve N random ports"
declare iterations="${1:-1}"
for ((i = 0; i < iterations; i++)); do
local port=$RANDOM
@@ -50,19 +50,19 @@ get_random_ports() {
}
get_service_name() {
declare desc="Retrieves a docker service label"
declare desc="retrieve a docker service label"
declare SERVICE="$1"
echo "dokku.${PLUGIN_COMMAND_PREFIX}.$SERVICE"
}
get_url_from_config() {
declare desc="Retrieves a given _URL from a list of configuration variables"
declare desc="retrieve a given _URL from a list of configuration variables"
declare EXISTING_CONFIG="$1" CONFIG_VAR="$2"
echo "$EXISTING_CONFIG" | grep "$CONFIG_VAR" | sed "s/$CONFIG_VAR:\s*//" | xargs
}
is_container_status() {
declare desc="Returns 0 or 1 depending upon whether a given container has a certain status"
declare desc="return 0 or 1 depending upon whether a given container has a certain status"
declare CID="$1" STATUS="$2"
local TEMPLATE="{{.State.$STATUS}}"
local CONTAINER_STATUS=$(docker inspect -f "$TEMPLATE" "$CID" 2>/dev/null || true)
@@ -90,7 +90,7 @@ is_implemented_command() {
}
is_valid_service_name() {
declare desc="Validates a service name"
declare desc="validate a service name"
declare SERVICE="$1"
[[ -z "$SERVICE" ]] && return 1
@@ -102,7 +102,7 @@ is_valid_service_name() {
}
remove_from_links_file() {
declare desc="Removes an app from the service link file"
declare desc="remove an app from the service link file"
declare SERVICE="$1" APP="$2"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local LINKS_FILE="$SERVICE_ROOT/LINKS"
@@ -137,7 +137,7 @@ retry-docker-command() {
}
service_alternative_alias() {
declare desc="Retrieves an alternative alias for a service"
declare desc="retrieve an alternative alias for a service"
declare EXISTING_CONFIG="$1"
local COLORS=(AQUA BLACK BLUE FUCHSIA GRAY GREEN LIME MAROON NAVY OLIVE PURPLE RED SILVER TEAL WHITE YELLOW)
local ALIAS
@@ -154,7 +154,7 @@ service_alternative_alias() {
}
service_app_links() {
declare desc="Outputs all service links for a given app"
declare desc="output all service links for a given app"
declare APP="$1"
local SERVICE LINKED_APP
@@ -170,7 +170,7 @@ service_app_links() {
}
service_backup() {
declare desc="Creates a backup of a service to an existing s3 bucket"
declare desc="create a backup of a service to an existing s3 bucket"
declare SERVICE="$1" BUCKET_NAME="$2" USE_IAM_OPTIONAL_FLAG="$3"
local SERVICE_BACKUP_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup"
local BACKUP_ENCRYPTION_CONFIG_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup-encryption"
@@ -250,7 +250,7 @@ service_commit_config() {
}
service_backup_auth() {
declare desc="Sets up authentication"
declare desc="set up authentication"
declare SERVICE="$1" AWS_ACCESS_KEY_ID="$2" AWS_SECRET_ACCESS_KEY="$3" AWS_DEFAULT_REGION="$4" AWS_SIGNATURE_VERSION="$5" ENDPOINT_URL="$6"
local SERVICE_BACKUP_ROOT="$PLUGIN_DATA_ROOT/$SERVICE/backup"
@@ -272,7 +272,7 @@ service_backup_auth() {
}
service_backup_deauth() {
declare desc="Removes authentication"
declare desc="remove authentication"
declare SERVICE="$1"
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
local SERVICE_BACKUP_ROOT="${SERVICE_ROOT}/backup/"
@@ -310,7 +310,7 @@ service_backup_schedule_cat() {
}
service_backup_set_encryption() {
declare desc="Sets up backup encryption"
declare desc="set up backup encryption"
declare SERVICE="$1" ENCRYPTION_KEY="$2"
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/"
@@ -320,7 +320,7 @@ service_backup_set_encryption() {
}
service_backup_unschedule() {
declare desc="unschedules the backup of the service"
declare desc="unschedule the backup of the service"
declare SERVICE="$1"
local CRON_FILE="/etc/cron.d/dokku-${PLUGIN_COMMAND_PREFIX}-${SERVICE}"
@@ -328,7 +328,7 @@ service_backup_unschedule() {
}
service_backup_unset_encryption() {
declare desc="Removes backup encryption"
declare desc="remove backup encryption"
declare SERVICE="$1"
local SERVICE_ROOT="${PLUGIN_DATA_ROOT}/${SERVICE}"
local SERVICE_BACKUP_ENCRYPTION_ROOT="${SERVICE_ROOT}/backup-encryption/"
@@ -337,7 +337,7 @@ service_backup_unset_encryption() {
}
service_container_rm() {
declare desc="Stops a service and removes the running container"
declare desc="stop a service and remove the running container"
declare SERVICE="$1"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
local ID
@@ -357,14 +357,14 @@ service_container_rm() {
}
service_dns_hostname() {
declare desc="Retrieves the alias of a service"
declare desc="retrieve the alias of a service"
declare SERVICE="$1"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
echo "$SERVICE_NAME" | tr ._ -
}
service_enter() {
declare desc="enters running app container of specified proc type"
declare desc="enter running app container of specified proc type"
declare SERVICE="$1" && shift 1
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local ID="$(cat "$SERVICE_ROOT/ID")"
@@ -379,7 +379,7 @@ service_enter() {
}
service_exposed_ports() {
declare desc="Lists exposed ports for a service"
declare desc="list exposed ports for a service"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local PORT_FILE="$SERVICE_ROOT/PORT"
@@ -391,7 +391,7 @@ service_exposed_ports() {
}
service_image_exists() {
declare desc="Checks if the current image exists"
declare desc="check if the current image exists"
local IMAGE="$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
if [[ "$(docker images -q "$IMAGE" 2>/dev/null)" == "" ]]; then
@@ -402,7 +402,7 @@ service_image_exists() {
}
service_info() {
declare desc="Retrieves information about a given service"
declare desc="retrieve information about a given service"
declare SERVICE="$1" INFO_FLAG="$2"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local SERVICE_URL=$(service_url "$SERVICE")
@@ -442,7 +442,7 @@ service_info() {
}
service_is_linked() {
declare desc="Links a service to an application"
declare desc="link a service to an application"
declare SERVICE="$1" APP="$2"
update_plugin_scheme_for_app "$APP"
local SERVICE_URL=$(service_url "$SERVICE")
@@ -456,7 +456,7 @@ service_is_linked() {
}
service_link() {
declare desc="Links a service to an application"
declare desc="link a service to an application"
declare SERVICE="$1" APP="$2"
update_plugin_scheme_for_app "$APP"
local SERVICE_URL=$(service_url "$SERVICE")
@@ -501,7 +501,7 @@ service_link() {
}
service_linked_apps() {
declare desc="Lists all apps linked to a service for info output"
declare desc="list all apps linked to a service for info output"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local LINKS_FILE="$SERVICE_ROOT/LINKS"
@@ -513,7 +513,7 @@ service_linked_apps() {
}
service_links() {
declare desc="Lists all apps linked to a service"
declare desc="list all apps linked to a service"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local LINKS_FILE="$SERVICE_ROOT/LINKS"
@@ -525,7 +525,7 @@ service_links() {
}
service_list() {
declare desc="Lists all services and their status"
declare desc="list all services and their status"
local SERVICES=$(ls "$PLUGIN_DATA_ROOT" 2>/dev/null)
if [[ -z $SERVICES ]]; then
@@ -540,7 +540,7 @@ service_list() {
}
service_logs() {
declare desc="Displays logs for a service"
declare desc="display logs for a service"
declare SERVICE="$1" TAIL_FLAG="$2"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local ID=$(cat "$SERVICE_ROOT/ID")
@@ -629,7 +629,7 @@ service_parse_args() {
}
service_password() {
declare desc="Fetch the password for a service"
declare desc="fetch the password for a service"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local PASSWORD_FILE="$SERVICE_ROOT/PASSWORD"
@@ -639,7 +639,7 @@ service_password() {
}
service_root_password() {
declare desc="Fetch the root password for a service"
declare desc="fetch the root password for a service"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local PASSWORD_FILE="$SERVICE_ROOT/ROOTPASSWORD"
@@ -649,14 +649,14 @@ service_root_password() {
}
service_port_expose() {
declare desc="Wrapper for exposing service ports"
declare desc="wrapper for exposing service ports"
declare SERVICE="$1"
service_start "$SERVICE" "true"
service_port_unpause "$SERVICE" "true" "${@:2}"
}
service_port_pause() {
declare desc="Pauses service exposure"
declare desc="pause service exposure"
declare SERVICE="$1" LOG_FAIL="$2"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local EXPOSED_NAME="$(get_service_name "$SERVICE").ambassador"
@@ -686,7 +686,7 @@ service_port_pause() {
}
service_port_unexpose() {
declare desc="Wrapper for pausing exposed service ports"
declare desc="wrapper for pausing exposed service ports"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local PORT_FILE="$SERVICE_ROOT/PORT"
@@ -695,7 +695,7 @@ service_port_unexpose() {
}
service_port_unpause() {
declare desc="Starts service exposure"
declare desc="start service exposure"
declare SERVICE="$1" LOG_FAIL="$2"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
@@ -726,7 +726,7 @@ service_port_unpause() {
}
service_promote() {
declare desc="Promotes a secondary service to the primary env var"
declare desc="promote a secondary service to the primary env var"
declare SERVICE="$1" APP="$2"
local PLUGIN_DEFAULT_CONFIG_VAR="${PLUGIN_DEFAULT_ALIAS}_URL"
local EXISTING_CONFIG=$(config_all "$APP")
@@ -754,7 +754,7 @@ service_promote() {
}
service_set_alias() {
declare desc="Sets the alias in use for a service"
declare desc="sets the alias in use for a service"
declare SERVICE="$1" ALIAS="$2"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local ALIAS_FILE="$SERVICE_ROOT/ALIAS"
@@ -764,7 +764,7 @@ service_set_alias() {
}
service_status() {
declare desc="Displays the status of a service"
declare desc="display the status of a service"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local ID="$(cat "$SERVICE_ROOT/ID")"
@@ -776,7 +776,7 @@ service_status() {
}
service_stop() {
declare desc="Stops a running service"
declare desc="stop a running service"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
@@ -794,7 +794,7 @@ service_stop() {
}
service_unlink() {
declare desc="Unlinks an application from a service"
declare desc="unlink an application from a service"
declare SERVICE="$1" APP="$2"
update_plugin_scheme_for_app "$APP"
local SERVICE_URL=$(service_url "$SERVICE")
@@ -821,14 +821,14 @@ service_unlink() {
}
service_version() {
declare desc="Displays the running version for an image"
declare desc="display the running version for an image"
declare SERVICE="$1"
local SERVICE_NAME="$(get_service_name "$SERVICE")"
docker inspect -f '{{.Config.Image}}' "$SERVICE_NAME" 2>/dev/null || true
}
update_plugin_scheme_for_app() {
declare desc="Retrieves the updated plugin scheme"
declare desc="retrieve the updated plugin scheme"
declare APP="$1"
local DATABASE_SCHEME
@@ -837,7 +837,7 @@ update_plugin_scheme_for_app() {
}
verify_service_name() {
declare desc="Verifies that a service exists"
declare desc="verify that a service exists"
declare SERVICE="$1"
[[ -z "$SERVICE" ]] && dokku_log_fail "(verify_service_name) SERVICE must not be null"
[[ ! -d "$PLUGIN_DATA_ROOT/$SERVICE" ]] && dokku_log_fail "$PLUGIN_SERVICE service $SERVICE does not exist"
@@ -845,7 +845,7 @@ verify_service_name() {
}
write_database_name() {
declare desc="Writes a sanitized database name"
declare desc="write a sanitized database name"
declare SERVICE="$1"
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"