summaryrefslogtreecommitdiff
path: root/apps/compiler/includes/functions.sh
diff options
context:
space:
mode:
authorMike Delago <32778141+michaeldelago@users.noreply.github.com>2023-08-20 11:52:38 -0400
committerGitHub <noreply@github.com>2023-08-20 17:52:38 +0200
commitf241a6e352176dc55b0682f00c3460256abc010a (patch)
tree61d94dff89aba474f51067540b18046af5b329d5 /apps/compiler/includes/functions.sh
parent5367eb4b1dfb98016e561e4c9a3a06d5efd4e4f1 (diff)
feat(Apps/Docker): Use Env Vars for docker configuration (#17040)
* feat(docker): Use Env Vars for docker configuration use env vars for docker * simplify docker-compose.yaml
Diffstat (limited to 'apps/compiler/includes/functions.sh')
-rw-r--r--apps/compiler/includes/functions.sh59
1 files changed, 0 insertions, 59 deletions
diff --git a/apps/compiler/includes/functions.sh b/apps/compiler/includes/functions.sh
index 5b26e065a1..7435e655e0 100644
--- a/apps/compiler/includes/functions.sh
+++ b/apps/compiler/includes/functions.sh
@@ -143,32 +143,6 @@ function comp_compile() {
find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec sudo chown root:root -- {} +
find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec sudo chmod u+s -- {} +
- DOCKER_ETC_FOLDER=${DOCKER_ETC_FOLDER:-"env/dist/etc"}
-
- if [[ $DOCKER = 1 && $DISABLE_DOCKER_CONF != 1 ]]; then
- echo "Generating confs..."
-
- # Search for all configs under DOCKER_ETC_FOLDER
- for dockerdist in "$DOCKER_ETC_FOLDER"/*.dockerdist; do
- # Grab "base" conf. turns foo.conf.dockerdist into foo.conf
- baseConf="$(echo "$dockerdist" | rev | cut -f1 -d. --complement | rev)"
- # env/dist/etc/foo.conf becomes foo.conf
- filename="$(basename "$baseConf")"
- # the dist files should be always found inside $confDir
- # which may not be the same as DOCKER_ETC_FOLDER
- distPath="$confDir/$filename.dist"
- # if dist file doesn't exist, skip this iteration
- [ ! -f "$distPath" ] && continue
-
- # replace params in foo.conf.dist with params in foo.conf.dockerdist
- conf_layer "$dockerdist" "$distPath" " # Copied from dockerdist"
-
- # Copy modified dist file to $confDir/$filename
- # Don't overwrite foo.conf if it already exists.
- cp --no-clobber --verbose "$distPath" "$confDir/$filename"
- done
- fi
-
echo "Done"
;;
esac
@@ -185,36 +159,3 @@ function comp_all() {
comp_clean
comp_build
}
-
-# conf_layer FILENAME FILENAME
-# Layer the configuration parameters from the first argument onto the second argument
-function conf_layer() {
- LAYER="$1"
- BASE="$2"
- COMMENT="$3"
-
- # Loop over all defined params in conf file
- grep -E "^[a-zA-Z\.0-9]+\s*=.*$" "$LAYER" \
- | while read -r param
- do
- # remove spaces from param
- # foo = bar becomes foo=bar
- NOSPACE="$(tr -d '[:space:]' <<< "$param")"
-
- # split into key and value
- KEY="$(cut -f1 -d= <<< "$NOSPACE")"
- VAL="$(cut -f2 -d= <<< "$NOSPACE")"
- # if key in base and val not in line
- if grep -qE "^$KEY" "$BASE" && ! grep -qE "^$KEY.*=.*$VAL" "$BASE"; then
- # Replace line
- # Prevent issues with shell quoting
- sed -i \
- 's,^'"$KEY"'.*,'"$KEY = $VAL$COMMENT"',g' \
- "$BASE"
- else
- # insert line
- echo "$KEY = $VAL$COMMENT" >> "$BASE"
- fi
- done
- echo "Layered $LAYER onto $BASE"
-}