dangogh closed pull request #2476: Changes TP (cdn-in-a-box) to support overriding the TO_HOST env var URL: https://github.com/apache/trafficcontrol/pull/2476
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/infrastructure/cdn-in-a-box/docker-compose.yml b/infrastructure/cdn-in-a-box/docker-compose.yml index c6abf7818..d7a95a2bf 100644 --- a/infrastructure/cdn-in-a-box/docker-compose.yml +++ b/infrastructure/cdn-in-a-box/docker-compose.yml @@ -103,8 +103,6 @@ services: context: traffic_portal args: TRAFFIC_PORTAL_RPM: traffic_portal.rpm - depends_on: - - trafficops domainname: cdn.local env_file: - variables.env diff --git a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile index 6d5532156..b6dbfb8d8 100644 --- a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile @@ -28,6 +28,8 @@ RUN curl -sL https://rpm.nodesource.com/setup_6.x | bash - ARG TRAFFIC_PORTAL_RPM=traffic_portal.rpm ADD $TRAFFIC_PORTAL_RPM / +ARG TO_HOST=$TO_HOST + # Install and delete the TRAFFIC_PORTAL_RPM when finished RUN yum install -y \ epel-release && \ diff --git a/infrastructure/cdn-in-a-box/traffic_portal/run.sh b/infrastructure/cdn-in-a-box/traffic_portal/run.sh index 6ea1ab901..43cd442b4 100755 --- a/infrastructure/cdn-in-a-box/traffic_portal/run.sh +++ b/infrastructure/cdn-in-a-box/traffic_portal/run.sh @@ -40,6 +40,8 @@ sed -i -e "/^\s*base_url:/ s@'.*'@'https://$TO_HOST:6443/api/'@" /etc/traffic_po props=/opt/traffic_portal/public/traffic_portal_properties.json tmp=$(mktemp) +echo "TO_HOST: $TO_HOST" + jq --arg TO_HOST $TO_HOST '.properties.api.baseUrl = "https://"+$TO_HOST' <$props >$tmp mv $tmp $props ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services