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