Skip to content

Commit

Permalink
made changes to support overriding the TO_HOST env var
Browse files Browse the repository at this point in the history
  • Loading branch information
dewrich authored and dangogh committed Jun 27, 2018
1 parent 3eed871 commit 4d40609
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions infrastructure/cdn-in-a-box/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/cdn-in-a-box/traffic_portal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/cdn-in-a-box/traffic_portal/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4d40609

Please sign in to comment.