Update run.sh and fix pipeline

This commit is contained in:
Santiago Lo Coco 2023-10-25 10:23:31 -03:00
parent 927d8b39c7
commit 56839570bc
5 changed files with 142 additions and 5171 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@
.env.*
!.env.dev.example
!.env.prod.example
node_modules
node_modules
*.xml

View File

@ -1,454 +0,0 @@
<?xml version="1.0" ?>
<coverage version="7.3.2" timestamp="1698081228733" lines-valid="374" lines-covered="173" line-rate="0.4626" branches-valid="148" branches-covered="97" branch-rate="0.6554" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.3.2 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
<source>/home/slococo/ITBA/MICRO/fids/auth-domain/user-manager/src</source>
</sources>
<packages>
<package name="." line-rate="0.8478" branch-rate="0.25" complexity="0">
<classes>
<class name="__init__.py" filename="__init__.py" complexity="0" line-rate="0.65" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="14" hits="1"/>
<line number="16" hits="1"/>
<line number="19" hits="1"/>
<line number="20" hits="1"/>
<line number="23" hits="1"/>
<line number="24" hits="0"/>
<line number="27" hits="0"/>
<line number="29" hits="0"/>
<line number="32" hits="0"/>
<line number="33" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="32,36"/>
<line number="34" hits="0"/>
<line number="36" hits="0"/>
</lines>
</class>
<class name="config.py" filename="config.py" complexity="0" line-rate="1" branch-rate="0.5">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="8" hits="1"/>
<line number="9" hits="1"/>
<line number="12" hits="1"/>
<line number="13" hits="1"/>
<line number="14" hits="1"/>
<line number="17" hits="1"/>
<line number="18" hits="1"/>
<line number="19" hits="1"/>
<line number="20" hits="1"/>
<line number="21" hits="1"/>
<line number="22" hits="1"/>
<line number="25" hits="1"/>
<line number="26" hits="1"/>
<line number="27" hits="1"/>
<line number="28" hits="1"/>
<line number="30" hits="1"/>
<line number="31" hits="1"/>
<line number="32" hits="1"/>
<line number="33" hits="1" branch="true" condition-coverage="50% (1/2)" missing-branches="35"/>
<line number="34" hits="1"/>
<line number="35" hits="1"/>
</lines>
</class>
</classes>
</package>
<package name="api" line-rate="0.3226" branch-rate="0.629" complexity="0">
<classes>
<class name="__init__.py" filename="api/__init__.py" complexity="0" line-rate="1" branch-rate="1">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="6" hits="1"/>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
</lines>
</class>
<class name="auth.py" filename="api/auth.py" complexity="0" line-rate="0.433" branch-rate="0.7143">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="8" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="12" hits="1"/>
<line number="13" hits="1"/>
<line number="14" hits="1"/>
<line number="16" hits="1"/>
<line number="17" hits="1"/>
<line number="20" hits="1"/>
<line number="21" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="22" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="23" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="24" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="25" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="26" hits="0"/>
<line number="27" hits="0"/>
<line number="28" hits="0"/>
<line number="29" hits="0"/>
<line number="31" hits="0"/>
<line number="32" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="33,34"/>
<line number="33" hits="0"/>
<line number="34" hits="0"/>
<line number="36" hits="0"/>
<line number="39" hits="1"/>
<line number="40" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="41" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="42" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="43" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="44" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="45" hits="0"/>
<line number="46" hits="0"/>
<line number="47" hits="0"/>
<line number="48" hits="0"/>
<line number="50" hits="0"/>
<line number="51" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="52,54"/>
<line number="52" hits="0"/>
<line number="54" hits="0"/>
<line number="55" hits="0"/>
<line number="57" hits="0"/>
<line number="60" hits="0"/>
<line number="63" hits="1"/>
<line number="64" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="65" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="66" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="67" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="68" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="69" hits="0"/>
<line number="70" hits="0"/>
<line number="71" hits="0"/>
<line number="73" hits="0"/>
<line number="74" hits="0"/>
<line number="75" hits="0"/>
<line number="77" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="78,80"/>
<line number="78" hits="0"/>
<line number="80" hits="0"/>
<line number="81" hits="0"/>
<line number="83" hits="0"/>
<line number="87" hits="0"/>
<line number="88" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="89,91"/>
<line number="89" hits="0"/>
<line number="90" hits="0"/>
<line number="91" hits="0"/>
<line number="92" hits="0"/>
<line number="95" hits="1"/>
<line number="96" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="97" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="98" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="99" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="100" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="101" hits="0"/>
<line number="102" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="103,119"/>
<line number="103" hits="0"/>
<line number="104" hits="0"/>
<line number="105" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="106,107"/>
<line number="106" hits="0"/>
<line number="107" hits="0"/>
<line number="108" hits="0"/>
<line number="109" hits="0"/>
<line number="110" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="111,112"/>
<line number="111" hits="0"/>
<line number="112" hits="0"/>
<line number="113" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="114,116"/>
<line number="114" hits="0"/>
<line number="115" hits="0"/>
<line number="116" hits="0"/>
<line number="117" hits="0"/>
<line number="119" hits="0"/>
<line number="122" hits="1"/>
<line number="123" hits="1"/>
<line number="124" hits="1"/>
<line number="125" hits="1"/>
</lines>
</class>
<class name="crud.py" filename="api/crud.py" complexity="0" line-rate="0" branch-rate="1">
<methods/>
<lines>
<line number="1" hits="0"/>
<line number="2" hits="0"/>
<line number="5" hits="0"/>
<line number="6" hits="0"/>
<line number="9" hits="0"/>
<line number="10" hits="0"/>
<line number="13" hits="0"/>
<line number="14" hits="0"/>
<line number="17" hits="0"/>
<line number="18" hits="0"/>
<line number="19" hits="0"/>
<line number="20" hits="0"/>
<line number="21" hits="0"/>
<line number="24" hits="0"/>
<line number="25" hits="0"/>
<line number="26" hits="0"/>
<line number="27" hits="0"/>
<line number="28" hits="0"/>
<line number="31" hits="0"/>
<line number="32" hits="0"/>
<line number="33" hits="0"/>
<line number="34" hits="0"/>
</lines>
</class>
<class name="models.py" filename="api/models.py" complexity="0" line-rate="0" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="0"/>
<line number="3" hits="0"/>
<line number="4" hits="0"/>
<line number="5" hits="0"/>
<line number="6" hits="0"/>
<line number="7" hits="0"/>
<line number="10" hits="0"/>
<line number="11" hits="0"/>
<line number="13" hits="0"/>
<line number="14" hits="0"/>
<line number="15" hits="0"/>
<line number="16" hits="0"/>
<line number="17" hits="0"/>
<line number="18" hits="0"/>
<line number="20" hits="0"/>
<line number="21" hits="0"/>
<line number="22" hits="0"/>
<line number="23" hits="0"/>
<line number="27" hits="0"/>
<line number="28" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="27,44"/>
<line number="29" hits="0"/>
<line number="30" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="31,33"/>
<line number="31" hits="0"/>
<line number="33" hits="0"/>
<line number="35" hits="0"/>
<line number="40" hits="0"/>
<line number="44" hits="0"/>
<line number="45" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="44,51"/>
<line number="46" hits="0"/>
<line number="49" hits="0"/>
<line number="51" hits="0"/>
<line number="52" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="51,63"/>
<line number="53" hits="0"/>
<line number="63" hits="0"/>
<line number="64" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="63,73"/>
<line number="65" hits="0"/>
<line number="73" hits="0"/>
<line number="74" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="73,83"/>
<line number="75" hits="0"/>
<line number="83" hits="0"/>
<line number="84" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="83,93"/>
<line number="85" hits="0"/>
<line number="93" hits="0"/>
<line number="94" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="93,103"/>
<line number="95" hits="0"/>
<line number="103" hits="0"/>
<line number="104" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="103,109"/>
<line number="105" hits="0"/>
<line number="109" hits="0"/>
<line number="110" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="exit,109"/>
<line number="111" hits="0"/>
</lines>
</class>
<class name="users.py" filename="api/users.py" complexity="0" line-rate="0.4366" branch-rate="0.7917">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="3" hits="1"/>
<line number="5" hits="1"/>
<line number="14" hits="1"/>
<line number="16" hits="1"/>
<line number="18" hits="1"/>
<line number="19" hits="1"/>
<line number="22" hits="1"/>
<line number="23" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="24" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="25" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="26" hits="0"/>
<line number="28" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="29" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="30" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="31" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="32" hits="0"/>
<line number="33" hits="0"/>
<line number="34" hits="0"/>
<line number="35" hits="0"/>
<line number="36" hits="0"/>
<line number="38" hits="0"/>
<line number="39" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="40,43"/>
<line number="40" hits="0"/>
<line number="41" hits="0"/>
<line number="43" hits="0"/>
<line number="45" hits="0"/>
<line number="46" hits="0"/>
<line number="47" hits="0"/>
<line number="50" hits="1"/>
<line number="51" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="52" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="53" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="54" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="55" hits="0"/>
<line number="56" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="57,58"/>
<line number="57" hits="0"/>
<line number="58" hits="0"/>
<line number="60" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="61" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="62" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="63" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="64" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="65" hits="0"/>
<line number="66" hits="0"/>
<line number="67" hits="0"/>
<line number="68" hits="0"/>
<line number="70" hits="0"/>
<line number="71" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="72,74"/>
<line number="72" hits="0"/>
<line number="74" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="75,78"/>
<line number="75" hits="0"/>
<line number="76" hits="0"/>
<line number="78" hits="0"/>
<line number="80" hits="0"/>
<line number="81" hits="0"/>
<line number="82" hits="0"/>
<line number="84" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="85" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="86" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="87" hits="0"/>
<line number="88" hits="0"/>
<line number="90" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="91,93"/>
<line number="91" hits="0"/>
<line number="93" hits="0"/>
<line number="95" hits="0"/>
<line number="96" hits="0"/>
<line number="97" hits="0"/>
<line number="100" hits="1"/>
<line number="101" hits="1"/>
</lines>
</class>
</classes>
</package>
<package name="api.cruds" line-rate="0.3636" branch-rate="1" complexity="0">
<classes>
<class name="users.py" filename="api/cruds/users.py" complexity="0" line-rate="0.3636" branch-rate="1">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="2" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="0"/>
<line number="9" hits="1"/>
<line number="10" hits="0"/>
<line number="13" hits="1"/>
<line number="14" hits="0"/>
<line number="17" hits="1"/>
<line number="18" hits="0"/>
<line number="19" hits="0"/>
<line number="20" hits="0"/>
<line number="21" hits="0"/>
<line number="24" hits="1"/>
<line number="25" hits="0"/>
<line number="26" hits="0"/>
<line number="27" hits="0"/>
<line number="28" hits="0"/>
<line number="31" hits="1"/>
<line number="32" hits="0"/>
<line number="33" hits="0"/>
<line number="34" hits="0"/>
</lines>
</class>
</classes>
</package>
<package name="api.models" line-rate="0.7931" branch-rate="0.9" complexity="0">
<classes>
<class name="__init__.py" filename="api/models/__init__.py" complexity="0" line-rate="1" branch-rate="1">
<methods/>
<lines/>
</class>
<class name="generic.py" filename="api/models/generic.py" complexity="0" line-rate="1" branch-rate="1">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="14" hits="1"/>
<line number="15" hits="1"/>
</lines>
</class>
<class name="users.py" filename="api/models/users.py" complexity="0" line-rate="0.7736" branch-rate="0.9">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="6" hits="1"/>
<line number="7" hits="1"/>
<line number="10" hits="1"/>
<line number="11" hits="1"/>
<line number="13" hits="1"/>
<line number="14" hits="1"/>
<line number="15" hits="1"/>
<line number="16" hits="1"/>
<line number="17" hits="1"/>
<line number="18" hits="1"/>
<line number="19" hits="1"/>
<line number="21" hits="1"/>
<line number="22" hits="0"/>
<line number="23" hits="0"/>
<line number="24" hits="0"/>
<line number="27" hits="0"/>
<line number="29" hits="1"/>
<line number="30" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="31" hits="0"/>
<line number="32" hits="0" branch="true" condition-coverage="0% (0/2)" missing-branches="33,35"/>
<line number="33" hits="0"/>
<line number="35" hits="0"/>
<line number="37" hits="0"/>
<line number="43" hits="0"/>
<line number="47" hits="1"/>
<line number="48" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="49" hits="0"/>
<line number="52" hits="0"/>
<line number="54" hits="1"/>
<line number="55" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="56" hits="1"/>
<line number="67" hits="1"/>
<line number="68" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="69" hits="1"/>
<line number="77" hits="1"/>
<line number="78" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="79" hits="1"/>
<line number="88" hits="1"/>
<line number="89" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="90" hits="1"/>
<line number="99" hits="1"/>
<line number="100" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="101" hits="1"/>
<line number="109" hits="1"/>
<line number="110" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="111" hits="1"/>
<line number="115" hits="1"/>
<line number="116" hits="1" branch="true" condition-coverage="100% (2/2)"/>
<line number="117" hits="1"/>
</lines>
</class>
</classes>
</package>
</packages>
</coverage>

