DEV-98 improved build.sh for microservices
This commit is contained in:
parent
fe1f229744
commit
8316097166
2
VERSION
2
VERSION
@ -1 +1 @@
|
|||||||
0.2.5,microservices initial
|
0.2.6,improved build.sh for microservices
|
||||||
18
microservices/.env
Normal file
18
microservices/.env
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
CVTT_USER=1000:1000
|
||||||
|
CVTT_VERSION=0.0.1
|
||||||
|
|
||||||
|
# MDGW_CONFIG_FILE=config_musvc.cfg
|
||||||
|
# MDGW_CREDS_FILE=.creds
|
||||||
|
MDGW_LOG_FILE=%D.md_gateway.log
|
||||||
|
MDGW_ADD_ARGS=
|
||||||
|
|
||||||
|
# OEGW_CONFIG_FILE=config_musvc.cfg
|
||||||
|
# OEGW_CREDS_FILE=.creds
|
||||||
|
OEGW_LOG_FILE=%D.oe_gateway.log
|
||||||
|
#OEGW_ADD_ARGS="--log_level=DEBUG --debug_mode"
|
||||||
|
OEGW_ADD_ARGS="--debug_mode"
|
||||||
|
|
||||||
|
# ACGW_CONFIG_FILE=config_musvc.cfg
|
||||||
|
# ACGW_CREDS_FILE=.creds
|
||||||
|
ACGW_LOG_FILE=%D.ac_gateway.log
|
||||||
|
ACGW_ADD_ARGS=
|
||||||
@ -1,41 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "Usage: ${0} <cvttpy_version>"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
CvttpyVersion=${1}
|
|
||||||
|
|
||||||
if [ "${CvttpyVersion}" == "" ]
|
|
||||||
then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Settings
|
|
||||||
ImageName=ac_gateway
|
|
||||||
RegistryService=cloud21.cvtt.vpn:5500
|
|
||||||
# --- Settings
|
|
||||||
|
|
||||||
|
|
||||||
DockerDir=$(realpath $(dirname ${0}))
|
|
||||||
Version=${CvttpyVersion}
|
|
||||||
|
|
||||||
cd ${DockerDir}
|
|
||||||
|
|
||||||
source ../mu_svc_functions.sh
|
|
||||||
get_project_version cvttpy ${Version}
|
|
||||||
|
|
||||||
function cleanup {
|
|
||||||
cd ${DockerDir}
|
|
||||||
rm -rf cvttpy
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
build_docker_image ${ImageName} ${RegistryService} ${Version}
|
|
||||||
|
|
||||||
|
|
||||||
# echo "**** D E B U G E X I T" && exit
|
|
||||||
echo "***** ${0} D O N E"
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,14 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ConfigDir=/config
|
ConfigDir=/config
|
||||||
Config="${ConfigDir}/cvtt_musvc.cfg"
|
LogDir=/logs
|
||||||
Creds="${ConfigDir}/.creds"
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd+=" cvttpy/apps/microservices/market_gateways/accounting_gateway.py"
|
Cmd+=" cvttpy/apps/microservices/market_gateways/accounting_gateway.py"
|
||||||
Cmd+=" --config=${Config}"
|
Cmd+=" --config=${ConfigDir}/${ACGW_CONFIG_FILE:-cvtt_musvc.cfg}"
|
||||||
Cmd+=" --credentials_file=${Creds}"
|
Cmd+=" --credentials_file=${ConfigDir}/${ACGW_CREDS_FILE:-.creds}"
|
||||||
Cmd+=" --log_file=/logs/%T.ac_gateway.log"
|
Cmd+=" --log_file=${LogDir}/${ACGW_LOG_FILE:-%T.ac_gateway.log}"
|
||||||
Cmd+=" ${ACGW_ADD_ARGS}"
|
Cmd+=" ${ACGW_ADD_ARGS}"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
exec ${Cmd}
|
exec ${Cmd}
|
||||||
|
|||||||
@ -6,5 +6,4 @@ redis>=5.0.8
|
|||||||
python-dateutil>=2.8.2
|
python-dateutil>=2.8.2
|
||||||
types-python-dateutil>=2.8.19.6
|
types-python-dateutil>=2.8.19.6
|
||||||
cryptography>=43.0.0
|
cryptography>=43.0.0
|
||||||
jwt>=1.3.1
|
PyJWT>=2.10.1
|
||||||
|
|
||||||
|
|||||||
79
microservices/build.sh
Executable file
79
microservices/build.sh
Executable file
@ -0,0 +1,79 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 -I <image_name> -V <image_version> -L <library>:<library_version>"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Settings
|
||||||
|
RegistryService=cloud21.cvtt.vpn:5500
|
||||||
|
# --- Settings
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------- cmdline
|
||||||
|
while getopts "I:V:L:" opt; do
|
||||||
|
case ${opt} in
|
||||||
|
I )
|
||||||
|
ImageName=$OPTARG
|
||||||
|
;;
|
||||||
|
V )
|
||||||
|
ImageVersion=$OPTARG
|
||||||
|
;;
|
||||||
|
L )
|
||||||
|
Library=$OPTARG
|
||||||
|
;;
|
||||||
|
\? )
|
||||||
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
: )
|
||||||
|
echo "Option -$OPTARG requires an argument." >&2
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
# ---------------- cmdline
|
||||||
|
|
||||||
|
if [ "${ImageName}" == "" ]
|
||||||
|
then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${ImageVersion}" == "" ]
|
||||||
|
then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
Project=
|
||||||
|
ProjectVersion=
|
||||||
|
if [ "${Library}" != "" ] ; then
|
||||||
|
IFS=':' read -ra parts <<< "${Library}"
|
||||||
|
Project=${parts[0]}
|
||||||
|
ProjectVersion=${parts[1]}
|
||||||
|
fi
|
||||||
|
# exit
|
||||||
|
|
||||||
|
DockerDir=$(realpath $(dirname ${0})/${ImageName})
|
||||||
|
|
||||||
|
cd ${DockerDir}
|
||||||
|
|
||||||
|
source ../mu_svc_functions.sh
|
||||||
|
if [ "${Project}" != "" ]; then
|
||||||
|
get_project_version ${Project} ${ProjectVersion}
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
function cleanup {
|
||||||
|
cd ${DockerDir}
|
||||||
|
rm -rf cvttpy
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
build_docker_image ${ImageName} ${RegistryService} ${ImageVersion}
|
||||||
|
|
||||||
|
|
||||||
|
# echo "**** D E B U G E X I T" && exit
|
||||||
|
echo "***** ${0} D O N E"
|
||||||
|
|
||||||
|
|
||||||
@ -3,8 +3,12 @@ services:
|
|||||||
md_gateway:
|
md_gateway:
|
||||||
image: cloud21.cvtt.vpn:5500/md_gateway:${CVTT_VERSION}
|
image: cloud21.cvtt.vpn:5500/md_gateway:${CVTT_VERSION}
|
||||||
container_name: md_gateway
|
container_name: md_gateway
|
||||||
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
||||||
|
MDGW_CONFIG_FILE: ${MDGW_CONFIG_FILE:-cvtt_musvc.cfg}
|
||||||
|
MDGW_CREDS_FILE: ${MDGW_CONFIG_FILE:-.creds}
|
||||||
|
MDGW_LOG_FILE: ${MDGW_LOG_FILE:-%T.md_gateway.log}
|
||||||
MDGW_ADD_ARGS: ${MDGW_ADD_ARGS:-}
|
MDGW_ADD_ARGS: ${MDGW_ADD_ARGS:-}
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
@ -15,8 +19,12 @@ services:
|
|||||||
oe_gateway:
|
oe_gateway:
|
||||||
image: cloud21.cvtt.vpn:5500/oe_gateway:${CVTT_VERSION}
|
image: cloud21.cvtt.vpn:5500/oe_gateway:${CVTT_VERSION}
|
||||||
container_name: oe_gateway
|
container_name: oe_gateway
|
||||||
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
||||||
|
OEGW_CONFIG_FILE: ${OEGW_CONFIG_FILE:-cvtt_musvc.cfg}
|
||||||
|
OEGW_CREDS_FILE: ${OEGW_CONFIG_FILE:-.creds}
|
||||||
|
OEGW_LOG_FILE: ${OEGW_LOG_FILE:-%T.oe_gateway.log}
|
||||||
OEGW_ADD_ARGS: ${OEGW_ADD_ARGS:-}
|
OEGW_ADD_ARGS: ${OEGW_ADD_ARGS:-}
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
@ -27,8 +35,12 @@ services:
|
|||||||
ac_gateway:
|
ac_gateway:
|
||||||
image: cloud21.cvtt.vpn:5500/ac_gateway:${CVTT_VERSION}
|
image: cloud21.cvtt.vpn:5500/ac_gateway:${CVTT_VERSION}
|
||||||
container_name: ac_gateway
|
container_name: ac_gateway
|
||||||
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
||||||
|
ACGW_CONFIG_FILE: ${ACGW_CONFIG_FILE:-cvtt_musvc.cfg}
|
||||||
|
ACGW_CREDS_FILE: ${ACGW_CONFIG_FILE:-.creds}
|
||||||
|
ACGW_LOG_FILE: ${ACGW_LOG_FILE:-%T.ac_gateway.log}
|
||||||
ACGW_ADD_ARGS: ${ACGW_ADD_ARGS:-}
|
ACGW_ADD_ARGS: ${ACGW_ADD_ARGS:-}
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
|
|||||||
@ -1,41 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "Usage: ${0} <version>"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
CvttpyVersion=${1}
|
|
||||||
|
|
||||||
if [ "${CvttpyVersion}" == "" ]
|
|
||||||
then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Settings
|
|
||||||
ImageName=md_gateway
|
|
||||||
RegistryService=cloud21.cvtt.vpn:5500
|
|
||||||
# --- Settings
|
|
||||||
|
|
||||||
|
|
||||||
DockerDir=$(realpath $(dirname ${0}))
|
|
||||||
Version=${CvttpyVersion}
|
|
||||||
|
|
||||||
cd ${DockerDir}
|
|
||||||
|
|
||||||
source ../mu_svc_functions.sh
|
|
||||||
get_project_version cvttpy ${Version}
|
|
||||||
|
|
||||||
function cleanup {
|
|
||||||
cd ${DockerDir}
|
|
||||||
rm -rf cvttpy
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
build_docker_image ${ImageName} ${RegistryService} ${Version}
|
|
||||||
|
|
||||||
|
|
||||||
# echo "**** D E B U G E X I T" && exit
|
|
||||||
echo "***** ${0} D O N E"
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,14 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ConfigDir=/config
|
ConfigDir=/config
|
||||||
Config="${ConfigDir}/cvtt_musvc.cfg"
|
LogDir=/logs
|
||||||
Creds="${ConfigDir}/.creds"
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd+=" cvttpy/apps/microservices/market_gateways/md_gateway.py"
|
Cmd+=" cvttpy/apps/microservices/market_gateways/md_gateway.py"
|
||||||
Cmd+=" --config=${Config}"
|
Cmd+=" --config=${ConfigDir}/${MDGW_CONFIG_FILE:-cvtt_musvc.cfg}"
|
||||||
Cmd+=" --credentials_file=${Creds}"
|
Cmd+=" --credentials_file=${ConfigDir}/${MDGW_CREDS_FILE:-.creds}"
|
||||||
Cmd+=" --log_file=/logs/%T.md_gateway.log"
|
Cmd+=" --log_file=${LogDir}/${MDGW_LOG_FILE:-%T.md_gateway.log}"
|
||||||
Cmd+=" ${MDGW_ADD_ARGS}"
|
Cmd+=" ${MDGW_ADD_ARGS}"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
exec ${Cmd}
|
exec ${Cmd}
|
||||||
|
|||||||
@ -6,4 +6,4 @@ redis>=5.0.8
|
|||||||
python-dateutil>=2.8.2
|
python-dateutil>=2.8.2
|
||||||
types-python-dateutil>=2.8.19.6
|
types-python-dateutil>=2.8.19.6
|
||||||
cryptography>=43.0.0
|
cryptography>=43.0.0
|
||||||
jwt>=1.3.1
|
PyJWT>=2.10.1
|
||||||
|
|||||||
@ -1,41 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "Usage: ${0} <version>"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
CvttpyVersion=${1}
|
|
||||||
|
|
||||||
if [ "${CvttpyVersion}" == "" ]
|
|
||||||
then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Settings
|
|
||||||
ImageName=oe_gateway
|
|
||||||
RegistryService=cloud21.cvtt.vpn:5500
|
|
||||||
# --- Settings
|
|
||||||
|
|
||||||
|
|
||||||
DockerDir=$(realpath $(dirname ${0}))
|
|
||||||
Version=${CvttpyVersion}
|
|
||||||
|
|
||||||
cd ${DockerDir}
|
|
||||||
|
|
||||||
source ../mu_svc_functions.sh
|
|
||||||
get_project_version cvttpy ${Version}
|
|
||||||
|
|
||||||
function cleanup {
|
|
||||||
cd ${DockerDir}
|
|
||||||
rm -rf cvttpy
|
|
||||||
}
|
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
build_docker_image ${ImageName} ${RegistryService} ${Version}
|
|
||||||
|
|
||||||
|
|
||||||
# echo "**** D E B U G E X I T" && exit
|
|
||||||
echo "***** ${0} D O N E"
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,14 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ConfigDir=/config
|
ConfigDir=/config
|
||||||
Config="${ConfigDir}/cvtt_musvc.cfg"
|
LogDir=/logs
|
||||||
Creds="${ConfigDir}/.creds"
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd+=" cvttpy/apps/microservices/market_gateways/order_entry_gateway.py"
|
Cmd+=" cvttpy/apps/microservices/market_gateways/order_entry_gateway.py"
|
||||||
Cmd+=" --config=${Config}"
|
Cmd+=" --config=${ConfigDir}/${OEGW_CONFIG_FILE:-cvtt_musvc.cfg}"
|
||||||
Cmd+=" --credentials_file=${Creds}"
|
Cmd+=" --credentials_file=${ConfigDir}/${OEGW_CREDS_FILE:-.creds}"
|
||||||
Cmd+=" --log_file=/logs/%T.oe_gateway.log"
|
Cmd+=" --log_file=${LogDir}/${OEGW_LOG_FILE:-%T.oe_gateway.log}"
|
||||||
Cmd+=" ${OEGW_ADD_ARGS}"
|
Cmd+=" ${OEGW_ADD_ARGS}"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
exec ${Cmd}
|
exec ${Cmd}
|
||||||
|
|||||||
@ -6,6 +6,6 @@ redis>=5.0.8
|
|||||||
python-dateutil>=2.8.2
|
python-dateutil>=2.8.2
|
||||||
types-python-dateutil>=2.8.19.6
|
types-python-dateutil>=2.8.19.6
|
||||||
cryptography>=43.0.0
|
cryptography>=43.0.0
|
||||||
jwt>=1.3.1
|
PyJWT>=2.10.1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user