Commit 50591328 authored by Florent VINCENT's avatar Florent VINCENT
Browse files

generic vars in env for ci sed substitutions

parent 960bc35f
......@@ -10,7 +10,7 @@ SEARX_UI_DEFAULT_THEME=eelo
SEARX_PROXY_HTTP=http://proxy01.ecloud.global:1099
SEARX_PROXY_HTTPS=http://proxy01.ecloud.global:1099
WIREGUARD_IP=127.0.0.1
REPO_BASE=/mnt/repo-base/staging-spot
REPO_BASE=/mnt/repo-base/PATH
FILTRON_PORT=8088
MORTY_PORT=8089
INTERNAL_NETWORK_NAME=staging-spot-default
\ No newline at end of file
INTERNAL_NETWORK_NAME=default
\ No newline at end of file
......@@ -111,9 +111,10 @@ deploy:spot.eeo.one.backend1:
&& sed -i 's/localhost:8089/$SPOT_MORTY_HOSTNAME/g' .env
&& sed -i 's/proxy01.ecloud.global/proxy01.ecloud.global/g' .env
&& sed -i 's/WIREGUARD_IP=127.0.0.1/WIREGUARD_IP=$WIREGUARD_IP/g' .env
&& sed -i 's/PATH/staging-spot/g'
&& sed -i 's/FILTRON_PORT=8088/FILTRON_PORT=$FILTRON_PORT/g' .env
&& sed -i 's/MORTY_PORT=8089/MORTY_PORT=$MORTY_PORT/g' .env
&& sed -i 's/INTERNAL_NETWORK_NAME=staging-spot-default/INTERNAL_NETWORK_NAME=$INTERNAL_NETWORK_NAME/g' .env"
&& sed -i 's/INTERNAL_NETWORK_NAME=default/INTERNAL_NETWORK_NAME=$INTERNAL_NETWORK_NAME/g' .env"
deploy:spot.eeo.one.backend2:
extends: .deploy:template
......@@ -142,7 +143,7 @@ deploy:spot.eeo.one.backend2:
- echo "Deploying to $CI_ENVIRONMENT_NAME ($SSH_USER@$BACKEND2_HOST - $BACKEND2_WG_IP - $WIREGUARD_IP)"
- docker-compose up -d --build
- docker-compose restart filtron
- ssh $SSH_USER@$BACKEND1_HOST "cd $REPO_BASE
- ssh $SSH_USER@$BACKEND2_HOST "cd $REPO_BASE
&& sed -i 's/SPOT_HOSTNAME=spot.ecloud.global/SPOT_HOSTNAME=$SPOT_HOSTNAME/g' .env
&& sed -i 's/SPOT_MORTY_HOSTNAME=proxy.spot.ecloud.global/SPOT_MORTY_HOSTNAME=$SPOT_MORTY_HOSTNAME/g' .env
&& sed -i 's/SPOT_DOCKER_TAG=latest/SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG/g' .env
......@@ -150,9 +151,10 @@ deploy:spot.eeo.one.backend2:
&& sed -i 's/localhost:8089/$SPOT_MORTY_HOSTNAME/g' .env
&& sed -i 's/proxy01.ecloud.global/proxy02.ecloud.global/g' .env
&& sed -i 's/WIREGUARD_IP=127.0.0.1/WIREGUARD_IP=$WIREGUARD_IP/g' .env
&& sed -i 's/PATH/staging-spot/g'
&& sed -i 's/FILTRON_PORT=8088/FILTRON_PORT=$FILTRON_PORT/g' .env
&& sed -i 's/MORTY_PORT=8089/MORTY_PORT=$MORTY_PORT/g' .env
&& sed -i 's/INTERNAL_NETWORK_NAME=staging-spot-default/INTERNAL_NETWORK_NAME=$INTERNAL_NETWORK_NAME/g' .env"
&& sed -i 's/INTERNAL_NETWORK_NAME=default/INTERNAL_NETWORK_NAME=$INTERNAL_NETWORK_NAME/g' .env"
deploy:spot.ecloud.global.backend1:
......@@ -190,10 +192,10 @@ deploy:spot.ecloud.global.backend1:
&& sed -i 's/localhost:8089/$SPOT_MORTY_HOSTNAME/g' .env
&& sed -i 's/proxy01.ecloud.global/proxy01.ecloud.global/g' .env
&& sed -i 's/WIREGUARD_IP=127.0.0.1/WIREGUARD_IP=$WIREGUARD_IP/g' .env
&& sed -i 's/\/mnt\/repo-base\/staging-spot/$REPO_BASE/g' .env
&& sed -i 's/PATH/production-spot/g'
&& sed -i 's/FILTRON_PORT=8088/FILTRON_PORT=$FILTRON_PORT/g' .env
&& sed -i 's/MORTY_PORT=8089/MORTY_PORT=$MORTY_PORT/g' .env
&& sed -i 's/INTERNAL_NETWORK_NAME=staging-spot-default/INTERNAL_NETWORK_NAME=$INTERNAL_NETWORK_NAME/g' .env"
&& sed -i 's/INTERNAL_NETWORK_NAME=default/INTERNAL_NETWORK_NAME=$INTERNAL_NETWORK_NAME/g' .env"
deploy:spot.ecloud.global.backend2:
extends: .deploy:template
......@@ -222,7 +224,7 @@ deploy:spot.ecloud.global.backend2:
- docker-compose pull
- docker-compose up -d
- docker-compose restart filtron
- ssh $SSH_USER@$BACKEND1_HOST "cd $REPO_BASE
- ssh $SSH_USER@$BACKEND2_HOST "cd $REPO_BASE
&& sed -i 's/SPOT_HOSTNAME=spot.ecloud.global/SPOT_HOSTNAME=$SPOT_HOSTNAME/g' .env
&& sed -i 's/SPOT_MORTY_HOSTNAME=proxy.spot.ecloud.global/SPOT_MORTY_HOSTNAME=$SPOT_MORTY_HOSTNAME/g' .env
&& sed -i 's/SPOT_DOCKER_TAG=latest/SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG/g' .env
......@@ -230,8 +232,8 @@ deploy:spot.ecloud.global.backend2:
&& sed -i 's/localhost:8089/$SPOT_MORTY_HOSTNAME/g' .env
&& sed -i 's/proxy01.ecloud.global/proxy02.ecloud.global/g' .env
&& sed -i 's/WIREGUARD_IP=127.0.0.1/WIREGUARD_IP=$WIREGUARD_IP/g' .env
&& sed -i 's/\/mnt\/repo-base\/staging-spot/$REPO_BASE/g' .env
&& sed -i 's/PATH/production-spot/g'
&& sed -i 's/FILTRON_PORT=8088/FILTRON_PORT=$FILTRON_PORT/g' .env
&& sed -i 's/MORTY_PORT=8089/MORTY_PORT=$MORTY_PORT/g' .env
&& sed -i 's/INTERNAL_NETWORK_NAME=staging-spot-default/INTERNAL_NETWORK_NAME=$INTERNAL_NETWORK_NAME/g' .env"
&& sed -i 's/INTERNAL_NETWORK_NAME=default/INTERNAL_NETWORK_NAME=$INTERNAL_NETWORK_NAME/g' .env"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment