diff --git a/ci/nginx/docker-compose.yml b/ci/nginx/docker-compose.yml index 09fc0442a..c654cb8dc 100644 --- a/ci/nginx/docker-compose.yml +++ b/ci/nginx/docker-compose.yml @@ -16,7 +16,7 @@ services: image: "kabanero/kabanero-index" container_name: "kabanero-verify" entrypoint: "" - command: sh -c "/opt/startup.sh; cat /opt/www/public/*.yaml; ls /opt/www/public" + command: sh -c "/opt/startup.sh; cat /opt/www/public/*.yaml; cat /opt/www/public/*.json; ls /opt/www/public" environment: - EXTERNAL_URL=https://localhost:8003/ - DRY_RUN=true diff --git a/ci/nginx/startup.sh b/ci/nginx/startup.sh index 820c4df18..d78b6c347 100755 --- a/ci/nginx/startup.sh +++ b/ci/nginx/startup.sh @@ -9,6 +9,9 @@ fi # Replace the resource paths in index yaml files to match the specified external URL find /opt/www/public -name '*.yaml' -exec sed -i -e "s|{{EXTERNAL_URL}}|${EXTERNAL_URL%/}|" {} \; +# Replace the resource paths in index json files to match the specified external URL +find /opt/www/public -name '*.json' -exec sed -i -e "s|{{EXTERNAL_URL}}|${EXTERNAL_URL%/}|" {} \; + if [ -z "${DRY_RUN}" ] then exec nginx $CONF_FILE diff --git a/ci/package.sh b/ci/package.sh index aff144e0e..3f6f83b12 100755 --- a/ci/package.sh +++ b/ci/package.sh @@ -233,7 +233,16 @@ done exec_hooks $script_dir/ext/post_package.d if [ "$CODEWIND_INDEX" == "true" ]; then - python3 $script_dir/create_codewind_index.py $DISPLAY_NAME_PREFIX + python3 $script_dir/create_codewind_index.py $DISPLAY_NAME_PREFIX + + # iterate over each repo + for codewind_file in $assets_dir/*.json + do + # flat json used by static appsody-index for codewind + index_src=$build_dir/index-src/$(basename "$codewind_file") + + sed -e "s|${RELEASE_URL}/.*/|{{EXTERNAL_URL}}/|" $codewind_file > $index_src + done fi # create appsody-index from contents of assets directory after post-processing