File: //home/arjun/projects/buyercall_forms/buyercall/deploy/features/nginx/feature.sh
#!/bin/bash
#create configs for nginx-balancer
cd /opt/atlassian/pipelines/agent/build/deploy/features/nginx/
aws s3 cp s3://bc-features-nginx/default/default.conf configs/domains/
cp -f /opt/atlassian/pipelines/agent/build/deploy/features/nginx/template.conf /opt/atlassian/pipelines/agent/build/deploy/features/nginx/configs/domains/"$1".conf
sed -i "s*SERVERNAME_HERE*"$1".f.buyercall.com*g" configs/domains/"$1".conf
sed -i "s*BACKENDURL_HERE*"$1".bc-features*g" configs/domains/"$1".conf
#s3 sync here
aws s3 sync configs/domains/ s3://bc-features-nginx/domains/ --exclude "default.conf"