You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we need to eliminate the user interaction and Mojafos behaviour should be driven from the initial parameters
if you want to deploy or destroy vNext and 2 Mifos and PHEE we need to be able to do something like run.sh -m install -s ml_mf2_ph with the -s string determining the services and the counts to be made (see below for an outline). This is important as it means we can out this into CI/CD (circleCi) and do full system testing using Mojafos for vNext,Mifos and PHEE (which will be especially cool once we start running txns end-to end)
example parameter handling code
#!/bin/bash
# Default values
mode=""
ml=true
mf=true
ph=true
mf_count=1
# Usage function
usage() {
echo "Usage: $0 -m [install|delete] [-s <string>] [-c <count>]"
echo "Options:"
echo " -m: Mode (install or delete)"
echo " -s: Services to operate on (ml, mf, ph)"
echo " -c: Count for mf service (default: 1)"
exit 1
}
# Parse options
while getopts ":m:s:c:" opt; do
case $opt in
m)
mode=$OPTARG
;;
s)
ml=false
mf=false
ph=false
services=($(echo $OPTARG | tr ',' ' '))
for service in "${services[@]}"; do
case $service in
ml)
ml=true
;;
mf)
mf=true
;;
ph)
ph=true
;;
*)
echo "Invalid service: $service"
usage
;;
esac
done
;;
c)
mf_count=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
usage
;;
:)
echo "Option -$OPTARG requires an argument." >&2
usage
;;
esac
done
# Check if mode is provided
if [ -z "$mode" ]; then
echo "Mode is required."
usage
fi
# Perform actions based on mode
if [ "$mode" = "install" ]; then
echo "Installing selected services:"
$ml && echo "- Installing ml"
$mf && echo "- Installing $mf_count mf"
$ph && echo "- Installing ph"
elif [ "$mode" = "delete" ]; then
echo "Deleting selected services:"
$ml && echo "- Deleting ml"
$mf && echo "- Deleting $mf_count mf"
$ph && echo "- Deleting ph"
else
echo "Invalid mode. Mode should be 'install' or 'delete'."
usage
fi (edited)
The text was updated successfully, but these errors were encountered:
I think we need to eliminate the user interaction and Mojafos behaviour should be driven from the initial parameters
The text was updated successfully, but these errors were encountered: