Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d297e13
Some rework and better extension management
user-54dbb57a Dec 8, 2024
b2c688d
support for sub-profiles
user-54dbb57a Dec 25, 2024
37c8f21
formatting adjustments in test system
user-54dbb57a Dec 28, 2024
515cde0
config improvements: Switches --set / --get can now be implicit
user-54dbb57a Dec 26, 2024
32817b3
support for exported config variables
user-54dbb57a Dec 26, 2024
beaf954
New top level command "shell"
user-54dbb57a Dec 26, 2024
7ce62d4
Small adjustment in ent-kubectl (status infomation)
user-54dbb57a Dec 28, 2024
447d824
Shellcheck adjustments
user-54dbb57a Dec 28, 2024
0c2f638
Shellcheck fixes
user-54dbb57a Dec 28, 2024
3ee0fc7
Fix: in ent-config multiline value error should not delete the variable
user-54dbb57a Dec 29, 2024
72345d8
fixed tty-bound profile selection
user-54dbb57a Feb 27, 2025
974b50a
minor fixes on shell auto-completion
user-54dbb57a Feb 27, 2025
ebaa2da
Support for completion for extension commands
user-54dbb57a Feb 27, 2025
c4b73af
ENG-5564 entando-bundle-cli must use the user nodejs
user-54dbb57a Jun 26, 2025
697626c
support for ent trace
user-54dbb57a Jul 2, 2025
6d4dde8
Profile deletion fixed under MacOS
user-54dbb57a Jul 2, 2025
01cc0fc
SubProfile fixes
user-54dbb57a Jul 3, 2025
20a07e7
Merge pull request #78 from entando/ENG-5564
user-54dbb57a Jul 3, 2025
a34e321
ENG-5564 fixed the entando-bundle-cli default installation mode
user-54dbb57a Jul 3, 2025
6f820b7
Merge pull request #79 from entando/ENG-5564-fix1
user-54dbb57a Jul 3, 2025
61012d0
Remove debug print in ent-check-env
user-54dbb57a Jul 5, 2025
ae077c4
Merge pull request #80 from entando/Remove-debug-print-in-ent-check-env
user-54dbb57a Jul 5, 2025
88124ea
ENG-5564 support for BASE DEVELOP check envmode
user-54dbb57a Jul 5, 2025
5ed9f38
Merge pull request #81 from entando/ENG-5564-fix2
user-54dbb57a Jul 5, 2025
44f38b2
ENG-5564 fixed check-env base-develop
user-54dbb57a Jul 8, 2025
7a8268b
ESB-666 The entando-cli should be able to autodetermine the applicati…
user-54dbb57a Jul 9, 2025
037d69c
ENG-5564 check-env source mode to avoid running tests
user-54dbb57a Jul 9, 2025
b31b72c
auto-discovery app name:
Nov 19, 2025
2bbcaf4
nodejs user:
Nov 19, 2025
d511345
fix reset profile variable ENTANDO_APPNAME when app-info fails, fix a…
Nov 21, 2025
a6c41cc
fix save_cfg_value failed
ffalqui Dec 10, 2025
d59e546
fix ent-app-info quickstart
ffalqui Dec 10, 2025
e3c9670
fix installation of jhipster in user nodejs
ffalqui Dec 17, 2025
1f4e04d
Merge pull request #82 from entando/ENG-5564-fix3
ffalqui Feb 18, 2026
548f602
release v7.5.0
ffalqui May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-test-workflow.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: "shellcheck main"
run: ./prj/run-shellcheck.sh
- name: "shellcheck standalones"
run: shellcheck --exclude "SC2181,SC2155,SC2119,SC2031" activate && shellcheck --exclude "SC2181,SC2155,SC2119,SC2031" deactivate
run: shellcheck --exclude "SC2181,SC2155,SC2119,SC2031,SC2317" activate && shellcheck --exclude "SC2181,SC2155,SC2119,SC2031,SC2317" deactivate
tests:
strategy:
matrix:
Expand Down
Empty file modified .github/workflows/multi-arch.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified Dockerfile.GitHub
100644 → 100755
Empty file.
Empty file modified Dockerfile.OCP
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified activate-auto
100644 → 100755
Empty file.
256 changes: 30 additions & 226 deletions bin/ent
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#H::
#H:: Built-in Scripts:

