data pipeline refactor and fix
This commit is contained in:
@@ -21,6 +21,10 @@ usage() {
|
||||
}
|
||||
|
||||
ENV="${1:-dev}"
|
||||
ARG_EMAIL="${2:-}"
|
||||
ARG_PASSWORD="${3:-}"
|
||||
ARG_NAME="${4:-}"
|
||||
ARG_LICENSE="${5:-}"
|
||||
|
||||
if [[ "$ENV" != "dev" && "$ENV" != "prod" ]]; then
|
||||
echo -e "${RED}Error: Environment must be 'dev' or 'prod'${NC}"
|
||||
@@ -44,16 +48,36 @@ if [ -z "$PG_POD" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prompt for credentials
|
||||
read -p "Email: " USER_EMAIL
|
||||
read -rs -p "Password (min 8 chars): " USER_PASSWORD
|
||||
echo ""
|
||||
# Get credentials — from args or interactively
|
||||
if [[ -n "$ARG_EMAIL" ]]; then
|
||||
USER_EMAIL="$ARG_EMAIL"
|
||||
else
|
||||
read -p "Email: " USER_EMAIL
|
||||
fi
|
||||
|
||||
if [[ -n "$ARG_PASSWORD" ]]; then
|
||||
USER_PASSWORD="$ARG_PASSWORD"
|
||||
else
|
||||
read -rs -p "Password (min 8 chars): " USER_PASSWORD
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if [[ ${#USER_PASSWORD} -lt 8 ]]; then
|
||||
echo -e "${RED}✗ Password must be at least 8 characters${NC}"
|
||||
exit 1
|
||||
fi
|
||||
read -p "Display name: " USER_NAME
|
||||
read -p "License type [free|pro|enterprise] (default: pro): " LICENSE_TYPE
|
||||
|
||||
if [[ -n "$ARG_NAME" ]]; then
|
||||
USER_NAME="$ARG_NAME"
|
||||
else
|
||||
read -p "Display name: " USER_NAME
|
||||
fi
|
||||
|
||||
if [[ -n "$ARG_LICENSE" ]]; then
|
||||
LICENSE_TYPE="$ARG_LICENSE"
|
||||
else
|
||||
read -p "License type [free|pro|enterprise] (default: pro): " LICENSE_TYPE
|
||||
fi
|
||||
LICENSE_TYPE="${LICENSE_TYPE:-pro}"
|
||||
|
||||
# Check if user already exists
|
||||
|
||||
Reference in New Issue
Block a user