Skip to content

Commit

Permalink
Added CUE endpoint bridge
Browse files Browse the repository at this point in the history
- An optional backend bridge option has been added to the CUE profile to
  support the new bridge endpoint.
- If set, the generated `backend.yml` file gets an entry like:
  cue:
    backend:
      bridge: http://bridge.example.com
  • Loading branch information
Mahmudul Hassan Rony committed Sep 20, 2017
1 parent 0c29e6b commit 24ce72f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions usr/local/src/unit-tests/ece-install-conf-file-reader-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ test_can_parse_yaml_conf_cue() {
local cue_backend_ece=http://ece.example.com
local cue_backend_ece_local=http://localhost:8080
local cue_backend_ng=http://ng.example.com
local cue_backend_bridge=http://bridge.example.com
local cue_cors_origin1=editor.example.com
local cue_cors_origin2=cue.example.com

Expand All @@ -400,6 +401,7 @@ profiles:
backend_ece: ${cue_backend_ece}
backend_ece_local: ${cue_backend_ece_local}
backend_ng: ${cue_backend_ng}
backend_bridge: ${cue_backend_bridge}
cors_origins:
- ${cue_cors_origin1}
- ${cue_cors_origin2}
Expand All @@ -409,6 +411,7 @@ EOF
unset fai_cue_backend_ece
unset fai_cue_backend_ece_local
unset fai_cue_backend_ng
unset fai_cue_backend_bridge
unset fai_cue_cors_origins

parse_yaml_conf_file_or_source_if_sh_conf "${yaml_file}"
Expand All @@ -417,6 +420,7 @@ EOF
assertEquals "fai_cue_backend_ece" "${cue_backend_ece}" "${fai_cue_backend_ece}"
assertEquals "fai_cue_backend_ece_local" "${cue_backend_ece_local}" "${fai_cue_backend_ece_local}"
assertEquals "fai_cue_backend_ng" "${cue_backend_ng}" "${fai_cue_backend_ng}"
assertEquals "fai_cue_backend_bridge" "${cue_backend_bridge}" "${fai_cue_backend_bridge}"
assertEquals "fai_cue_cors_origins" "${cue_cors_origin1} ${cue_cors_origin2}" "${fai_cue_cors_origins}"

rm -rf "${yaml_file}"
Expand Down
2 changes: 2 additions & 0 deletions usr/share/doc/escenic/ece-install-conf-reference.org
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ profiles:
backend_ece: ${cue_backend_ece}
backend_ece_local: ${cue_backend_ece_local}
backend_ng: ${cue_backend_ng}
backend_bridge: ${cue_backend_bridge}
cors_origins:
- ${cue_cors_origin1}
- ${cue_cors_origin2}
Expand All @@ -207,6 +208,7 @@ fai_cue_install=
fai_cue_backend_ece=
fai_cue_backend_ece_local=
fai_cue_backend_ng=
fai_cue_backend_bridge=
fai_cue_cors_origins=

#+end_src
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,12 @@ _parse_yaml_conf_file_cue() {
export fai_cue_backend_ng=${install_cue_backend_ng}
fi

local install_cue_backend_bridge=
install_cue_backend_bridge=$(_jq "${yaml_file}" .profiles.cue.backend_bridge)
if [ -n "${install_cue_backend_bridge}" ]; then
export fai_cue_backend_bridge=${install_cue_backend_bridge}
fi

local count=0
count=$(_jq "${yaml_file}" ".profiles.cue.cors_origins | length")
for ((i = 0; i < count; i++)); do
Expand Down
4 changes: 4 additions & 0 deletions usr/share/escenic/ece-scripts/ece-install.d/cue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ EOF
if [ -n "${fai_cue_backend_ng}" ]; then
echo " newsgate: ${fai_cue_backend_ng}" >> "${file}"
fi

if [ -n "${fai_cue_backend_bridge}" ]; then
echo " bridge: ${fai_cue_backend_bridge}" >> "${file}"
fi
done

if [ "${on_debian_or_derivative-0}" -eq 1 ]; then
Expand Down

0 comments on commit 24ce72f

Please sign in to comment.