# The directory from which ent was called
# shellcheck disable=SC2034
ENT_ORIGIN_WORKDIR="$PWD"
ENT_CALLER_DIR="$PWD"
ENT_CALLER_PATH="$PATH"

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN() {
upgrade_project_file "$C_ENT_PRJ_FILE" "$C_ENT_OLD_PRJ_FILE"
Expand All @@ -27,8 +27,12 @@ RUN() {
while true; do
cmd="$1"
export ENTANDO_CLI_COMMAND="$1"
cmd=$(_resolve_alias "$cmd")

shift

[ "$ENTANDO_ENT_TRACE" == "true" ] && set -x

case "$cmd" in
"version") #H: shows the version of the current ent
which_ent version
Expand All @@ -55,12 +59,15 @@ RUN() {
handle_status_config ENTANDO_APPVER "$@"
;;
"appname") #H: sets the default application names
handle_status_config ENTANDO_APPNAME "$@"
handle_appname "$@"
;;
"profile"|"P"|"pro") #H: helps creating and managing profiles
# shellcheck disable=SC1090
source "$ENTANDO_ENT_HOME/bin/mod/ent-profile" "$@"
;;
"sub-profile"|"SP"|"subpro") #H: helps creating and managing sub-profiles
_shortcut_subpro "$@"
;;
"attach-vm") #H: [vm-name] -- attach ent to a ent-managed VM
managed-vm-attach "$@"
;;
Expand Down Expand Up @@ -126,18 +133,21 @@ RUN() {
"jhipster"|"bundler"|"bundle")
_ent node-cmd-wrapper "$cmd" "ENT wrapper for the node command \"$cmd\"" "$@"
;;
"pkg") #H: helps dealing with the ent bin tools
_ent.pkg "$@"
;;
"crane"|"docker"|"jq"|"k9s")
_ent.pkg run "$cmd" "$@"
;;
"use") #H: shortcut to "ent pro use"
_ent pro use "$@"
;;
"shell") #H: runs a shell that inherits the ent environment
run-sun-shell "$@"
;;
"load-module")
ent-load-extension-module "$@"
;;
"trace")
ent-trace "$@"
;;
"")
# shellcheck disable=SC1091
_source_ent help
Expand All @@ -146,31 +156,15 @@ RUN() {
cmplt
;;
*)
[ "$cmd" = "k" ] && cmd="kubectl"

local FOUND=false RV=0

local mod_script="${ENTANDO_ENT_HOME}/bin/mod/ent-${cmd}"

if [ -f "$mod_script" ]; then
FOUND=true
# shellcheck disable=SC1090
source "$mod_script" "$@"
RV="$?"
_execute_script "$cmd" "$@"
RV="$?"
if [ "$RV" = "33" ]; then
_log_e "Unrecognized ent module or command \"$cmd\""
elif [ "$RV" = "34" ]; then
_log_e "Unrecognized ent command \"$1\" for module \"$cmd\""
else
local ext_mod_script="$ENTANDO_ENT_EXTENSIONS_MODULES_PATH/ent-${cmd}"
if _ent.extension-module.is-present "$cmd"; then
FOUND=true
_ent.extension-module.execute "${cmd}" "$@"
fi
return "${RV:-1}"
fi

! $FOUND && {
_log_e "Unrecognized ent command \"$cmd\""
return 33
}

(exit "$RV")
;;
esac
_SOE
Expand All @@ -180,172 +174,13 @@ RUN() {
done
}

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ent-load-extension-module() {
(
local REPO NAME BRANCH
args_or_ask -h "$HH" -a -n -- REPO '1/git_repo//%sp repository of the module' "$@"
args_or_ask -h "$HH" -n -- NAME '--name/strict_file_name//%sp name of the module' "$@"
args_or_ask -h "$HH" -n -- BRANCH '--branch/dn//%sp branch to use instead of the default one' "$@"
end_help_parsing

DIRNAME="$(basename "$REPO")"
[ -z "$NAME" ] && NAME="$DIRNAME"

local EXT_DIR="${ENTANDO_ENT_HOME}/bin/mod/ext"
mkdir -p "$EXT_DIR"
__cd "$EXT_DIR"
if [[ "$PWD" = *".entando"* ]]; then
[ -d "$DIRNAME" ] && rm -rf "$DIRNAME"
git clone --depth=1 ${BRANCH:+-b "$BRANCH"} --single-branch "$REPO"
cp -p -- "$PWD/$DIRNAME/mod/"* .
else
_FATAL "Extension module cleanup: Refusing to delete a non entando-cli dir"
fi
)
}

