Skip to content

Commit 09a7007

Browse files
add env to ENTRYPOINTS_DIR
1 parent 1a0cc94 commit 09a7007

File tree

6 files changed

+23
-10
lines changed

6 files changed

+23
-10
lines changed

.bumpversion.cfg

100644100755
File mode changed.

.gitignore

100644100755
File mode changed.

LICENSE

100644100755
File mode changed.

README.md

100644100755
File mode changed.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
########
4+
## Check for /run/secrets and expose them as ENV variables
5+
if [[ -d /run/secrets/ ]];then
6+
for sec in $(ls /run/secrets/);do
7+
KEY=$(echo ${sec} |tr '[:lower:]' '[:upper:]' |sed -e 's/-/_/g')
8+
echo "[II] Set environment variable ${KEY} from '/run/secrets/${sec}'"
9+
declare "$KEY=$(cat /run/secrets/${sec})"
10+
export $KEY
11+
done
12+
else
13+
echo "[II] No /run/secrets directory, skip step"
14+
fi

init-plain/usr/local/bin/entrypoint.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ function qecho() {
99
qecho "[II] qnib/init-plain script v0.4.32"
1010
set -e
1111

12-
if [[ -z ${SKIP_ENTRYPOINTS} ]];then
13-
## /opt/entry/
14-
for x in $(find /opt/entry/ -type f -perm /u+x |sort);do
15-
qecho "> execute entrypoint '${x}'"
16-
if [[ "$x" == *.env ]];then
17-
source ${x}
18-
else
19-
${x}
20-
fi
21-
done
12+
if [[ -z ${SKIP_ENTRYPOINTS} ]];then
2213
if [[ "X${ENTRYPOINTS_DIR}" != "X" ]];then
2314
if [[ -d ${ENTRYPOINTS_DIR} ]];then
15+
for x in $(find /opt/entry/ -type f -perm /u+x |sort);do
16+
qecho "> execute entrypoint '${x}'"
17+
if [[ "$x" == *.env ]];then
18+
source ${x}
19+
else
20+
${x}
21+
fi
22+
done
2423
for x in $(find ${ENTRYPOINTS_DIR} -type f -perm /u+x |sort);do
2524
qecho "> execute entrypoint '${x}'"
2625
if [[ "$x" == *.env ]];then

0 commit comments

Comments
 (0)