File tree Expand file tree Collapse file tree 7 files changed +22
-19
lines changed Expand file tree Collapse file tree 7 files changed +22
-19
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ log " INFO" " | Create required folders"
4
+
5
+ OUTDIR=" ${APP_CONFIG_DIR} ${APP_LOG_DIR} ${APP_CACHE_DIR} "
6
+
7
+ mkdir -p $OUTDIR
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- echo " - Configure Supervisord ... "
3
+ log " INFO " " | Configure Supervisor "
4
4
5
- OUTDIR=" /app/etc"
5
+ OUTDIR=" /app/etc /app/var/run /app/var/log "
6
6
mkdir -p $OUTDIR
7
7
8
8
apply-template /app/config/supervisord.conf.tmpl /app/etc/supervisord.conf
Original file line number Diff line number Diff line change 3
3
OUTDIR=" /app/etc/crontabs /app/etc/supervisor.d"
4
4
mkdir -p $OUTDIR
5
5
6
- echo " - Writing Supercronic crontab file... "
6
+ log " INFO " " | Configure Supercronic"
7
7
8
8
if [[ -f /app/etc/crontabs/elasticms ]]
9
9
then
10
10
11
11
if rm /app/etc/crontabs/elasticms; then
12
12
apply-template /app/config/elasticms.crontab.tmpl /app/etc/crontabs/elasticms
13
13
else
14
- echo " - Supercronic crontab file exists and will be used ... "
14
+ log " WARN " " | Supercronic crontab file exists and will be used"
15
15
fi
16
16
17
17
else
18
18
19
+ log " INFO" " | Writing Supercronic crontab file"
19
20
apply-template /app/config/elasticms.crontab.tmpl /app/etc/crontabs/elasticms
20
21
21
22
fi
22
23
23
- echo " - Configure Supervisord for Supercronic usage..."
24
-
25
24
if [[ -f /app/etc/supervisor.d/supercronic.ini ]]
26
25
then
27
26
28
27
if rm /app/etc/supervisor.d/supercronic.ini; then
29
28
apply-template /app/config/supercronic.ini.tmpl /app/etc/supervisor.d/supercronic.ini
30
29
else
31
- echo " - Supervisord config file exists and will be used ... "
30
+ log " WARN " " | Supervisor config file exists and will be used"
32
31
fi
33
32
34
33
else
35
34
35
+ log " INFO" " | Writing Supervisor config file for Supercronic usage"
36
36
apply-template /app/config/supercronic.ini.tmpl /app/etc/supervisor.d/supercronic.ini
37
37
38
38
fi
Original file line number Diff line number Diff line change @@ -5,6 +5,6 @@ export ELASTICMS_CLI_JOB_ENDTIME=`date +%s`
5
5
6
6
rm -f ${ELASTICMS_CLI_LOG_TMP_FILE}
7
7
8
- echo " -------------------------------------- "
9
- echo " Finished Job at $( date +" %Y-%m-%d %H:%M:%S" ) after $(( ELASTICMS_CLI_JOB_ENDTIME- ELASTICMS_CLI_JOB_STARTTIME)) seconds"
10
- echo " ====================================== "
8
+ logLast " ─────────────────────────────────────── "
9
+ logLast " Finished at $( date +" %Y-%m-%d %H:%M:%S" ) after $(( ELASTICMS_CLI_JOB_ENDTIME- ELASTICMS_CLI_JOB_STARTTIME)) seconds"
10
+ logLast " ─────────────────────────────────────── "
Original file line number Diff line number Diff line change @@ -5,6 +5,6 @@ source "${ELASTICMS_CLI_PRE_CRONJOB_PATH}/lib/helper.bash"
5
5
6
6
export ELASTICMS_CLI_JOB_STARTTIME=` date +%s`
7
7
8
- echo " ====================================== "
9
- echo " Starting Job at $( date +" %Y-%m-%d %H:%M:%S" ) "
10
- echo " -------------------------------------- "
8
+ logLast " ─────────────────────────────────────── "
9
+ logLast " Starting at $( date +" %Y-%m-%d %H:%M:%S" ) "
10
+ logLast " ─────────────────────────────────────── "
Original file line number Diff line number Diff line change @@ -4,15 +4,13 @@ set -eo pipefail
4
4
export DEBUG=${DEBUG:- false}
5
5
[[ " ${DEBUG} " == " true" ]] && set -x
6
6
7
- echo -e " \n Configure ElasticMS CLI Container ( Cronjob ) ...\n"
8
-
9
7
export ELASTICMS_CLI_JOB_COMMAND=" $@ "
10
8
11
9
for FILE in $( find /app/bin/container-entrypoint.d/entrypoint.d -iname \* .sh | sort)
12
10
do
13
11
source ${FILE}
14
12
done
15
13
16
- echo -e " \n ElasticMS CLI Container configured succesfully ...\n "
14
+ log " INFO " " | ElasticMS CLI Container ( Cronjob ) configured succesfully"
17
15
18
16
exec elasticms-job " ${ELASTICMS_CLI_JOB_COMMAND} "
Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ set -eo pipefail
4
4
export DEBUG=${DEBUG:- false}
5
5
[[ " ${DEBUG} " == " true" ]] && set -x
6
6
7
- echo -e " \n Configure ElasticMS CLI Container ( Crontab )...\n"
8
-
9
7
export ELASTICMS_CLI_CROND_COMMAND=" $@ "
10
8
11
9
for FILE in $( find /app/bin/container-entrypoint.d/entrypoint.d -iname \* .sh | sort)
18
16
source ${FILE}
19
17
done
20
18
21
- echo -e " \n ElasticMS CLI Container configured succesfully ...\n "
19
+ log " INFO " " | ElasticMS CLI Container ( Crontab ) configured succesfully"
22
20
23
21
exec /usr/bin/supervisord -c /app/etc/supervisord.conf
You can’t perform that action at this time.
0 commit comments