which_ent() {
_resolve_alias() {
case "$1" in
version) echo "${ENTANDO_CLI_VERSION}"; return;;
which) echo "${ENTANDO_CLI_VERSION}";;
home) echo "$ENTANDO_ENT_HOME"; return;;
k) echo "kubectl";;
*) echo "$1";;
esac

(
echo ""
echo "---"
echo ""

# CLI INFO
echo "## CLI:"
echo ""
cd "$ENTANDO_ENT_HOME"
echo "- DIR: $ENTANDO_ENT_HOME"
IFS='|' read -r sha time < <(git log --pretty=format:'%H|%ci' -1)
echo "- SHA: $sha"
echo "- UPD: $time"
echo ""

# RELEASE INFO
__cd "$(_dist_directory)"
echo "## RELEASE:"
echo ""
echo "- DIR: $PWD"
IFS='|' read -r sha time < <(git log --pretty=format:'%H|%ci' -1)
echo "- SHA: $sha"
echo "- UPD: $time"
echo ""

) 1>&2
}

handle_config_command() {
bgn_help_parsing "${BASH_SOURCE[0]}" "$@"

args_or_ask -h "$HH" -f -- '--default///selects the default ent configuration' "$@" && {
# shellcheck disable=SC2034
CFG_FILE="$ENT_DEFAULT_CFG_FILE"
ENT_WORK_DIR="${ENTANDO_ENT_HOME}/w"
THIS_PROFILE=""
}
args_or_ask -h "$HH" -f -- '--global///selects the global ent configuration' "$@" && {
# shellcheck disable=SC2034
_pp ENTANDO_GLOBAL_CFG
CFG_FILE="$ENTANDO_GLOBAL_CFG"
ENT_WORK_DIR="${ENTANDO_ENT_HOME}/w"
THIS_PROFILE=""
}

args_or_ask -h "$HH" -F ENTANDO_NO_OBFUSCATION '--no-obfuscation///disables the obfuscation in the effective configuration' "$@"
args_or_ask -h "$HH" -f -- '--effective///prints the effective configuration' "$@" && {
print-effective-config
return 0
}

args_or_ask -h "$HH" -f -- '--edit///edits the configuration' "$@" && {
_edit "$CFG_FILE"
return 0
}

args_or_ask -h "$HH" -f -- '--set///sets a specific configuration parameter' "$@" && {
args_or_ask -a -h "$HH" "CFG_KEY" "1///%sp the config key" "$@"
args_or_ask -a -n -h "$HH" "CFG_VALUE" "2///%sp the value to set" "$@"
save_cfg_value "$CFG_KEY" "$CFG_VALUE" "$CFG_FILE"
return 0
}

args_or_ask -h "$HH" -f -- '--del///deletes a specific configuration parameter' "$@" && {
args_or_ask -a -h "$HH" "CFG_KEY" "1///%sp the config key" "$@"
save_cfg_value "$CFG_KEY" "" "$CFG_FILE"
return 0
}

args_or_ask -h "$HH" -f -- '--get///gets a specific configuration parameter' "$@" && {
args_or_ask -a -h "$HH" "CFG_KEY" "1///%sp the config key" "$@"
(
reload_cfg "$CFG_FILE"
echo "${!CFG_KEY}"
)
return 0
}
end_help_parsing

if [ -n "$THIS_PROFILE" ]; then
_log_i "Configuration of the profile \"$THIS_PROFILE\" ($CFG_FILE):" 1>&2
else
_log_i "Default configuration of the current entando distribution ($CFG_FILE):" 1>&2
fi
[ -f "$CFG_FILE" ] || _FATAL -s "Configuration file \"$CFG_FILE\" not found"
cat "$CFG_FILE"
print-secrets-leak-warning
}

cmplt() {
cd "$ENTANDO_ENT_HOME/bin/mod" || {
echo "Unable to enter directory $PWD/bin"
exit 99
}
for file in ent-*; do
mod="${file//ent-/}"
echo "$mod"
done

[ -z "$ENTANDO_ENT_EXTENSIONS_MODULES_PATH" ] && ENTANDO_ENT_EXTENSIONS_MODULES_PATH="$ENTANDO_ENT_HOME/bin/mod/ext"
if [ -d "$ENTANDO_ENT_EXTENSIONS_MODULES_PATH" ]; then
(
cd "$ENTANDO_ENT_EXTENSIONS_MODULES_PATH" || exit 0
for file in ent-*; do
[ -f "$file" ] && {
mod="${file//ent-/}"
echo "$mod"
}
done
)
fi

local topcmd+=(
"attach-vm" "detach-vm" "fix-vm-ddns" "completion" "config" "which" "version" "home" "import" "activate"
"kubectl-cmd" "reset-kubectl-mode" "status"
"attach-kubeconfig" "detach-kubeconfig" "namespace" "appname" "pkg"
"attach-kubectx" "detach-kubectx" "list-kubectx"
"bundle" "bundler" "jhipster"
)

for tc in "${topcmd[@]}"; do
echo "$tc"
done
}

