diff --git a/emulator/.env b/emulator/.env new file mode 100644 index 0000000..94d275c --- /dev/null +++ b/emulator/.env @@ -0,0 +1,19 @@ +DIGIFI_PORT=5177 + +# Social Links +FACEBOOK_URL=https://www.facebook.com +TWITTER_URL=https://twitter.com +INSTAGRAM_URL=https://www.instagram.com + +# BACKEND END POINTS +REACT_APP_MAIN_API='http://10.2.249.133:4700' +REACT_APP_EVENT_API='http://10.2.249.133:5000' + + +# ENQUIRIES CONTACTS +VITE_CALL_ENDPOINT='09099000000' +VITE_EMAIL_ENDPOINT='fcmbloan@support.com' + +#BANK NAME +VITE_BANK_NAME='First City Monument Bank' +VITE_BANK_NAME_SHORT='FCMB' \ No newline at end of file diff --git a/emulator/docker-compose.yml b/emulator/docker-compose.yml new file mode 100644 index 0000000..77e847a --- /dev/null +++ b/emulator/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' +services: + digifi-firstadvanceemulator: + image: "registry.simbrellang.net/digifi/firstadvanceemulator:latest" +# build: +# context: . +# dockerfile: Dockerfile + restart: unless-stopped +# volumes: +# - ./:/app +# - '/app/node_modules' + ports: + - 6038:${DIGIFI_PORT} + expose: + - "${DIGIFI_PORT}" + extra_hosts: + - digifi-apidev.chiefsoft.net:10.10.33.15 + - devcore.digifi.chiefsoft.net:10.10.33.15 + - core.digifi.chiefsoft.net:10.10.33.15 + environment: + - PORT=${DIGIFI_PORT} + tty: true + stdin_open: true +volumes: + src: + +#networks: +# default: +# driver: bridge +# ipam: +# config: +# - subnet: 172.16.11.0/24 \ No newline at end of file diff --git a/emulator/start_release.sh b/emulator/start_release.sh new file mode 100644 index 0000000..7a138c9 --- /dev/null +++ b/emulator/start_release.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +log() { + local message="$1" + echo -e "\033[32mLog: $message\033[0m" +} + +handle_error() { + local error_message="$1" + echo -e "\033[31mError: $error_message\033[0m" + exit 1 +} + +retry() { + local max_attempts=2 + local attempt=1 + local delay=1 + + while true; do + "$@" && break || { + if [ $attempt -lt $max_attempts ]; then + log "Command failed (attempt $attempt/$max_attempts). Retrying in $delay seconds..." + sleep $delay + delay=$((delay * 2)) + ((attempt++)) + else + handle_error "Command failed after $attempt attempts: $*" + fi + } + done +} + + +################################################################################ +# MAIN +################################################################################ +if [ "$1" == "product" ]; then + #start_services + docker login -u="admin" -p="may12002" registry.simbrellang.net + + retry docker pull registry.simbrellang.net/digifi/firstadvanceemulator:latest + + +elif [ "$1" == "clean" ]; then + retry docker stop digi_co +else + handle_error "Invalid argument. Use 'clean' or 'product'." +fi +