-
Notifications
You must be signed in to change notification settings - Fork 34
/
generate_deploy_commands.sh
30 lines (28 loc) · 1.14 KB
/
generate_deploy_commands.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
################################################################################
#
# A script to generate the $POSTBOOT_COMMANDS file with asadmin commands to deploy
# all applications in $DEPLOY_DIR (either files or folders).
# The $POSTBOOT_COMMANDS file can then be used with the start-domain using the
# --postbootcommandfile parameter to deploy applications on startup.
#
# Usage:
# ./generate_deploy_commands.sh [deploy command parameters]
#
# Optionally, any number of parameters of the asadmin deploy command can be
# specified as parameters to this script.
# E.g., to deploy applications with implicit CDI scanning disabled:
#
# ./generate_deploy_commands.sh --properties=implicitCdiEnabled=false
#
# Note that many parameters to the deploy command can be safely used only when
# a single application exists in the $DEPLOY_DIR directory.
################################################################################
if [ x$1 != x ]
then
DEPLOY_OPTS="$*"
fi
echo '# deployments after boot' >> $POSTBOOT_COMMANDS
for deployment in "${DEPLOY_DIR}"/*
do
echo "deploy --force --enabled=true $DEPLOY_OPTS $deployment" >> $POSTBOOT_COMMANDS
done