Skip to content

Commit

Permalink
Merge branch 'master' of forgemia.inra.fr:in-sylva-development/in-syl…
Browse files Browse the repository at this point in the history
…va.infrastructure
  • Loading branch information
Ozcan Aytac; Insylva project committed Jun 30, 2020
2 parents 9d749e0 + f59f1b9 commit 8e4bc93
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
17 changes: 12 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,26 @@ cp portal/nginx/nginx_generic.conf portal/nginx/nginx.conf
if [ "$MODE" == "prod" ];then

# search customization
sed -i -e "s,server_name .,server_name $DOMAIN/search/," search/nginx/nginx.conf
sed -i -e "s,server_name .,server_name ${DOMAIN}search/," search/nginx/nginx.conf
sed -i -e "s,_HOST=/,_HOST=${NGINXCONF}/search/," search/.env
sed -i -e "s,REACT_APP_IN_SYLVA_LOGIN_HOST=.*,REACT_APP_IN_SYLVA_LOGIN_HOST=http://${DOMAIN}login/," search/.env

# portal customization
sed -i -e "s,server_name .,server_name $DOMAIN/portal/," portal/nginx/nginx.conf
sed -i -e "s,server_name .,server_name ${DOMAIN}portal/," portal/nginx/nginx.conf
sed -i -e "s,_HOST=/,_HOST=${NGINXCONF}/portal/," portal/.env

fi

# login customization
cp ipconfig_generic.txt ipconfig.txt
if [ "$MODE" == "prod" ]; then
sed -i -e "s,IP_ADDRESS,${LOGINSERVER}," ipconfig.txt
sed -i -e "s,DOMAIN$,${DOMAIN}," ipconfig.txt
else
sed -i -e "s/IP_ADDRESS$/0.0.0.0/" ipconfig.txt
sed -i -e "s/DOMAIN$/0.0.0.0/" ipconfig.txt
fi

#if [ "$MODE" == "prod" ]; then
# cat ipconfig_generic.txt | sed -e "s/0.0.0.0/$LOGINSERVER/" -e "s/8080/$LOGINPORT/" > ipconfig.txt
#fi
export IN_SYLVA_KEYCLOAK_HOST=$(grep IN_SYLVA_KEYCLOAK_HOST ipconfig.txt| awk '{print $2}')
export IN_SYLVA_KEYCLOAK_PORT=$(grep IN_SYLVA_KEYCLOAK_PORT ipconfig.txt| awk '{print $2}')
export IN_SYLVA_PORTAL_HOST=$(grep IN_SYLVA_PORTAL_HOST ipconfig.txt| awk '{print $2}')
Expand All @@ -126,6 +131,8 @@ export IN_SYLVA_GATEKEEPER_HOST=$(grep IN_SYLVA_GATEKEEPER_HOST ipconfig.txt| aw
export IN_SYLVA_GATEKEEPER_PORT=$(grep IN_SYLVA_GATEKEEPER_PORT ipconfig.txt| awk '{print $2}')
export IN_SYLVA_SEARCH_PORT=$(grep IN_SYLVA_SEARCH_PORT ipconfig.txt| awk '{print $2}')
export IN_SYLVA_SEARCH_HOST=$(grep IN_SYLVA_SEARCH_HOST ipconfig.txt| awk '{print $2}')
export IN_SYLVA_SEARCH_PORT=$(grep IN_SYLVA_LOGIN_PORT ipconfig.txt| awk '{print $2}')
export IN_SYLVA_SEARCH_HOST=$(grep IN_SYLVA_LOGIN_HOST ipconfig.txt| awk '{print $2}')

# Control for elasticsearch and host parameters
val=0$(grep vm.max_map_count /etc/sysctl.conf | awk -F"=" '{print $2}')
Expand Down
10 changes: 5 additions & 5 deletions ipconfig_generic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# should be updated in production mode (search host and port)
# or in case developper wants to use a specific other instance of insylva infrastructure
#
IN_SYLVA_KEYCLOAK_HOST 0.0.0.0
IN_SYLVA_KEYCLOAK_HOST IP_ADDRESS
IN_SYLVA_KEYCLOAK_PORT 7000
IN_SYLVA_PORTAL_HOST 0.0.0.0
IN_SYLVA_PORTAL_HOST DOMAIN
IN_SYLVA_PORTAL_PORT 3000
IN_SYLVA_SEARCH_HOST 0.0.0.0
IN_SYLVA_SEARCH_HOST DOMAIN
IN_SYLVA_SEARCH_PORT 3001
IN_SYLVA_GATEKEEPER_HOST 0.0.0.0
IN_SYLVA_GATEKEEPER_HOST IP_ADDRESS
IN_SYLVA_GATEKEEPER_PORT 4000
IN_SYLVA_LOGIN_HOST 0.0.0.0
IN_SYLVA_LOGIN_HOST IP_ADDRESS
IN_SYLVA_LOGIN_PORT 8080

0 comments on commit 8e4bc93

Please sign in to comment.