source: installer/vagrant/setup-proxy.sh @ ba0edc7

configure-oglivelgromero-new-oglivemainmount-efivarfsuse-local-agent-oglive
Last change on this file since ba0edc7 was bd458a5, checked in by Natalia Serrano <natalia.serrano@…>, 15 months ago

refs #162 do not reconfigure nginx if ogserver IP was not detected

  • Property mode set to 100644
File size: 514 bytes
Line 
1#!/bin/bash
2
3set -eu
4
5SERVER=$1
6BRANCH=$2
7
8#NGINX docker folder config
9NGINXCONF=/opt/nginx/conf
10DEST=$NGINXCONF/$BRANCH.location
11
12IP=$(vagrant ssh $SERVER -c "ifdata -pa eth0" | tr -d '\r')
13IP=$(echo "${IP//[$'\t\r\n']}")
14if [ -z $IP ]; then
15    echo "Couldn't detect IP"
16    exit 1
17fi
18
19echo "server IP es ($IP)"
20
21# Configure proxy
22cp config/nginx-template.location $DEST
23sed -i "s/##IPADDRESS##/$IP/g" $DEST
24sed -i "s/##BRANCH##/$BRANCH/g" $DEST
25
26# Reload nginx
27docker exec nginx_reverse_proxy  nginx -s reload
Note: See TracBrowser for help on using the repository browser.