File diff suppressed because it is too large Load Diff

View File

163
run.sh
View File

@ -1,27 +1,144 @@
#!/bin/bash
#!/usr/bin/env bash
export USER_MANAGER=auth-domain/user-manager
docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.prod -t $USER/user-manager:prod
export FLIGHTS_INFORMATION=flights-domain/flights-information
docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.prod -t $USER/flights-information:prod
docker build gateway -f gateway/Dockerfile.prod -t $USER/gateway:prod
usage() {
printf "$0 usage: \n -x: down\n -d \$DOMAIN: domain\n -t: tests\n" $0
exit 0
}
docker build screen-domain -f screen-domain/Dockerfile.prod -t $USER/screen-client:prod
docker build browser-domain -f browser-domain/Dockerfile.prod -t $USER/browser-client:prod
domain=
down=
tests=
export API_IMAGE=$USER/flights-information:prod
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod up -d
export API_IMAGE=$USER/user-manager:prod
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod up -d
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py recreate_db
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py seed_db
export API_IMAGE=$USER/gateway:prod
docker compose -f gateway/docker-compose.yml down
docker compose -f gateway/docker-compose.yml up -d
while getopts ":hd:xt" arg; do
case $arg in
x) down=Y ;;
d) domain=${OPTARG} ;;
t) tests=Y ;;
h | *) usage ;;
esac
done
export CLIENT_IMAGE=$USER/screen-client:prod
docker compose -f screen-domain/docker-compose.yml up -d
export CLIENT_IMAGE=$USER/browser-client:prod
docker compose -f browser-domain/docker-compose.yml up -d
if [ -n "$domain" ] && [ -n "$down" ]; then
case "$domain" in
'auth')
export API_IMAGE=$USER/user-manager:prod
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
;;
'flights')
export API_IMAGE=$USER/flights-information:prod
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
;;
'gateway')
export API_IMAGE=$USER/gateway:prod
docker compose -f gateway/docker-compose.yml down
;;
'screen')
export CLIENT_IMAGE=$USER/screen-client:prod
docker compose -f screen-domain/docker-compose.yml down
;;
'browser')
export CLIENT_IMAGE=$USER/browser-client:prod
docker compose -f browser-domain/docker-compose.yml down
;;
*) exit 1 ;;
esac
elif [ -n "$domain" ] && [ -z "$down" ]; then
case "$domain" in
'auth')
export USER_MANAGER=auth-domain/user-manager
docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.prod -t $USER/user-manager:prod
if [ -n "$tests" ]; then
docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.test --build-arg "BASE_IMAGE=$USER/user-manager:prod" -t $USER/user-manager:test
export API_IMAGE=$USER/user-manager:test
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.dev up --abort-on-container-exit
else
export API_IMAGE=$USER/user-manager:prod
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod up -d
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py recreate_db
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py seed_db
fi
;;
'flights')
export FLIGHTS_INFORMATION=flights-domain/flights-information
docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.prod -t $USER/flights-information:prod
if [ -n "$tests" ]; then
docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.test --build-arg "BASE_IMAGE=$USER/flights-information:prod" -t $USER/flights-information:test
export API_IMAGE=$USER/flights-information:test
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.dev down
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.dev up --abort-on-container-exit
else
export API_IMAGE=$USER/flights-information:prod
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod up -d
fi
;;
'gateway')
docker build gateway -f gateway/Dockerfile.prod -t $USER/gateway:prod
if [ -n "$tests" ]; then
docker build gateway -f gateway/Dockerfile.test --build-arg "BASE_IMAGE=$USER/gateway:prod" -t $USER/gateway:test
export API_IMAGE=$USER/gateway:test
docker compose -f gateway/docker-compose.yml down
docker compose -f gateway/docker-compose.yml up -d
else
export API_IMAGE=$USER/gateway:prod
docker compose -f gateway/docker-compose.yml down
docker compose -f gateway/docker-compose.yml up -d
fi
;;
'screen')
docker build screen-domain -f screen-domain/Dockerfile.prod -t $USER/screen-client:prod
export CLIENT_IMAGE=$USER/screen-client:prod
docker compose -f screen-domain/docker-compose.yml up -d
;;
'browser')
docker build browser-domain -f browser-domain/Dockerfile.prod -t $USER/browser-client:prod
export CLIENT_IMAGE=$USER/browser-client:prod
docker compose -f browser-domain/docker-compose.yml up -d
;;
*) exit 1 ;;
esac
elif [ -n "$down" ]; then
export API_IMAGE=$USER/flights-information:prod
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
export API_IMAGE=$USER/user-manager:prod
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
export API_IMAGE=$USER/gateway:prod
docker compose -f gateway/docker-compose.yml down
export CLIENT_IMAGE=$USER/screen-client:prod
docker compose -f screen-domain/docker-compose.yml down
export CLIENT_IMAGE=$USER/browser-client:prod
docker compose -f browser-domain/docker-compose.yml down
else
export USER_MANAGER=auth-domain/user-manager
docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.prod -t $USER/user-manager:prod
export FLIGHTS_INFORMATION=flights-domain/flights-information
docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.prod -t $USER/flights-information:prod
docker build gateway -f gateway/Dockerfile.prod -t $USER/gateway:prod
docker build screen-domain -f screen-domain/Dockerfile.prod -t $USER/screen-client:prod
docker build browser-domain -f browser-domain/Dockerfile.prod -t $USER/browser-client:prod
export API_IMAGE=$USER/flights-information:prod
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod up -d
export API_IMAGE=$USER/user-manager:prod
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod up -d
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py recreate_db
docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py seed_db
export API_IMAGE=$USER/gateway:prod
docker compose -f gateway/docker-compose.yml down
docker compose -f gateway/docker-compose.yml up -d
export CLIENT_IMAGE=$USER/screen-client:prod
docker compose -f screen-domain/docker-compose.yml up -d
export CLIENT_IMAGE=$USER/browser-client:prod
docker compose -f browser-domain/docker-compose.yml up -d
fi