_ent() {
# shellcheck disable=SC1090
"$ENTANDO_ENT_HOME/bin/ent" "$@"
}

_source_ent() {
# shellcheck disable=SC1090
source "$ENTANDO_ENT_HOME/bin/ent" "$@"
}

# ######################################################################################################################
# ######################################################################################################################
Expand Down Expand Up @@ -403,43 +238,10 @@ if (
return "$ENTANDO_ENT_TMPVAR_0002bb75"
else
# shellcheck disable=SC2034

ENTANDO_CALLER_PWD="$PWD"
fi

upgrade_project_file() {
local N=$1
local O=$2
if [ -f "$O" ]; then
mkdir -p "$C_ENT_PRJ_ENT_DIR"
if [ -f "$N" ]; then
mv "$O" "$C_ENT_PRJ_ENT_DIR/$O.backup"
else
mv "$O" "$N"
fi
fi
}

handle_status_config() {
if [ "$V" = "--del" ]; then
ent config --set ""
else
V="$2"
[ "$V" == "--" ] && V="$3"
if [ "$V" = "" ]; then
ent config --get "$1"
else
ent config --set "$1" "$V"
fi
fi
}

handle_kubectl_cmd() {
if [ "$1" = "" ]; then
ent config --get "ENT_KUBECTL_CMD"
else
ent kubectl ent-set-cmd "$@"
fi
}

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
cd "$DIR/.." || {
Expand All @@ -459,6 +261,8 @@ fi
}

. s/_base.sh
. s/_root-helper.sh
cd - > /dev/null || _FATAL "internal error"

RUN "$@"

10 changes: 9 additions & 1 deletion bin/mod/ent-app
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,19 @@ RUN() {
"status") #H: prints status information about the current EntandoApp
local WATCH
determine_namespace ENTANDO_NAMESPACE "$@"
args_or_ask -h "$HH" -n -p ENTANDO_APPNAME "--appname/ext_ic_id//%sp the application name" "$@"
args_or_ask -h "$HH" -n -p ENTANDO_APPNAME "--appname/appname_param//%sp the application name" "$@"
args_or_ask -h "$HH" -n -F WATCH "--watch///" "$@"

[ -n "$HH" ] && exit 0

kube.discover-and-set-app-name-if-needed

if [[ "$ENTANDO_APPNAME" == ":auto" && "${ENTANDO_DISABLE_APPNAME_DISCOVERY}" == "true" ]]; then
_log_e "Auto-discovery is disabled (ENTANDO_DISABLE_APPNAME_DISCOVERY=true)"
_log_e "Cannot use ':auto' - please provide an explicit app name"
exit 1
fi

if $WATCH; then
ent app-info watch "$ENTANDO_APPNAME" "$ENTANDO_NAMESPACE"
else
Expand Down
9 changes: 9 additions & 0 deletions bin/mod/ent-app-info
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ WATCH=false; [ "$1" = "watch" ] && { WATCH=true; shift; }
reload_cfg

[ -n "$1" ] && ENTANDO_APPNAME="$1" && shift

kube.discover-and-set-app-name-if-needed

if [[ "$ENTANDO_APPNAME" == ":auto" && "${ENTANDO_DISABLE_APPNAME_DISCOVERY}" == "true" ]]; then
_log_e "Auto-discovery is disabled (ENTANDO_DISABLE_APPNAME_DISCOVERY=true)"
_log_e "Cannot use ':auto' - please provide an explicit app name"
exit 1
fi

[ "$ENTANDO_APPNAME" = "" ] && echo "please provide the app name" 1>&2 && exit 1
[ -n "$1" ] && ENTANDO_NAMESPACE="$1" && shift
[ "$ENTANDO_NAMESPACE" = "" ] && echo "please provide the namespace name" 1>&2 && exit 1
Expand Down
Loading
Loading