# Pipeline para integração contínua do projeto
#
# Tem uma seção para deploy automático em homologação quando o branch developers
# é alterado e uma seção customizada para deploy manual em produção.

image: node:20.12.2

definitions:
    caches:
        node: node_modules

    steps:
        - step: &buildHomologa
              name: Build Homologa
              caches:
                  - node
              script:
                  - echo "Compilando homologação"
                  - apt-get update
                  - apt-get install -y zip
                  - rm -f .env
                  - touch .env
                  - echo "TIPO_AMBIENTE=DESENVOLVIMENTO" >> .env
                  - echo "REMETENTE_MAIL=gestorhomologa@hotmail.com" >> .env
                  - echo "SECRET=$@!Showtecnologia0103" >> .env
                  - echo "HOST_DEFAULT=homologabanco.showtecnologia.com" >> .env
                  - echo "PORT_DEFAULT=3306" >> .env
                  - echo "USER_DEFAULT=devs_homologacao" >> .env
                  - echo "PASSWORD_DEFAULT=192uUA_sp_VF" >> .env
                  - echo "DATABASE_DEFAULT=showtecsystem" >> .env
                  - echo "HOST_DEFAULT_RASTREAMENTO=homologabanco.showtecnologia.com" >> .env
                  - echo "PORT_DEFAULT_RASTREAMENTO=3307" >> .env
                  - echo "USER_DEFAULT_RASTREAMENTO=devs_homologacao" >> .env
                  - echo "PASSWORD_DEFAULT_RASTREAMENTO=192uUA_sp_VF" >> .env
                  - echo "DATABASE_DEFAULT_RASTREAMENTO=rastreamento" >> .env
                  - echo "HOST_DEFAULT_POST=homologabanco.showtecnologia.com" >> .env
                  - echo "PORT_DEFAULT_POST=3308" >> .env
                  - echo "USER_DEFAULT_POST=devs_homologacao" >> .env
                  - echo "PASSWORD_DEFAULT_POST=192uUA_sp_VF" >> .env
                  - echo "DATABASE_DEFAULT_POST=omnilink" >> .env
                  - echo "BUCKET_S3=homologa-nodejs" >> .env
                  - echo "BUCKET_S3_OMNISAFE=homologa-nodejs" >> .env
                  - echo "BUCKET_S3_ARQUIVOS=homologa-nodejs" >> .env
                  - echo "BUCKET_S3_GRAVACOES_OMNICOM=gravacoes-omnicom-homologacao" >> .env
                  - echo "ACCESS_KEY_ID_S3=AKIAQEHLA6SCR4QIVK4E" >> .env
                  - echo "SECRET_ACCESS_KEY_S3=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" >> .env
                  - echo "BUCKET_S3_SCORE=homologa-nodejs" >> .env
                  - echo "ACCESS_KEY_ID_S3_SCORE=AKIAQEHLA6SCRQI7RDMC" >> .env
                  - echo "SECRET_ACCESS_KEY_S3_SCORE=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" >> .env
                  - echo "BASE_URL_SHOW=https://homologa.showtecnologia.com/gestor/index.php" >> .env
                  - echo "BASE_URL_OMNILINK=https://homologa.showtecnologia.com/gestor/index.php" >> .env
                  - echo "BASE_URL_CEABS=https://homologa.showtecnologia.com/gestor/index.php" >> .env
                  - echo "BASE_URL_SAVER=10.7.4.11" >> .env
                  - echo "BASE_URL_IASWS=http://10.130.0.132:12100/iasws/iasws.asmx?wsdl" >> .env
                  - echo "TELEMETRY_ACCESS_TOKEN=dafac585528848eb27fd767cd346d8da" >> .env
                  - echo "TELEMETRY_API_ENDPOINT=http://10.130.0.167:84/api" >> .env
                  - echo "TOKEN_SHOWNET=d0763b6e9ada39138f3a23be3e799c00" >> .env
                  - echo "TOKEN_MAIL=d802b964bb4259414d58cfbbcd430fed" >> .env
                  - echo "TOKEN_POWERBI=c8597cab493291abbf18702738e5bdd0" >> .env
                  - echo "TOKEN_CRM=f0b4a5897ad979df44b81f3a074e2908" >> .env
                  - echo "TOKEN_CRM_NATIVA=f0b4a5897ad979df44b81f3a074e2908" >> .env
                  - echo "BASE_URL_CRM_ODATA_API=https://hmlcrm.omnilink.com.br/CRM/api/data/v8.2/" >> .env
                  - echo "CRM_NTLM_USER=svc.omni.shownet" >> .env
                  - echo "CRM_NTLM_PASS=Dynamics2@19" >> .env
                  - echo "REGIAO_DYNAMO=us-east-1" >> .env
                  - echo "ENDPOINT_DYNAMO=https://dynamodb.us-east-1.amazonaws.com" >> .env
                  - echo "ACCESS_KEY_ID_DYNAMO=AKIAQEHLA6SC4QMLCJ6P" >> .env
                  - echo "SECRET_ACCESS_KEY_DYNAMO=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" >> .env
                  - echo "SES_USER_AWS=node.homologacao@gmail.com" >> .env
                  - echo "SES_PASS_AWS=BLPIamRVlMrTAx09VYo1FGSDPuejae1rogBVQPI2ACkL" >> .env
                  - echo "SES_HOST_AWS=smtp.gmail.com" >> .env
                  - echo "SES_PORT_AWS=2525" >> .env
                  - echo "PORT=3333" >> .env
                  - echo "CACHE_HOST=$CACHE_HOST" >> .env
                  - echo "CACHE_PORT=6379" >> .env
                  - echo "REDIS_OMNISCORE_HOST=$REDIS_OMNISCORE_HOST" >> .env
                  - echo "REDIS_OMNISCORE_PORT=$REDIS_OMNISCORE_PORT" >> .env
                  - echo "BASE_URL_LINKER=http://web.omnilink.com.br/api?wsdl" >> .env
                  - echo "USUARIO_API_LINKER=zatix\svc.omni.apilinker" >> .env
                  - echo "SENHA_API_LINKER=P@ssw0rD" >> .env
                  - echo "BASE_URL_ESPELHAMENTO=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_ESPELHAMENTO_VEICULOS=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_CRM=http://10.130.2.20/crmintegration/api" >> .env
                  - echo "BASE_URL_SHOWNET=http://hml-apishownet.showtecnologia.com:9099/" >> .env
                  - echo "TOKEN_INFOBIP=fcd279da-0436-4368-9ba2-3e90f348d1ad" >> .env
                  - echo "LIMITE_CONEXOES_USUARIO=300" >> .env
                  - echo "BASE_URL_INFOBIP=yrpgqp.api.infobip.com" >> .env
                  - echo "TIMEOUT_SERVIDOR=60000" >> .env
                  - echo "TOKEN_OMNITAG=4ab59b419f3139e1e1fe1177daa942044bce7b7c38eb5d9c5a5b5d8f99a399b9" >> .env
                  - echo "BASE_URL_API_EXATO=https://api.exato.digital/" >> .env
                  - echo "TOKEN_EXATO=f358bddfa17746188e88811db263a256" >> .env
                  - echo "BASE_URL_API_CREDIFY=https://apibd.credify.com.br/" >> .env
                  - echo "TOKEN_CREDIFY=7g1r7gf311f718f1hf7fhf9j9j1f9j19" >> .env
                  - echo "BASE_URL_API_QUOD=https://api.empresas.quod.com.br/" >> .env
                  - echo "USER_QUOD=hmlzatix" >> .env
                  - echo "PASSWORD_QUOD=hmlzatix" >> .env
                  - echo "BASE_URL_API_PLEXI=https://api.plexi.com.br/" >> .env
                  - echo "TOKEN_PLEXI=8465qkEyBfiSVmEXvb60qODuuCnWiMMtpLtIDI2" >> .env
                  - echo "BASE_URL_API_INFOSIMPLES=https://api.infosimples.com/" >> .env
                  - echo "TOKEN_INFOSIMPLES=M4owA8tyANY5GA-mq-75N4xqxh2tGDcZWF7AxPo9" >> .env
                  - echo "LOGIN_GOV=Teste" >> .env
                  - echo "SENHA_GOV=Teste" >> .env
                  - echo "GR_DATABASE=GR" >> .env
                  - echo "BASE_URL_API=apiinterna.showtecnologia.com" >> .env
                  - echo "API_ERP_BASE_URL=" >> .env
                  - echo "API_ERP_TOKEN=" >> .env
                  - echo "FOCUS_NFE_BASE_URL=https://api.focusnfe.com.br/v2" >> .env
                  - echo "FOCUS_NFE_DOWNLOAD_BASE_URL=https://homologacao.focusnfe.com.br" >> .env
                  - echo "HOMOLOGACAO_URL_FOCUS=https://homologacao.focusnfe.com.br/v2" >> .env
                  - echo "FOCUS_NFE_TOKEN=jdkasjdka" >> .env
                  - echo "TOKEN_OMNI_ID=c3513a1eb652d3665b32b087b3ca779162a5af6b73671796ea1fd69f0358c25c" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=eDG!6KwFEa74SufYdOt1+!L9gRKqT8MT&a9JE9ikEOW@im55S5D?B%WQ?9" >> .env
                  - echo "BASE_URL_WSTT=http://3.143.213.170:8080/iasws/iasws.asmx?wsdl" >> .env
                  - echo "REDIS_STACK_HOST=10.7.4.82" >> .env
                  - echo "REDIS_STACK_PORT=6379" >> .env
                  - echo "BASE_URL_INVERTEXTO=https://api.invertexto.com/v1/holidays/" >> .env
                  - echo "TOKEN_INVERTEXTO=2129|7TxItl56NwX6Bg6OwmTeDgPUmOLWeL4w" >> .env
                  - echo "TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID_DEV" >> .env
                  - echo "TWILIO_API_KEY=$TWILIO_API_KEY_DEV" >> .env
                  - echo "TWILIO_API_SECRET=$TWILIO_API_SECRET_DEV" >> .env
                  - echo "TWILIO_OUT_GOING_APP_SID=$TWILIO_OUT_GOING_APP_SID_DEV" >> .env
                  - echo "TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN_DEV" >> .env
                  - echo "TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO=0.1" >> .env
                  - echo "TWILIO_TOKEN_WEBHOOK=6d29da79-db44-4a2d-88a9-56bc487d2646" >> .env
                  - echo "TWILIO_SID_SHOWNET=$TWILIO_SID_SHOWNET_DEV" >> .env
                  - echo "TWILIO_TOKEN_SHOWNET=$TWILIO_TOKEN_SHOWNET_DEV" >> .env
                  - echo "TOKEN_INTEGRACAO_VIVO_INTELBRAS=c4813fa70ec248b3439b5276d28ec53c" >> .env
                  - echo "URI_SOCKET_VIVO_INTELBRAS=widevoice.intelbras.com.br" >> .env
                  - echo "SENHA_SOCKET_VIVO_INTELBRAS=itb@3131" >> .env
                  - echo "SOCKET_VIVO_INTELBRAS=wss://widevoice.intelbras.com.br:8089/ws" >> .env
                  - echo "BASE_URL_TELEGRAM=https://api.telegram.org/bot" >> .env
                  - echo "TELEGRAM_ACCESS_TOKEN=5877492689:AAF-4CiWiXJglCwPzzBv3FXykRvgPgfgZFk" >> .env
                  - echo "BASE_URL_ZATIX_SOAP=http://zatixtecnologia128050.protheus.cloudtotvs.com.br:4040/ws9901/CUSTOMER.apw" >> .env
                  - echo "LOG_NIVEL=info" >> .env
                  - echo "LOG_DESTINO=" >> .env
                  - echo "LOG_STDOUT=true" >> .env
                  - echo "CMSV6_BASE_URL=http://20.195.197.113:8088" >> .env
                  - echo "CMSV6_USUARIO=admin" >> .env
                  - echo "CMSV6_SENHA=Omni&453238" >> .env
                  - echo "BASE_URL_API_INTEGRACOES_OMNIGR=http://10.7.18.189:9094" >> .env
                  - echo "BASE_URL_API_NODE=http://homologacao-env-1.eba-uaem5jqq.us-east-2.elasticbeanstalk.com/api/" >> .env
                  - echo "TOKEN_CHATBOT_OMNICOM=a93912d8-acfd-4308-9f05-fcaff6e25d44" >> .env
                  - echo "BASE_URL_SEM_PARAR=https://apphom.viafacil.com.br/wsvp/ValePedagio?wsdl" >> .env
                  - echo "BASE_URL_MAPLINK=https://api.maplink.global" >> .env
                  - echo "CLIENT_ID_MAPLINK=$CLIENT_ID_MAPLINK" >> .env
                  - echo "CLIENT_SECRET_MAPLINK=$CLIENT_SECRET_MAPLINK" >> .env
                  - echo "BRASPAG_HOST_HOMOLOGA=https://apisandbox.braspag.com.br/v2/" >> .env
                  - echo "BRASPAG_MERCHANT_ID_HOMOLOGA=F954E428-3A80-4D9F-8153-C56AA778C237" >> .env
                  - echo "BRASPAG_MERCHANT_KEY_HOMOLOGA=LUi4fA6woeQ1vtc3JtztnMd0eGQXCegvedwLWd6E" >> .env
                  - echo "TOKEN_APP_TELEMETRIA=ad0adc464ff8590981e6de42a1c02a7a" >> .env
                  - echo "KEYCRYPTO=$KEYCRYPTO" >> .env
                  - echo "IVCRYPTO=$IVCRYPTO" >> .env
                  - echo "NOMINATIM_SERVER=https://osm-aws.showtecnologia.com/nominatim" >> .env
                  - echo "APICADASTROSMHS=http://apimacro-hml.omnilink.com.br:5002/GruposMacroIdCliente" >> .env
                  - echo "APIEMBARQUEMHS=http://apicomando-hml.omnilink.com.br:5012/" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_HOST=gestor-node-hm.csvvg4.ng.0001.use2.cache.amazonaws.com" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_PORT=6379" >> .env
                  - echo "TOKEN_STREAMING_SELECIONADOS_SAFE=XemK%RMP98m!FF45BmO*EnkwZ9W@c+RMlLarc" >> .env
                  - echo "TOKEN_MIDDLEWARE_LAMBDA_SAFE"=p5of.sos3h%%pOSs43I-sdsf@as@asz5v_fs*876ee.f3jeeruik32e7d6rv%m2k >> .env
                  - echo "LAMBDA_VIDEO_URL"=url >> .env
                  - echo "LAMBDA_VIDEO_TOKEN"=token >> .env
                  - echo "TOKEN_BOT_OMNI_JORNADA=b32b88af-9bb4-486a-83ad-ebb6f76d8b6b" >> .env
                  - echo "BASE_URL_API_PLACAS=https://wdapi2.com.br/" >> .env
                  - echo "TOKEN_API_PLACAS=$TOKEN_API_PLACAS" >> .env
                  - echo "TIMEOUT_REQUESTS_PLACAS=120000" >> .env
                  - echo "BASE_URL_FINANCIAL_ERP=$BASE_URL_FINANCIAL_ERP" >> .env
                  - echo "USER_FINANCIAL_ERP=$USER_FINANCIAL_ERP" >> .env
                  - echo "PASS_FINANCIAL_ERP=$PASS_FINANCIAL_ERP" >> .env
                  - echo "REDIS_BOT_JORNADA_HOST=gestor-node-hm.csvvg4.ng.0001.use2.cache.amazonaws.com" >> .env
                  - echo "REDIS_BOT_JORNADA_PORT=6379" >> .env
                  - echo "REDIS_LAST_TRACK_HOST=gestor-node-hm.csvvg4.ng.0001.use2.cache.amazonaws.com" >> .env
                  - echo "REDIS_LAST_TRACK_PORT=6379" >> .env
                  - echo "TOKEN_SIGAMY=d275b1e3a6ea3c3700a07e9e6084eec642597931" >> .env
                  - echo "BASE_URL_SHOWNET_PORTAL_COMPRA=$BASE_URL_SHOWNET_PORTAL_COMPRA" >> .env
                  - echo "OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS=twilio.com" >> .env
                  - echo "BASE_URL_UPLOADS=http://localhost/shownet/newapp/" >> .env
                  - echo "REDIS_VIDEO_HOST=gestor-node-hm.csvvg4.ng.0001.use2.cache.amazonaws.com" >> .env
                  - echo "REDIS_VIDEO_PORT=6379" >> .env
                  - echo "REDIS_NOTIFICACOES_HOST=gestor-node-hm.csvvg4.ng.0001.use2.cache.amazonaws.com" >> .env
                  - echo "REDIS_NOTIFICACOES_PORT=6379" >> .env
                  - echo "STREAMING_SERVER_VIDEO_DNS=http://homologa.showtecnologia.com" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HOST=http://homologa.showtecnologia.com" >> .env
                  - echo "STREAMING_SERVER_VIDEO_TCP_PORT=5001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_UDP_PORT=5002" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HLS_PORT=6001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_WEBRTC_PORT=6002" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_TCP_PORT=5003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_UDP_PORT=5004" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_HLS_PORT=6003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_WEBRTC_PORT=6004" >> .env
                  - echo "VIDEO_WS_PORT=16608" >> .env
                  - echo "ID_CONTA_PRINCIPAL_PRODUCAO=1" >> .env
                  - echo "ID_CONTA_PRINCIPAL_HOMOLOGACAO=2121" >> .env
                  - echo "BASE_URL_API_TELEVENDAS=$BASE_URL_API_TELEVENDAS" >> .env
                  - echo "BASE_URL_API_TELEVENDAS_WEBSOCKET=$BASE_URL_API_TELEVENDAS_WEBSOCKET" >> .env
                  - npm install
                  - npm run build
                  - zip -r homologa.zip dist public documentacao .env node_modules package.json .platform gestor-425512-34a83fb0020d.json
                  - echo "Compilação concluída"
              artifacts:
                  - homologa.zip

        - step: &buildExterna
              name: Build API Externa
              caches:
                  - node
              script:
                  - echo "Compilando externa"
                  - rm -f .env
                  - touch .env
                  - echo "TIPO_AMBIENTE=EXTERNA" >> .env
                  - echo "REMETENTE_MAIL=no-reply@notificacaogestor.com" >> .env
                  - echo "SECRET=$SECRET_PRODUCAO" >> .env
                  - echo "LIMIT_CONNECTION=100" >> .env
                  - echo "HOST_DEFAULT=gestor.cqz90u2tvymu.us-east-2.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT=3306" >> .env
                  - echo "USER_DEFAULT=$USER_DEFAULT_EXTERNA" >> .env
                  - echo "PASSWORD_DEFAULT=$PASSWORD_DEFAULT_EXTERNA" >> .env
                  - echo "DATABASE_DEFAULT=showtecsystem" >> .env
                  - echo "LIMIT_CONNECTION_RASTREAMENTO=100" >> .env
                  - echo "HOST_DEFAULT_RASTREAMENTO=10.7.14.187" >> .env
                  - echo "PORT_DEFAULT_RASTREAMENTO=3306" >> .env
                  - echo "USER_DEFAULT_RASTREAMENTO=$USER_DEFAULT_EXTERNA" >> .env
                  - echo "PASSWORD_DEFAULT_RASTREAMENTO=$PASSWORD_DEFAULT_EXTERNA" >> .env
                  - echo "DATABASE_DEFAULT_RASTREAMENTO=rastreamento" >> .env
                  - echo "HOST_DEFAULT_POST=omnilink-post2.cluster-cqz90u2tvymu.us-east-2.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT_POST=3306" >> .env
                  - echo "USER_DEFAULT_POST=$USER_DEFAULT_EXTERNA" >> .env
                  - echo "PASSWORD_DEFAULT_POST=$PASSWORD_DEFAULT_EXTERNA" >> .env
                  - echo "DATABASE_DEFAULT_POST=omnilink" >> .env
                  - echo "BUCKET_S3=teste-nodejs-show" >> .env
                  - echo "BUCKET_S3_OMNISAFE=gestoromnisafe" >> .env
                  - echo "BUCKET_S3_ARQUIVOS=files-shownet" >> .env
                  - echo "BUCKET_S3_GRAVACOES_OMNICOM=gravacoes-omnicom" >> .env
                  - echo "ACCESS_KEY_ID_S3=$ACCESS_KEY_ID_S3_PRODUCAO" >> .env
                  - echo "SECRET_ACCESS_KEY_S3=$SECRET_ACCESS_KEY_S3_PRODUCAO" >> .env
                  - echo "BUCKET_S3_SCORE=omniscore" >> .env
                  - echo "ACCESS_KEY_ID_S3_SCORE=$ACCESS_KEY_ID_S3_SCORE" >> .env
                  - echo "SECRET_ACCESS_KEY_S3_SCORE=$SECRET_ACCESS_KEY_S3_SCORE" >> .env
                  - echo "BASE_URL_SHOW=https://gestor.showtecnologia.com/gestor/index.php" >> .env
                  - echo "BASE_URL_OMNILINK=https://gestor.omnilink.com.br/gestor/index.php" >> .env
                  - echo "BASE_URL_CEABS=https://gestor.ceabs.com.br/gestor/index.php" >> .env
                  - echo "BASE_URL_SAVER=10.7.4.11" >> .env
                  - echo "BASE_URL_IASWS=http://10.130.0.132:12100/iasws/iasws.asmx?wsdl" >> .env
                  - echo "TELEMETRY_ACCESS_TOKEN=$TELEMETRY_ACCESS_TOKEN_PRODUCAO" >> .env
                  - echo "TELEMETRY_API_ENDPOINT=http://10.130.0.167:84/api" >> .env
                  - echo "TOKEN_SHOWNET=$TOKEN_SHOWNET_PRODUCAO" >> .env
                  - echo "TOKEN_OMNI_ID=$TOKEN_OMNI_ID" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=$TOKEN_BOT_OMNI_GR" >> .env
                  - echo "TOKEN_MAIL=$TOKEN_MAIL_PRODUCAO" >> .env
                  - echo "TOKEN_POWERBI=$TOKEN_POWERBI_PRODUCAO" >> .env
                  - echo "TOKEN_CRM=$TOKEN_CRM_PRODUCAO" >> .env
                  - echo "TOKEN_CRM_NATIVA=$TOKEN_CRM_NATIVA" >> .env
                  - echo "BASE_URL_CRM_ODATA_API=https://crm.omnilink.com.br/CRM/api/data/v8.2/" >> .env
                  - echo "CRM_NTLM_USER=svc.omni.shownet" >> .env
                  - echo "CRM_NTLM_PASS=Dynamics2@19" >> .env
                  - echo "REGIAO_DYNAMO=us-east-2" >> .env
                  - echo "ENDPOINT_DYNAMO=http://dynamodb.us-east-2.amazonaws.com" >> .env
                  - echo "ACCESS_KEY_ID_DYNAMO=$ACCESS_KEY_ID_DYNAMO_PRODUCAO" >> .env
                  - echo "SECRET_ACCESS_KEY_DYNAMO=$SECRET_ACCESS_KEY_DYNAMO_PRODUCAO" >> .env
                  - echo "SES_USER_AWS=$SES_USER_AWS_PRODUCAO" >> .env
                  - echo "SES_PASS_AWS=$SES_PASS_AWS_PRODUCAO" >> .env
                  - echo "SES_HOST_AWS=email-smtp.us-east-1.amazonaws.com" >> .env
                  - echo "SES_PORT_AWS=587" >> .env
                  - echo "PORT=3333" >> .env
                  - echo "CACHE_HOST=$CACHE_HOST" >> .env
                  - echo "CACHE_PORT=6379" >> .env
                  - echo "REDIS_OMNISCORE_HOST=$REDIS_OMNISCORE_HOST" >> .env
                  - echo "REDIS_OMNISCORE_PORT=$REDIS_OMNISCORE_PORT" >> .env
                  - echo "BASE_URL_LINKER=http://web.omnilink.com.br/api?wsdl" >> .env
                  - echo "USUARIO_API_LINKER=zatix\svc.omni.apilinker" >> .env
                  - echo "SENHA_API_LINKER=P@ssw0rD" >> .env
                  - echo "BASE_URL_ESPELHAMENTO=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_ESPELHAMENTO_VEICULOS=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_CRM=https://app.omnilink.com.br/crmintegration/api" >> .env
                  - echo "TOKEN_INFOBIP=$TOKEN_INFOBIP" >> .env
                  - echo "LIMITE_CONEXOES_USUARIO=60" >> .env
                  - echo "BASE_URL_INFOBIP=yrpgqp.api.infobip.com" >> .env
                  - echo "TIMEOUT_SERVIDOR=60000" >> .env
                  - echo "TOKEN_OMNITAG=$TOKEN_OMNITAG" >> .env
                  - echo "BASE_URL_API_EXATO=https://api.exato.digital/" >> .env
                  - echo "TOKEN_EXATO=$TOKEN_EXATO" >> .env
                  - echo "BASE_URL_API_CREDIFY=https://apibd.credify.com.br/" >> .env
                  - echo "TOKEN_CREDIFY=$TOKEN_CREDIFY" >> .env
                  - echo "BASE_URL_API_QUOD=https://api.empresas.quod.com.br/" >> .env
                  - echo "USER_QUOD=$USER_QUOD" >> .env
                  - echo "PASSWORD_QUOD=$PASSWORD_QUOD" >> .env
                  - echo "BASE_URL_API_PLEXI=https://api.plexi.com.br/" >> .env
                  - echo "TOKEN_PLEXI=$TOKEN_PLEXI" >> .env
                  - echo "BASE_URL_API_INFOSIMPLES=https://api.infosimples.com/" >> .env
                  - echo "TOKEN_INFOSIMPLES=$TOKEN_INFOSIMPLES" >> .env
                  - echo "LOGIN_GOV=$LOGIN_GOV" >> .env
                  - echo "SENHA_GOV=$SENHA_GOV" >> .env
                  - echo "GR_DATABASE=GR" >> .env
                  - echo "BASE_URL_API=apiinterna.showtecnologia.com" >> .env
                  - echo "FOCUS_NFE_BASE_URL_FOCUS=$FOCUS_NFE_BASE_URL" >> .env
                  - echo "FOCUS_NFE_TOKEN=$TOKEN_FOCUS_REVENDA" >> .env
                  - echo "TOKEN_OMNI_ID=$TOKEN_OMNI_ID" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=$TOKEN_BOT_OMNI_GR" >> .env
                  - echo "BASE_URL_WSTT=https://wstt.omnilink.com.br/iasws/iasws.asmx?wsdl" >> .env
                  - echo "REDIS_STACK_HOST=10.7.4.30" >> .env
                  - echo "REDIS_STACK_PORT=6379" >> .env
                  - echo "BASE_URL_INVERTEXTO=https://api.invertexto.com/v1/holidays/" >> .env
                  - echo "TOKEN_INVERTEXTO=2129|7TxItl56NwX6Bg6OwmTeDgPUmOLWeL4w" >> .env
                  - echo "TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID" >> .env
                  - echo "TWILIO_API_KEY=$TWILIO_API_KEY" >> .env
                  - echo "TWILIO_API_SECRET=$TWILIO_API_SECRET" >> .env
                  - echo "TWILIO_OUT_GOING_APP_SID=$TWILIO_OUT_GOING_APP_SID" >> .env
                  - echo "TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN" >> .env
                  - echo "TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO=$TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO" >> .env
                  - echo "TWILIO_TOKEN_WEBHOOK=$TWILIO_TOKEN_WEBHOOK" >> .env
                  - echo "TWILIO_SID_SHOWNET=$TWILIO_SID_SHOWNET" >> .env
                  - echo "TWILIO_TOKEN_SHOWNET=$TWILIO_TOKEN_SHOWNET" >> .env
                  - echo "TOKEN_INTEGRACAO_VIVO_INTELBRAS=c4813fa70ec248b3439b5276d28ec53c" >> .env
                  - echo "URI_SOCKET_VIVO_INTELBRAS=widevoice.intelbras.com.br" >> .env
                  - echo "SENHA_SOCKET_VIVO_INTELBRAS=itb@3131" >> .env
                  - echo "SOCKET_VIVO_INTELBRAS=wss://widevoice.intelbras.com.br:8089/ws" >> .env
                  - echo "BASE_URL_TELEGRAM=https://api.telegram.org/bot" >> .env
                  - echo "TELEGRAM_ACCESS_TOKEN=5877492689:AAF-4CiWiXJglCwPzzBv3FXykRvgPgfgZFk" >> .env
                  - echo "BASE_URL_ZATIX_SOAP=http://zatixtecnologia128050.protheus.cloudtotvs.com.br:4040/ws9901/CUSTOMER.apw" >> .env
                  - echo "LOG_NIVEL=info" >> .env
                  - echo "LOG_DESTINO=" >> .env
                  - echo "LOG_STDOUT=true" >> .env
                  - echo "CMSV6_BASE_URL=https://eqps-omnisafe.omnilink.com.br" >> .env
                  - echo "CMSV6_USUARIO=$CMSV6_USUARIO" >> .env
                  - echo "CMSV6_SENHA=$CMSV6_SENHA" >> .env
                  - echo "BASE_URL_API_INTEGRACOES_OMNIGR=http://10.7.38.162:8080/" >> .env
                  - echo "BASE_URL_API_NODE=https://apiinterna.showtecnologia.com/api/" >> .env
                  - echo "API_ERP_BASE_URL=$API_ERP_BASE_URL" >> .env
                  - echo "API_ERP_TOKEN=$API_ERP_TOKEN" >> .env
                  - echo "FOCUS_NFE_BASE_URL=https://api.focusnfe.com.br/v2" >> .env
                  - echo "FOCUS_NFE_DOWNLOAD_BASE_URL=$FOCUS_NFE_DOWNLOAD_BASE_URL" >> .env
                  - echo "FOCUS_NFE_TOKEN=$FOCUS_NFE_TOKEN" >> .env
                  - echo "BASE_URL_SEM_PARAR=https://app.viafacil.com.br/wsvp/ValePedagio?wsdl" >> .env
                  - echo "BASE_URL_MAPLINK=https://api.maplink.global" >> .env
                  - echo "CLIENT_ID_MAPLINK=$CLIENT_ID_MAPLINK" >> .env
                  - echo "CLIENT_SECRET_MAPLINK=$CLIENT_SECRET_MAPLINK" >> .env
                  - echo "TOKEN_CHATBOT_OMNICOM=a93912d8-acfd-4308-9f05-fcaff6e25d44" >> .env
                  - echo "BRASPAG_HOST=$BRASPAG_HOST" >> .env
                  - echo "BRASPAG_MERCHANT_ID=$BRASPAG_MERCHANT_ID" >> .env
                  - echo "BRASPAG_MERCHANT_KEY=$BRASPAG_MERCHANT_KEY" >> .env
                  - echo "TOKEN_APP_TELEMETRIA=48c3f414cea4d4fd18d1e2f7ed5071b2" >> .env
                  - echo "KEYCRYPTO=$KEYCRYPTO" >> .env
                  - echo "IVCRYPTO=$IVCRYPTO" >> .env
                  - echo "NOMINATIM_SERVER=https://osm-aws.showtecnologia.com/nominatim" >> .env
                  - echo "APICADASTROSMHS=http://apimacro.omnilink.com.br:5002/GruposMacroIdCliente" >> .env
                  - echo "APIEMBARQUEMHS=http://apicomando.omnilink.com.br:5012/" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_HOST=$REDIS_SERVICO_MONITORAMENTO_LOG_HOST" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_PORT=6379" >> .env
                  - echo "TOKEN_STREAMING_SELECIONADOS_SAFE=$TOKEN_STREAMING_SELECIONADOS_SAFE" >> .env
                  - echo "TOKEN_MIDDLEWARE_LAMBDA_SAFE=$TOKEN_MIDDLEWARE_LAMBDA_SAFE" >> .env
                  - echo "LAMBDA_VIDEO_URL=$LAMBDA_VIDEO_URL" >> .env
                  - echo "LAMBDA_VIDEO_TOKEN=$LAMBDA_VIDEO_TOKEN" >> .env
                  - echo "TOKEN_BOT_OMNI_JORNADA=$TOKEN_BOT_OMNI_JORNADA" >> .env
                  - echo "BASE_URL_API_PLACAS=https://wdapi2.com.br/" >> .env
                  - echo "TOKEN_API_PLACAS=$TOKEN_API_PLACAS" >> .env
                  - echo "TIMEOUT_REQUESTS_PLACAS=120000" >> .env
                  - echo "BASE_URL_FINANCIAL_ERP=$BASE_URL_FINANCIAL_ERP" >> .env
                  - echo "USER_FINANCIAL_ERP=$USER_FINANCIAL_ERP" >> .env
                  - echo "PASS_FINANCIAL_ERP=$PASS_FINANCIAL_ERP" >> .env
                  - echo "REDIS_BOT_JORNADA_HOST=$REDIS_BOT_JORNADA_HOST" >> .env
                  - echo "REDIS_BOT_JORNADA_PORT=6379" >> .env
                  - echo "REDIS_LAST_TRACK_HOST=$REDIS_LAST_TRACK_HOST" >> .env
                  - echo "REDIS_LAST_TRACK_PORT=6379" >> .env
                  - echo "TOKEN_SIGAMY=1a49bd7814ae6d4a0096cafd3e2e3206a5ce8325" >> .env
                  - echo "BASE_URL_SHOWNET_PORTAL_COMPRA=$BASE_URL_SHOWNET_PORTAL_COMPRA" >> .env
                  - echo "OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS=$OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS" >> .env
                  - echo "BASE_URL_UPLOADS=$BASE_URL_UPLOADS" >> .env
                  - echo "REDIS_VIDEO_HOST=$REDIS_VIDEO_HOST" >> .env
                  - echo "REDIS_VIDEO_PORT=$REDIS_VIDEO_PORT" >> .env
                  - echo "REDIS_NOTIFICACOES_HOST=$REDIS_NOTIFICACOES_HOST" >> .env
                  - echo "REDIS_NOTIFICACOES_PORT=$REDIS_NOTIFICACOES_PORT" >> .env
                  - echo "STREAMING_SERVER_VIDEO_DNS=$STREAMING_SERVER_VIDEO_DNS" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HOST=$STREAMING_SERVER_VIDEO_HOST" >> .env
                  - echo "STREAMING_SERVER_VIDEO_TCP_PORT=5001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_UDP_PORT=5002" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HLS_PORT=6001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_WEBRTC_PORT=6002" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_TCP_PORT=5003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_UDP_PORT=5004" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_HLS_PORT=6003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_WEBRTC_PORT=6004" >> .env
                  - echo "VIDEO_WS_PORT=16608" >> .env
                  - echo "ID_CONTA_PRINCIPAL_PRODUCAO=1" >> .env
                  - echo "ID_CONTA_PRINCIPAL_HOMOLOGACAO=2121" >> .env
                  - echo "BASE_URL_API_TELEVENDAS=$BASE_URL_API_TELEVENDAS" >> .env
                  - echo "BASE_URL_API_TELEVENDAS_WEBSOCKET=$BASE_URL_API_TELEVENDAS_WEBSOCKET" >> .env
                  - apt-get update
                  - apt-get install -y zip
                  - npm install
                  - npm run build
                  - zip -r externa.zip dist public documentacao .env node_modules package.json .platform gestor-425512-34a83fb0020d.json
                  - echo "Compilação concluída"
              artifacts:
                  - externa.zip

        - step: &buildInterna
              name: Build API Interna
              caches:
                  - node
              script:
                  - echo "Compilando interna"
                  - rm -f .env
                  - touch .env
                  - echo "TIPO_AMBIENTE=INTERNA" >> .env
                  - echo "REMETENTE_MAIL=no-reply@notificacaogestor.com" >> .env
                  - echo "SECRET=$SECRET_PRODUCAO" >> .env
                  - echo "LIMIT_CONNECTION=100" >> .env
                  - echo "HOST_DEFAULT=gestor.cqz90u2tvymu.us-east-2.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT=3306" >> .env
                  - echo "USER_DEFAULT=$USER_DEFAULT_PRODUCAO" >> .env
                  - echo "PASSWORD_DEFAULT=$PASSWORD_DEFAULT_PRODUCAO" >> .env
                  - echo "DATABASE_DEFAULT=showtecsystem" >> .env
                  - echo "LIMIT_CONNECTION_RASTREAMENTO=100" >> .env
                  - echo "HOST_DEFAULT_RASTREAMENTO=10.7.14.187" >> .env
                  - echo "PORT_DEFAULT_RASTREAMENTO=3306" >> .env
                  - echo "USER_DEFAULT_RASTREAMENTO=$USER_DEFAULT_RASTREAMENTO_PRODUCAO" >> .env
                  - echo "PASSWORD_DEFAULT_RASTREAMENTO=$PASSWORD_DEFAULT_RASTREAMENTO_PRODUCAO" >> .env
                  - echo "DATABASE_DEFAULT_RASTREAMENTO=rastreamento" >> .env
                  - echo "HOST_DEFAULT_POST=omnilink-post2.cluster-cqz90u2tvymu.us-east-2.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT_POST=3306" >> .env
                  - echo "USER_DEFAULT_POST=$USER_DEFAULT_PRODUCAO" >> .env
                  - echo "PASSWORD_DEFAULT_POST=$PASSWORD_DEFAULT_PRODUCAO" >> .env
                  - echo "DATABASE_DEFAULT_POST=omnilink" >> .env
                  - echo "BUCKET_S3=teste-nodejs-show" >> .env
                  - echo "BUCKET_S3_OMNISAFE=gestoromnisafe" >> .env
                  - echo "BUCKET_S3_ARQUIVOS=files-shownet" >> .env
                  - echo "BUCKET_S3_GRAVACOES_OMNICOM=gravacoes-omnicom" >> .env
                  - echo "ACCESS_KEY_ID_S3=$ACCESS_KEY_ID_S3_PRODUCAO" >> .env
                  - echo "SECRET_ACCESS_KEY_S3=$SECRET_ACCESS_KEY_S3_PRODUCAO" >> .env
                  - echo "BUCKET_S3_SCORE=omniscore" >> .env
                  - echo "ACCESS_KEY_ID_S3_SCORE=$ACCESS_KEY_ID_S3_SCORE" >> .env
                  - echo "SECRET_ACCESS_KEY_S3_SCORE=$SECRET_ACCESS_KEY_S3_SCORE" >> .env
                  - echo "BASE_URL_SHOW=https://gestor.showtecnologia.com/gestor/index.php" >> .env
                  - echo "BASE_URL_OMNILINK=https://gestor.omnilink.com.br/gestor/index.php" >> .env
                  - echo "BASE_URL_CEABS=https://gestor.ceabs.com.br/gestor/index.php" >> .env
                  - echo "BASE_URL_SAVER=10.7.4.11" >> .env
                  - echo "BASE_URL_IASWS=http://10.130.0.132:12100/iasws/iasws.asmx?wsdl" >> .env
                  - echo "TELEMETRY_ACCESS_TOKEN=$TELEMETRY_ACCESS_TOKEN_PRODUCAO" >> .env
                  - echo "TELEMETRY_API_ENDPOINT=http://10.130.0.167:84/api" >> .env
                  - echo "TOKEN_SHOWNET=$TOKEN_SHOWNET_PRODUCAO" >> .env
                  - echo "TOKEN_OMNI_ID=$TOKEN_OMNI_ID" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=$TOKEN_BOT_OMNI_GR" >> .env
                  - echo "TOKEN_MAIL=$TOKEN_MAIL_PRODUCAO" >> .env
                  - echo "TOKEN_POWERBI=$TOKEN_POWERBI_PRODUCAO" >> .env
                  - echo "TOKEN_CRM=$TOKEN_CRM_PRODUCAO" >> .env
                  - echo "TOKEN_CRM_NATIVA=$TOKEN_CRM_NATIVA" >> .env
                  - echo "BASE_URL_CRM_ODATA_API=https://crm.omnilink.com.br/CRM/api/data/v8.2/" >> .env
                  - echo "CRM_NTLM_USER=svc.omni.shownet" >> .env
                  - echo "CRM_NTLM_PASS=Dynamics2@19" >> .env
                  - echo "REGIAO_DYNAMO=us-east-2" >> .env
                  - echo "ENDPOINT_DYNAMO=http://dynamodb.us-east-2.amazonaws.com" >> .env
                  - echo "ACCESS_KEY_ID_DYNAMO=$ACCESS_KEY_ID_DYNAMO_PRODUCAO" >> .env
                  - echo "SECRET_ACCESS_KEY_DYNAMO=$SECRET_ACCESS_KEY_DYNAMO_PRODUCAO" >> .env
                  - echo "SES_USER_AWS=$SES_USER_AWS_PRODUCAO" >> .env
                  - echo "SES_PASS_AWS=$SES_PASS_AWS_PRODUCAO" >> .env
                  - echo "SES_HOST_AWS=email-smtp.us-east-1.amazonaws.com" >> .env
                  - echo "SES_PORT_AWS=587" >> .env
                  - echo "PORT=3333" >> .env
                  - echo "CACHE_HOST=$CACHE_HOST" >> .env
                  - echo "CACHE_PORT=6379" >> .env
                  - echo "REDIS_OMNISCORE_HOST=$REDIS_OMNISCORE_HOST" >> .env
                  - echo "REDIS_OMNISCORE_PORT=$REDIS_OMNISCORE_PORT" >> .env
                  - echo "BASE_URL_LINKER=http://web.omnilink.com.br/api?wsdl" >> .env
                  - echo "USUARIO_API_LINKER=zatix\svc.omni.apilinker" >> .env
                  - echo "SENHA_API_LINKER=P@ssw0rD" >> .env
                  - echo "BASE_URL_ESPELHAMENTO=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_ESPELHAMENTO_VEICULOS=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_CRM=https://app.omnilink.com.br/crmintegration/api" >> .env
                  - echo "TOKEN_INFOBIP=$TOKEN_INFOBIP" >> .env
                  - echo "LIMITE_CONEXOES_USUARIO=60" >> .env
                  - echo "BASE_URL_INFOBIP=yrpgqp.api.infobip.com" >> .env
                  - echo "TIMEOUT_SERVIDOR=60000" >> .env
                  - echo "TOKEN_OMNITAG=$TOKEN_OMNITAG" >> .env
                  - echo "BASE_URL_API_EXATO=https://api.exato.digital/" >> .env
                  - echo "TOKEN_EXATO=$TOKEN_EXATO" >> .env
                  - echo "BASE_URL_API_CREDIFY=https://apibd.credify.com.br/" >> .env
                  - echo "TOKEN_CREDIFY=$TOKEN_CREDIFY" >> .env
                  - echo "BASE_URL_API_QUOD=https://api.empresas.quod.com.br/" >> .env
                  - echo "USER_QUOD=$USER_QUOD" >> .env
                  - echo "PASSWORD_QUOD=$PASSWORD_QUOD" >> .env
                  - echo "BASE_URL_API_PLEXI=https://api.plexi.com.br/" >> .env
                  - echo "TOKEN_PLEXI=$TOKEN_PLEXI" >> .env
                  - echo "BASE_URL_API_INFOSIMPLES=https://api.infosimples.com/" >> .env
                  - echo "TOKEN_INFOSIMPLES=$TOKEN_INFOSIMPLES" >> .env
                  - echo "LOGIN_GOV=$LOGIN_GOV" >> .env
                  - echo "SENHA_GOV=$SENHA_GOV" >> .env
                  - echo "GR_DATABASE=GR" >> .env
                  - echo "BASE_URL_API=apiinterna.showtecnologia.com" >> .env
                  - echo "FOCUS_NFE_BASE_URL_FOCUS=$FOCUS_NFE_BASE_URL" >> .env
                  - echo "FOCUS_NFE_TOKEN=$TOKEN_FOCUS_REVENDA" >> .env
                  - echo "TOKEN_OMNI_ID=$TOKEN_OMNI_ID" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=$TOKEN_BOT_OMNI_GR" >> .env
                  - echo "BASE_URL_WSTT=https://wstt.omnilink.com.br/iasws/iasws.asmx?wsdl" >> .env
                  - echo "REDIS_STACK_HOST=10.7.4.30" >> .env
                  - echo "REDIS_STACK_PORT=6379" >> .env
                  - echo "BASE_URL_INVERTEXTO=https://api.invertexto.com/v1/holidays/" >> .env
                  - echo "TOKEN_INVERTEXTO=2129|7TxItl56NwX6Bg6OwmTeDgPUmOLWeL4w" >> .env
                  - echo "TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID" >> .env
                  - echo "TWILIO_API_KEY=$TWILIO_API_KEY" >> .env
                  - echo "TWILIO_API_SECRET=$TWILIO_API_SECRET" >> .env
                  - echo "TWILIO_OUT_GOING_APP_SID=$TWILIO_OUT_GOING_APP_SID" >> .env
                  - echo "TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN" >> .env
                  - echo "TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO=$TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO" >> .env
                  - echo "TWILIO_TOKEN_WEBHOOK=$TWILIO_TOKEN_WEBHOOK" >> .env
                  - echo "TWILIO_SID_SHOWNET=$TWILIO_SID_SHOWNET" >> .env
                  - echo "TWILIO_TOKEN_SHOWNET=$TWILIO_TOKEN_SHOWNET" >> .env
                  - echo "TOKEN_INTEGRACAO_VIVO_INTELBRAS=c4813fa70ec248b3439b5276d28ec53c" >> .env
                  - echo "URI_SOCKET_VIVO_INTELBRAS=widevoice.intelbras.com.br" >> .env
                  - echo "SENHA_SOCKET_VIVO_INTELBRAS=itb@3131" >> .env
                  - echo "SOCKET_VIVO_INTELBRAS=wss://widevoice.intelbras.com.br:8089/ws" >> .env
                  - echo "BASE_URL_TELEGRAM=https://api.telegram.org/bot" >> .env
                  - echo "TELEGRAM_ACCESS_TOKEN=5877492689:AAF-4CiWiXJglCwPzzBv3FXykRvgPgfgZFk" >> .env
                  - echo "BASE_URL_ZATIX_SOAP=http://zatixtecnologia128050.protheus.cloudtotvs.com.br:4040/ws9901/CUSTOMER.apw" >> .env
                  - echo "LOG_NIVEL=info" >> .env
                  - echo "LOG_DESTINO=" >> .env
                  - echo "LOG_STDOUT=true" >> .env
                  - echo "CMSV6_BASE_URL=https://eqps-omnisafe.omnilink.com.br" >> .env
                  - echo "CMSV6_USUARIO=$CMSV6_USUARIO" >> .env
                  - echo "CMSV6_SENHA=$CMSV6_SENHA" >> .env
                  - echo "BASE_URL_API_INTEGRACOES_OMNIGR=http://10.7.38.162:8080/" >> .env
                  - echo "BASE_URL_API_NODE=https://apiinterna.showtecnologia.com/api/" >> .env
                  - echo "API_ERP_BASE_URL=$API_ERP_BASE_URL" >> .env
                  - echo "API_ERP_TOKEN=$API_ERP_TOKEN" >> .env
                  - echo "FOCUS_NFE_BASE_URL=https://api.focusnfe.com.br/v2" >> .env
                  - echo "FOCUS_NFE_DOWNLOAD_BASE_URL=$FOCUS_NFE_DOWNLOAD_BASE_URL" >> .env
                  - echo "FOCUS_NFE_TOKEN=$FOCUS_NFE_TOKEN" >> .env
                  - echo "BASE_URL_SEM_PARAR=https://app.viafacil.com.br/wsvp/ValePedagio?wsdl" >> .env
                  - echo "BASE_URL_MAPLINK=https://api.maplink.global" >> .env
                  - echo "CLIENT_ID_MAPLINK=$CLIENT_ID_MAPLINK" >> .env
                  - echo "CLIENT_SECRET_MAPLINK=$CLIENT_SECRET_MAPLINK" >> .env
                  - echo "TOKEN_CHATBOT_OMNICOM=a93912d8-acfd-4308-9f05-fcaff6e25d44" >> .env
                  - echo "BRASPAG_HOST=$BRASPAG_HOST" >> .env
                  - echo "BRASPAG_MERCHANT_ID=$BRASPAG_MERCHANT_ID" >> .env
                  - echo "BRASPAG_MERCHANT_KEY=$BRASPAG_MERCHANT_KEY" >> .env
                  - echo "TOKEN_APP_TELEMETRIA=48c3f414cea4d4fd18d1e2f7ed5071b2" >> .env
                  - echo "KEYCRYPTO=$KEYCRYPTO" >> .env
                  - echo "IVCRYPTO=$IVCRYPTO" >> .env
                  - echo "NOMINATIM_SERVER=https://osm-aws.showtecnologia.com/nominatim" >> .env
                  - echo "APICADASTROSMHS=http://apimacro.omnilink.com.br:5002/GruposMacroIdCliente" >> .env
                  - echo "APIEMBARQUEMHS=http://apicomando.omnilink.com.br:5012/" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_HOST=$REDIS_SERVICO_MONITORAMENTO_LOG_HOST" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_PORT=6379" >> .env
                  - echo "TOKEN_STREAMING_SELECIONADOS_SAFE=$TOKEN_STREAMING_SELECIONADOS_SAFE" >> .env
                  - echo "TOKEN_MIDDLEWARE_LAMBDA_SAFE=$TOKEN_MIDDLEWARE_LAMBDA_SAFE" >> .env
                  - echo "LAMBDA_VIDEO_URL=$LAMBDA_VIDEO_URL" >> .env
                  - echo "LAMBDA_VIDEO_TOKEN=$LAMBDA_VIDEO_TOKEN" >> .env
                  - echo "TOKEN_BOT_OMNI_JORNADA=$TOKEN_BOT_OMNI_JORNADA" >> .env
                  - echo "BASE_URL_API_PLACAS=https://wdapi2.com.br/" >> .env
                  - echo "TOKEN_API_PLACAS=$TOKEN_API_PLACAS" >> .env
                  - echo "TIMEOUT_REQUESTS_PLACAS=120000" >> .env
                  - echo "BASE_URL_FINANCIAL_ERP=$BASE_URL_FINANCIAL_ERP" >> .env
                  - echo "USER_FINANCIAL_ERP=$USER_FINANCIAL_ERP" >> .env
                  - echo "PASS_FINANCIAL_ERP=$PASS_FINANCIAL_ERP" >> .env
                  - echo "REDIS_BOT_JORNADA_HOST=$REDIS_BOT_JORNADA_HOST" >> .env
                  - echo "REDIS_BOT_JORNADA_PORT=$REDIS_BOT_JORNADA_PORT" >> .env
                  - echo "REDIS_LAST_TRACK_HOST=$REDIS_LAST_TRACK_HOST" >> .env
                  - echo "REDIS_LAST_TRACK_PORT=$REDIS_LAST_TRACK_PORT" >> .env
                  - echo "TOKEN_SIGAMY=1a49bd7814ae6d4a0096cafd3e2e3206a5ce8325" >> .env
                  - echo "BASE_URL_SHOWNET_PORTAL_COMPRA=$BASE_URL_SHOWNET_PORTAL_COMPRA" >> .env
                  - echo "OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS=$OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS" >> .env
                  - echo "BASE_URL_UPLOADS=$BASE_URL_UPLOADS" >> .env
                  - echo "REDIS_VIDEO_HOST=$REDIS_VIDEO_HOST" >> .env
                  - echo "REDIS_VIDEO_PORT=$REDIS_VIDEO_PORT" >> .env
                  - echo "REDIS_NOTIFICACOES_HOST=$REDIS_NOTIFICACOES_HOST" >> .env
                  - echo "REDIS_NOTIFICACOES_PORT=$REDIS_NOTIFICACOES_PORT" >> .env
                  - echo "STREAMING_SERVER_VIDEO_DNS=$STREAMING_SERVER_VIDEO_DNS" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HOST=$STREAMING_SERVER_VIDEO_HOST" >> .env
                  - echo "STREAMING_SERVER_VIDEO_TCP_PORT=5001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_UDP_PORT=5002" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HLS_PORT=6001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_WEBRTC_PORT=6002" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_TCP_PORT=5003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_UDP_PORT=5004" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_HLS_PORT=6003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_WEBRTC_PORT=6004" >> .env
                  - echo "VIDEO_WS_PORT=16608" >> .env
                  - echo "ID_CONTA_PRINCIPAL_PRODUCAO=1" >> .env
                  - echo "ID_CONTA_PRINCIPAL_HOMOLOGACAO=2121" >> .env
                  - echo "BASE_URL_API_TELEVENDAS=$BASE_URL_API_TELEVENDAS" >> .env
                  - echo "BASE_URL_API_TELEVENDAS_WEBSOCKET=$BASE_URL_API_TELEVENDAS_WEBSOCKET" >> .env
                  - apt-get update
                  - apt-get install -y zip
                  - npm install
                  - npm run build
                  - zip -r interna.zip dist public documentacao .env node_modules package.json .platform gestor-425512-34a83fb0020d.json
                  - echo "Compilação concluída"
              artifacts:
                  - interna.zip

        - step: &buildCron
              name: Build Worker Relatorios
              caches:
                  - node
              script:
                  - echo "Compilando interna"
                  - rm -f .env
                  - touch .env
                  - echo "TIPO_AMBIENTE=CRON" >> .env
                  - echo "REMETENTE_MAIL=no-reply@notificacaogestor.com" >> .env
                  - echo "SECRET=$SECRET_PRODUCAO" >> .env
                  - echo "LIMIT_CONNECTION=100" >> .env
                  - echo "HOST_DEFAULT=gestor.cqz90u2tvymu.us-east-2.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT=3306" >> .env
                  - echo "USER_DEFAULT=$USER_DEFAULT_PRODUCAO_CRON" >> .env
                  - echo "PASSWORD_DEFAULT=$PASSWORD_DEFAULT_PRODUCAO_CRON" >> .env
                  - echo "DATABASE_DEFAULT=showtecsystem" >> .env
                  - echo "LIMIT_CONNECTION_RASTREAMENTO=100" >> .env
                  - echo "HOST_DEFAULT_RASTREAMENTO=10.7.14.187" >> .env
                  - echo "PORT_DEFAULT_RASTREAMENTO=3306" >> .env
                  - echo "USER_DEFAULT_RASTREAMENTO=$USER_DEFAULT_RASTREAMENTO_PRODUCAO_CRON" >> .env
                  - echo "PASSWORD_DEFAULT_RASTREAMENTO=$PASSWORD_DEFAULT_RASTREAMENTO_PRODUCAO_CRON" >> .env
                  - echo "DATABASE_DEFAULT_RASTREAMENTO=rastreamento" >> .env
                  - echo "HOST_DEFAULT_POST=omnilink-post2.cluster-cqz90u2tvymu.us-east-2.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT_POST=3306" >> .env
                  - echo "USER_DEFAULT_POST=$USER_DEFAULT_PRODUCAO" >> .env
                  - echo "PASSWORD_DEFAULT_POST=$PASSWORD_DEFAULT_PRODUCAO" >> .env
                  - echo "DATABASE_DEFAULT_POST=omnilink" >> .env
                  - echo "BUCKET_S3=teste-nodejs-show" >> .env
                  - echo "BUCKET_S3_OMNISAFE=gestoromnisafe" >> .env
                  - echo "BUCKET_S3_ARQUIVOS=files-shownet" >> .env
                  - echo "BUCKET_S3_GRAVACOES_OMNICOM=gravacoes-omnicom" >> .env
                  - echo "ACCESS_KEY_ID_S3=$ACCESS_KEY_ID_S3_PRODUCAO" >> .env
                  - echo "SECRET_ACCESS_KEY_S3=$SECRET_ACCESS_KEY_S3_PRODUCAO" >> .env
                  - echo "BUCKET_S3_SCORE=omniscore" >> .env
                  - echo "ACCESS_KEY_ID_S3_SCORE=$ACCESS_KEY_ID_S3_SCORE" >> .env
                  - echo "SECRET_ACCESS_KEY_S3_SCORE=$SECRET_ACCESS_KEY_S3_SCORE" >> .env
                  - echo "BASE_URL_SHOW=https://gestor.showtecnologia.com/gestor/index.php" >> .env
                  - echo "BASE_URL_OMNILINK=https://gestor.omnilink.com.br/gestor/index.php" >> .env
                  - echo "BASE_URL_CEABS=https://gestor.ceabs.com.br/gestor/index.php" >> .env
                  - echo "BASE_URL_SAVER=10.7.4.11" >> .env
                  - echo "BASE_URL_IASWS=http://10.130.0.132:12100/iasws/iasws.asmx?wsdl" >> .env
                  - echo "TELEMETRY_ACCESS_TOKEN=$TELEMETRY_ACCESS_TOKEN_PRODUCAO" >> .env
                  - echo "TELEMETRY_API_ENDPOINT=http://10.130.0.167:84/api" >> .env
                  - echo "TOKEN_SHOWNET=$TOKEN_SHOWNET_PRODUCAO" >> .env
                  - echo "TOKEN_OMNI_ID=$TOKEN_OMNI_ID" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=$TOKEN_BOT_OMNI_GR" >> .env
                  - echo "TOKEN_MAIL=$TOKEN_MAIL_PRODUCAO" >> .env
                  - echo "TOKEN_POWERBI=$TOKEN_POWERBI_PRODUCAO" >> .env
                  - echo "TOKEN_CRM=$TOKEN_CRM_PRODUCAO" >> .env
                  - echo "TOKEN_CRM_NATIVA=$TOKEN_CRM_NATIVA" >> .env
                  - echo "BASE_URL_CRM_ODATA_API=https://crm.omnilink.com.br/CRM/api/data/v8.2/" >> .env
                  - echo "CRM_NTLM_USER=svc.omni.shownet" >> .env
                  - echo "CRM_NTLM_PASS=Dynamics2@19" >> .env
                  - echo "REGIAO_DYNAMO=us-east-2" >> .env
                  - echo "ENDPOINT_DYNAMO=http://dynamodb.us-east-2.amazonaws.com" >> .env
                  - echo "ACCESS_KEY_ID_DYNAMO=$ACCESS_KEY_ID_DYNAMO_PRODUCAO" >> .env
                  - echo "SECRET_ACCESS_KEY_DYNAMO=$SECRET_ACCESS_KEY_DYNAMO_PRODUCAO" >> .env
                  - echo "SES_USER_AWS=$SES_USER_AWS_PRODUCAO" >> .env
                  - echo "SES_PASS_AWS=$SES_PASS_AWS_PRODUCAO" >> .env
                  - echo "SES_HOST_AWS=email-smtp.us-east-1.amazonaws.com" >> .env
                  - echo "SES_PORT_AWS=587" >> .env
                  - echo "PORT=3333" >> .env
                  - echo "CACHE_HOST=$CACHE_HOST" >> .env
                  - echo "CACHE_PORT=6379" >> .env
                  - echo "REDIS_OMNISCORE_HOST=$REDIS_OMNISCORE_HOST" >> .env
                  - echo "REDIS_OMNISCORE_PORT=$REDIS_OMNISCORE_PORT" >> .env
                  - echo "BASE_URL_LINKER=http://web.omnilink.com.br/api?wsdl" >> .env
                  - echo "USUARIO_API_LINKER=zatix\svc.omni.apilinker" >> .env
                  - echo "SENHA_API_LINKER=P@ssw0rD" >> .env
                  - echo "BASE_URL_ESPELHAMENTO=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_ESPELHAMENTO_VEICULOS=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_CRM=https://app.omnilink.com.br/crmintegration/api" >> .env
                  - echo "TOKEN_INFOBIP=$TOKEN_INFOBIP" >> .env
                  - echo "LIMITE_CONEXOES_USUARIO=60" >> .env
                  - echo "BASE_URL_INFOBIP=yrpgqp.api.infobip.com" >> .env
                  - echo "TIMEOUT_SERVIDOR=60000" >> .env
                  - echo "TOKEN_OMNITAG=$TOKEN_OMNITAG" >> .env
                  - echo "BASE_URL_API_EXATO=https://api.exato.digital/" >> .env
                  - echo "TOKEN_EXATO=$TOKEN_EXATO" >> .env
                  - echo "BASE_URL_API_CREDIFY=https://apibd.credify.com.br/" >> .env
                  - echo "TOKEN_CREDIFY=$TOKEN_CREDIFY" >> .env
                  - echo "BASE_URL_API_QUOD=https://api.empresas.quod.com.br/" >> .env
                  - echo "USER_QUOD=$USER_QUOD" >> .env
                  - echo "PASSWORD_QUOD=$PASSWORD_QUOD" >> .env
                  - echo "BASE_URL_API_PLEXI=https://api.plexi.com.br/" >> .env
                  - echo "TOKEN_PLEXI=$TOKEN_PLEXI" >> .env
                  - echo "BASE_URL_API_INFOSIMPLES=https://api.infosimples.com/" >> .env
                  - echo "TOKEN_INFOSIMPLES=$TOKEN_INFOSIMPLES" >> .env
                  - echo "LOGIN_GOV=$LOGIN_GOV" >> .env
                  - echo "SENHA_GOV=$SENHA_GOV" >> .env
                  - echo "GR_DATABASE=GR" >> .env
                  - echo "BASE_URL_API=apiinterna.showtecnologia.com" >> .env
                  - echo "API_ERP_BASE_URL=$API_ERP_BASE_URL" >> .env
                  - echo "API_ERP_TOKEN=$API_ERP_TOKEN" >> .env
                  - echo "FOCUS_NFE_BASE_URL_FOCUS=$FOCUS_NFE_BASE_URL" >> .env
                  - echo "FOCUS_NFE_TOKEN=$TOKEN_FOCUS_REVENDA" >> .env
                  - echo "TOKEN_OMNI_ID=$TOKEN_OMNI_ID" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=$TOKEN_BOT_OMNI_GR" >> .env
                  - echo "BASE_URL_WSTT=https://wstt.omnilink.com.br/iasws/iasws.asmx?wsdl" >> .env
                  - echo "REDIS_STACK_HOST=10.7.4.30" >> .env
                  - echo "REDIS_STACK_PORT=6379" >> .env
                  - echo "BASE_URL_INVERTEXTO=https://api.invertexto.com/v1/holidays/" >> .env
                  - echo "TOKEN_INVERTEXTO=2129|7TxItl56NwX6Bg6OwmTeDgPUmOLWeL4w" >> .env
                  - echo "TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID" >> .env
                  - echo "TWILIO_API_KEY=$TWILIO_API_KEY" >> .env
                  - echo "TWILIO_API_SECRET=$TWILIO_API_SECRET" >> .env
                  - echo "TWILIO_OUT_GOING_APP_SID=$TWILIO_OUT_GOING_APP_SID" >> .env
                  - echo "TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN" >> .env
                  - echo "TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO=$TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO" >> .env
                  - echo "TWILIO_TOKEN_WEBHOOK=$TWILIO_TOKEN_WEBHOOK" >> .env
                  - echo "TWILIO_SID_SHOWNET=$TWILIO_SID_SHOWNET" >> .env
                  - echo "TWILIO_TOKEN_SHOWNET=$TWILIO_TOKEN_SHOWNET" >> .env
                  - echo "TOKEN_INTEGRACAO_VIVO_INTELBRAS=c4813fa70ec248b3439b5276d28ec53c" >> .env
                  - echo "URI_SOCKET_VIVO_INTELBRAS=widevoice.intelbras.com.br" >> .env
                  - echo "SENHA_SOCKET_VIVO_INTELBRAS=itb@3131" >> .env
                  - echo "SOCKET_VIVO_INTELBRAS=wss://widevoice.intelbras.com.br:8089/ws" >> .env
                  - echo "BASE_URL_TELEGRAM=https://api.telegram.org/bot" >> .env
                  - echo "TELEGRAM_ACCESS_TOKEN=5877492689:AAF-4CiWiXJglCwPzzBv3FXykRvgPgfgZFk" >> .env
                  - echo "BASE_URL_ZATIX_SOAP=http://zatixtecnologia128050.protheus.cloudtotvs.com.br:4040/ws9901/CUSTOMER.apw" >> .env
                  - echo "LOG_NIVEL=info" >> .env
                  - echo "LOG_DESTINO=" >> .env
                  - echo "LOG_STDOUT=true" >> .env
                  - echo "CMSV6_BASE_URL=https://eqps-omnisafe.omnilink.com.br" >> .env
                  - echo "CMSV6_USUARIO=$CMSV6_USUARIO" >> .env
                  - echo "CMSV6_SENHA=$CMSV6_SENHA" >> .env
                  - echo "BASE_URL_API_INTEGRACOES_OMNIGR=http://10.7.38.162:8080/" >> .env
                  - echo "BASE_URL_API_NODE=https://apiinterna.showtecnologia.com/api/" >> .env
                  - echo "API_ERP_BASE_URL=$API_ERP_BASE_URL" >> .env
                  - echo "API_ERP_TOKEN=$API_ERP_TOKEN" >> .env
                  - echo "FOCUS_NFE_BASE_URL=https://api.focusnfe.com.br/v2" >> .env
                  - echo "FOCUS_NFE_DOWNLOAD_BASE_URL=$FOCUS_NFE_DOWNLOAD_BASE_URL" >> .env
                  - echo "FOCUS_NFE_TOKEN=$FOCUS_NFE_TOKEN" >> .env
                  - echo "BASE_URL_SEM_PARAR=https://app.viafacil.com.br/wsvp/ValePedagio?wsdl" >> .env
                  - echo "BASE_URL_MAPLINK=https://api.maplink.global" >> .env
                  - echo "CLIENT_ID_MAPLINK=$CLIENT_ID_MAPLINK" >> .env
                  - echo "CLIENT_SECRET_MAPLINK=$CLIENT_SECRET_MAPLINK" >> .env
                  - echo "TOKEN_CHATBOT_OMNICOM=a93912d8-acfd-4308-9f05-fcaff6e25d44" >> .env
                  - echo "BRASPAG_HOST=$BRASPAG_HOST" >> .env
                  - echo "BRASPAG_MERCHANT_ID=$BRASPAG_MERCHANT_ID" >> .env
                  - echo "BRASPAG_MERCHANT_KEY=$BRASPAG_MERCHANT_KEY" >> .env
                  - echo "TOKEN_APP_TELEMETRIA=48c3f414cea4d4fd18d1e2f7ed5071b2" >> .env
                  - echo "KEYCRYPTO=$KEYCRYPTO" >> .env
                  - echo "IVCRYPTO=$IVCRYPTO" >> .env
                  - echo "NOMINATIM_SERVER=https://osm-aws.showtecnologia.com/nominatim" >> .env
                  - echo "APICADASTROSMHS=http://apimacro.omnilink.com.br:5002/GruposMacroIdCliente" >> .env
                  - echo "APIEMBARQUEMHS=http://apicomando.omnilink.com.br:5012/" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_HOST=$REDIS_SERVICO_MONITORAMENTO_LOG_HOST" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_PORT=6379" >> .env
                  - echo "TOKEN_STREAMING_SELECIONADOS_SAFE=$TOKEN_STREAMING_SELECIONADOS_SAFE" >> .env
                  - echo "TOKEN_MIDDLEWARE_LAMBDA_SAFE=$TOKEN_MIDDLEWARE_LAMBDA_SAFE" >> .env
                  - echo "LAMBDA_VIDEO_URL=$LAMBDA_VIDEO_URL" >> .env
                  - echo "LAMBDA_VIDEO_TOKEN=$LAMBDA_VIDEO_TOKEN" >> .env
                  - echo "TOKEN_BOT_OMNI_JORNADA=$TOKEN_BOT_OMNI_JORNADA" >> .env
                  - echo "BASE_URL_API_PLACAS=https://wdapi2.com.br/" >> .env
                  - echo "TOKEN_API_PLACAS=$TOKEN_API_PLACAS" >> .env
                  - echo "TIMEOUT_REQUESTS_PLACAS=120000" >> .env
                  - echo "BASE_URL_FINANCIAL_ERP=$BASE_URL_FINANCIAL_ERP" >> .env
                  - echo "USER_FINANCIAL_ERP=$USER_FINANCIAL_ERP" >> .env
                  - echo "PASS_FINANCIAL_ERP=$PASS_FINANCIAL_ERP" >> .env
                  - echo "REDIS_BOT_JORNADA_HOST=$REDIS_BOT_JORNADA_HOST" >> .env
                  - echo "REDIS_BOT_JORNADA_PORT=$REDIS_BOT_JORNADA_PORT" >> .env
                  - echo "REDIS_LAST_TRACK_HOST=$REDIS_LAST_TRACK_HOST" >> .env
                  - echo "REDIS_LAST_TRACK_PORT=$REDIS_LAST_TRACK_PORT" >> .env
                  - echo "TOKEN_SIGAMY=1a49bd7814ae6d4a0096cafd3e2e3206a5ce8325" >> .env
                  - echo "BASE_URL_SHOWNET_PORTAL_COMPRA=$BASE_URL_SHOWNET_PORTAL_COMPRA" >> .env
                  - echo "OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS=$OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS" >> .env
                  - echo "BASE_URL_UPLOADS=$BASE_URL_UPLOADS" >> .env
                  - echo "REDIS_VIDEO_HOST=$REDIS_VIDEO_HOST" >> .env
                  - echo "REDIS_VIDEO_PORT=$REDIS_VIDEO_PORT" >> .env
                  - echo "REDIS_NOTIFICACOES_HOST=$REDIS_NOTIFICACOES_HOST" >> .env
                  - echo "REDIS_NOTIFICACOES_PORT=$REDIS_NOTIFICACOES_PORT" >> .env
                  - echo "STREAMING_SERVER_VIDEO_DNS=$STREAMING_SERVER_VIDEO_DNS" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HOST=$STREAMING_SERVER_VIDEO_HOST" >> .env
                  - echo "STREAMING_SERVER_VIDEO_TCP_PORT=5001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_UDP_PORT=5002" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HLS_PORT=6001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_WEBRTC_PORT=6002" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_TCP_PORT=5003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_UDP_PORT=5004" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_HLS_PORT=6003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_WEBRTC_PORT=6004" >> .env
                  - echo "VIDEO_WS_PORT=16608" >> .env
                  - echo "ID_CONTA_PRINCIPAL_PRODUCAO=1" >> .env
                  - echo "ID_CONTA_PRINCIPAL_HOMOLOGACAO=2121" >> .env
                  - echo "BASE_URL_API_TELEVENDAS=$BASE_URL_API_TELEVENDAS" >> .env
                  - echo "BASE_URL_API_TELEVENDAS_WEBSOCKET=$BASE_URL_API_TELEVENDAS_WEBSOCKET" >> .env
                  - apt-get update
                  - apt-get install -y zip
                  - npm install
                  - npm run build
                  - zip -r cron.zip dist public documentacao .env node_modules package.json .platform gestor-425512-34a83fb0020d.json
                  - echo "Compilação concluída"
              artifacts:
                  - cron.zip

        - step: &buildChina
              name: Build Api China
              caches:
                  - node
              script:
                  - echo "Compilando Api China"
                  - rm -f .env
                  - touch .env
                  - echo "TIPO_AMBIENTE=INTERNA" >> .env
                  - echo "REMETENTE_MAIL=no-reply@notificacaogestor.com" >> .env
                  - echo "SECRET=$SECRET_PRODUCAO" >> .env
                  - echo "LIMIT_CONNECTION=100" >> .env
                  - echo "HOST_DEFAULT=cadastro-chn-prod.cfe4awgkanmk.ap-east-1.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT=3306" >> .env
                  - echo "USER_DEFAULT=$USER_DEFAULT_PRODUCAO_CHINA" >> .env
                  - echo "PASSWORD_DEFAULT=$PASSWORD_DEFAULT_PRODUCAO_CHINA" >> .env
                  - echo "DATABASE_DEFAULT=showtecsystem" >> .env
                  - echo "LIMIT_CONNECTION_RASTREAMENTO=100" >> .env
                  - echo "HOST_DEFAULT_RASTREAMENTO=rastreamento-chn-prod.cfe4awgkanmk.ap-east-1.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT_RASTREAMENTO=3306" >> .env
                  - echo "USER_DEFAULT_RASTREAMENTO=$USER_DEFAULT_RASTREAMENTO_PRODUCAO_CHINA" >> .env
                  - echo "PASSWORD_DEFAULT_RASTREAMENTO=$PASSWORD_DEFAULT_RASTREAMENTO_PRODUCAO_CHINA" >> .env
                  - echo "DATABASE_DEFAULT_RASTREAMENTO=rastreamento" >> .env
                  - echo "HOST_DEFAULT_POST=omnilink-post2.cluster-cqz90u2tvymu.us-east-2.rds.amazonaws.com" >> .env
                  - echo "PORT_DEFAULT_POST=3306" >> .env
                  - echo "USER_DEFAULT_POST=$USER_DEFAULT_PRODUCAO" >> .env
                  - echo "PASSWORD_DEFAULT_POST=$PASSWORD_DEFAULT_PRODUCAO" >> .env
                  - echo "DATABASE_DEFAULT_POST=omnilink" >> .env
                  - echo "BUCKET_S3=teste-nodejs-show" >> .env
                  - echo "BUCKET_S3_OMNISAFE=gestoromnisafe" >> .env
                  - echo "BUCKET_S3_ARQUIVOS=files-shownet" >> .env
                  - echo "BUCKET_S3_GRAVACOES_OMNICOM=gravacoes-omnicom" >> .env
                  - echo "ACCESS_KEY_ID_S3=$ACCESS_KEY_ID_S3_PRODUCAO" >> .env
                  - echo "SECRET_ACCESS_KEY_S3=$SECRET_ACCESS_KEY_S3_PRODUCAO" >> .env
                  - echo "BUCKET_S3_SCORE=omniscore" >> .env
                  - echo "ACCESS_KEY_ID_S3_SCORE=$ACCESS_KEY_ID_S3_SCORE" >> .env
                  - echo "SECRET_ACCESS_KEY_S3_SCORE=$SECRET_ACCESS_KEY_S3_SCORE" >> .env
                  - echo "BASE_URL_SHOW=https://gestor.showtecnologia.com/gestor/index.php" >> .env
                  - echo "BASE_URL_OMNILINK=https://gestor.omnilink.com.br/gestor/index.php" >> .env
                  - echo "BASE_URL_CEABS=https://gestor.ceabs.com.br/gestor/index.php" >> .env
                  - echo "BASE_URL_SAVER=10.7.4.11" >> .env
                  - echo "BASE_URL_IASWS=http://10.130.0.132:12100/iasws/iasws.asmx?wsdl" >> .env
                  - echo "TELEMETRY_ACCESS_TOKEN=$TELEMETRY_ACCESS_TOKEN_PRODUCAO" >> .env
                  - echo "TELEMETRY_API_ENDPOINT=http://10.130.0.167:84/api" >> .env
                  - echo "TOKEN_SHOWNET=$TOKEN_SHOWNET_PRODUCAO" >> .env
                  - echo "TOKEN_OMNI_ID=$TOKEN_OMNI_ID" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=$TOKEN_BOT_OMNI_GR" >> .env
                  - echo "TOKEN_MAIL=$TOKEN_MAIL_PRODUCAO" >> .env
                  - echo "TOKEN_POWERBI=$TOKEN_POWERBI_PRODUCAO" >> .env
                  - echo "TOKEN_CRM=$TOKEN_CRM_PRODUCAO" >> .env
                  - echo "TOKEN_CRM_NATIVA=$TOKEN_CRM_NATIVA" >> .env
                  - echo "BASE_URL_CRM_ODATA_API=https://crm.omnilink.com.br/CRM/api/data/v8.2/" >> .env
                  - echo "CRM_NTLM_USER=svc.omni.shownet" >> .env
                  - echo "CRM_NTLM_PASS=Dynamics2@19" >> .env
                  - echo "REGIAO_DYNAMO=us-east-2" >> .env
                  - echo "ENDPOINT_DYNAMO=http://dynamodb.us-east-2.amazonaws.com" >> .env
                  - echo "ACCESS_KEY_ID_DYNAMO=$ACCESS_KEY_ID_DYNAMO_PRODUCAO" >> .env
                  - echo "SECRET_ACCESS_KEY_DYNAMO=$SECRET_ACCESS_KEY_DYNAMO_PRODUCAO" >> .env
                  - echo "SES_USER_AWS=$SES_USER_AWS_PRODUCAO" >> .env
                  - echo "SES_PASS_AWS=$SES_PASS_AWS_PRODUCAO" >> .env
                  - echo "SES_HOST_AWS=email-smtp.us-east-1.amazonaws.com" >> .env
                  - echo "SES_PORT_AWS=587" >> .env
                  - echo "PORT=3333" >> .env
                  - echo "CACHE_HOST=$CACHE_HOST_CN" >> .env
                  - echo "CACHE_PORT=6379" >> .env
                  - echo "REDIS_OMNISCORE_HOST=$CACHE_HOST_CN" >> .env
                  - echo "REDIS_OMNISCORE_PORT=$REDIS_OMNISCORE_PORT" >> .env
                  - echo "BASE_URL_LINKER=http://web.omnilink.com.br/api?wsdl" >> .env
                  - echo "USUARIO_API_LINKER=zatix\svc.omni.apilinker" >> .env
                  - echo "SENHA_API_LINKER=P@ssw0rD" >> .env
                  - echo "BASE_URL_ESPELHAMENTO=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_ESPELHAMENTO_VEICULOS=http://10.8.0.101:8085/WSEspelhamentoSinalNovo.asmx?wsdl" >> .env
                  - echo "BASE_URL_CRM=https://app.omnilink.com.br/crmintegration/api" >> .env
                  - echo "TOKEN_INFOBIP=$TOKEN_INFOBIP" >> .env
                  - echo "LIMITE_CONEXOES_USUARIO=60" >> .env
                  - echo "BASE_URL_INFOBIP=yrpgqp.api.infobip.com" >> .env
                  - echo "TIMEOUT_SERVIDOR=60000" >> .env
                  - echo "TOKEN_OMNITAG=$TOKEN_OMNITAG" >> .env
                  - echo "BASE_URL_API_EXATO=https://api.exato.digital/" >> .env
                  - echo "TOKEN_EXATO=$TOKEN_EXATO" >> .env
                  - echo "BASE_URL_API_CREDIFY=https://apibd.credify.com.br/" >> .env
                  - echo "TOKEN_CREDIFY=$TOKEN_CREDIFY" >> .env
                  - echo "BASE_URL_API_QUOD=https://api.empresas.quod.com.br/" >> .env
                  - echo "USER_QUOD=$USER_QUOD" >> .env
                  - echo "PASSWORD_QUOD=$PASSWORD_QUOD" >> .env
                  - echo "BASE_URL_API_PLEXI=https://api.plexi.com.br/" >> .env
                  - echo "TOKEN_PLEXI=$TOKEN_PLEXI" >> .env
                  - echo "BASE_URL_API_INFOSIMPLES=https://api.infosimples.com/" >> .env
                  - echo "TOKEN_INFOSIMPLES=$TOKEN_INFOSIMPLES" >> .env
                  - echo "LOGIN_GOV=$LOGIN_GOV" >> .env
                  - echo "SENHA_GOV=$SENHA_GOV" >> .env
                  - echo "GR_DATABASE=GR" >> .env
                  - echo "BASE_URL_API=apiinterna.showtecnologia.com" >> .env
                  - echo "API_ERP_BASE_URL=$API_ERP_BASE_URL" >> .env
                  - echo "API_ERP_TOKEN=$API_ERP_TOKEN" >> .env
                  - echo "FOCUS_NFE_BASE_URL_FOCUS=$FOCUS_NFE_BASE_URL" >> .env
                  - echo "FOCUS_NFE_TOKEN=$TOKEN_FOCUS_REVENDA" >> .env
                  - echo "TOKEN_OMNI_ID=$TOKEN_OMNI_ID" >> .env
                  - echo "TOKEN_BOT_OMNI_GR=$TOKEN_BOT_OMNI_GR" >> .env
                  - echo "BASE_URL_WSTT=https://wstt.omnilink.com.br/iasws/iasws.asmx?wsdl" >> .env
                  - echo "REDIS_STACK_HOST=10.7.4.30" >> .env
                  - echo "REDIS_STACK_PORT=6379" >> .env
                  - echo "BASE_URL_INVERTEXTO=https://api.invertexto.com/v1/holidays/" >> .env
                  - echo "TOKEN_INVERTEXTO=2129|7TxItl56NwX6Bg6OwmTeDgPUmOLWeL4w" >> .env
                  - echo "TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID" >> .env
                  - echo "TWILIO_API_KEY=$TWILIO_API_KEY" >> .env
                  - echo "TWILIO_API_SECRET=$TWILIO_API_SECRET" >> .env
                  - echo "TWILIO_OUT_GOING_APP_SID=$TWILIO_OUT_GOING_APP_SID" >> .env
                  - echo "TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN" >> .env
                  - echo "TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO=$TWILIO_PORCENTAGEM_ADICIONAL_VALOR_NUMERO" >> .env
                  - echo "TWILIO_TOKEN_WEBHOOK=$TWILIO_TOKEN_WEBHOOK" >> .env
                  - echo "TWILIO_SID_SHOWNET=$TWILIO_SID_SHOWNET" >> .env
                  - echo "TWILIO_TOKEN_SHOWNET=$TWILIO_TOKEN_SHOWNET" >> .env
                  - echo "TOKEN_INTEGRACAO_VIVO_INTELBRAS=c4813fa70ec248b3439b5276d28ec53c" >> .env
                  - echo "URI_SOCKET_VIVO_INTELBRAS=widevoice.intelbras.com.br" >> .env
                  - echo "SENHA_SOCKET_VIVO_INTELBRAS=itb@3131" >> .env
                  - echo "SOCKET_VIVO_INTELBRAS=wss://widevoice.intelbras.com.br:8089/ws" >> .env
                  - echo "BASE_URL_TELEGRAM=https://api.telegram.org/bot" >> .env
                  - echo "TELEGRAM_ACCESS_TOKEN=5877492689:AAF-4CiWiXJglCwPzzBv3FXykRvgPgfgZFk" >> .env
                  - echo "BASE_URL_ZATIX_SOAP=http://zatixtecnologia128050.protheus.cloudtotvs.com.br:4040/ws9901/CUSTOMER.apw" >> .env
                  - echo "LOG_NIVEL=info" >> .env
                  - echo "LOG_DESTINO=" >> .env
                  - echo "LOG_STDOUT=true" >> .env
                  - echo "CMSV6_BASE_URL=https://omnisafe-chn.omnilink.com.br" >> .env
                  - echo "CMSV6_USUARIO=$CMSV6_USUARIO_CHINA" >> .env
                  - echo "CMSV6_SENHA=$CMSV6_SENHA_CHINA" >> .env
                  - echo "BASE_URL_API_INTEGRACOES_OMNIGR=http://10.7.38.162:8080/" >> .env
                  - echo "BASE_URL_API_NODE=https://apiinterna.showtecnologia.com/api/" >> .env
                  - echo "API_ERP_BASE_URL=$API_ERP_BASE_URL" >> .env
                  - echo "API_ERP_TOKEN=$API_ERP_TOKEN" >> .env
                  - echo "FOCUS_NFE_BASE_URL=https://api.focusnfe.com.br/v2" >> .env
                  - echo "FOCUS_NFE_DOWNLOAD_BASE_URL=$FOCUS_NFE_DOWNLOAD_BASE_URL" >> .env
                  - echo "FOCUS_NFE_TOKEN=$FOCUS_NFE_TOKEN" >> .env
                  - echo "BASE_URL_SEM_PARAR=https://app.viafacil.com.br/wsvp/ValePedagio?wsdl" >> .env
                  - echo "BASE_URL_MAPLINK=https://api.maplink.global" >> .env
                  - echo "CLIENT_ID_MAPLINK=$CLIENT_ID_MAPLINK" >> .env
                  - echo "CLIENT_SECRET_MAPLINK=$CLIENT_SECRET_MAPLINK" >> .env
                  - echo "TOKEN_CHATBOT_OMNICOM=a93912d8-acfd-4308-9f05-fcaff6e25d44" >> .env
                  - echo "BRASPAG_HOST=$BRASPAG_HOST" >> .env
                  - echo "BRASPAG_MERCHANT_ID=$BRASPAG_MERCHANT_ID" >> .env
                  - echo "BRASPAG_MERCHANT_KEY=$BRASPAG_MERCHANT_KEY" >> .env
                  - echo "TOKEN_APP_TELEMETRIA=48c3f414cea4d4fd18d1e2f7ed5071b2" >> .env
                  - echo "KEYCRYPTO=$KEYCRYPTO" >> .env
                  - echo "IVCRYPTO=$IVCRYPTO" >> .env
                  - echo "NOMINATIM_SERVER=https://osm-aws.showtecnologia.com/nominatim" >> .env
                  - echo "APICADASTROSMHS=http://apimacro.omnilink.com.br:5002/GruposMacroIdCliente" >> .env
                  - echo "APIEMBARQUEMHS=http://apicomando.omnilink.com.br:5012/" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_HOST=$CACHE_HOST_CN" >> .env
                  - echo "REDIS_SERVICO_MONITORAMENTO_LOG_PORT=6379" >> .env
                  - echo "TOKEN_STREAMING_SELECIONADOS_SAFE=$TOKEN_STREAMING_SELECIONADOS_SAFE" >> .env
                  - echo "TOKEN_MIDDLEWARE_LAMBDA_SAFE=$TOKEN_MIDDLEWARE_LAMBDA_SAFE" >> .env
                  - echo "LAMBDA_VIDEO_URL=$LAMBDA_VIDEO_URL" >> .env
                  - echo "LAMBDA_VIDEO_TOKEN=$LAMBDA_VIDEO_TOKEN" >> .env
                  - echo "BASE_URL_API_PLACAS=https://wdapi2.com.br/" >> .env
                  - echo "TOKEN_API_PLACAS=$TOKEN_API_PLACAS" >> .env
                  - echo "TIMEOUT_REQUESTS_PLACAS=120000" >> .env
                  - echo "BASE_URL_FINANCIAL_ERP=$BASE_URL_FINANCIAL_ERP" >> .env
                  - echo "USER_FINANCIAL_ERP=$USER_FINANCIAL_ERP" >> .env
                  - echo "PASS_FINANCIAL_ERP=$PASS_FINANCIAL_ERP" >> .env
                  - echo "REDIS_BOT_JORNADA_HOST=$CACHE_HOST_CN" >> .env
                  - echo "REDIS_BOT_JORNADA_PORT=6379" >> .env
                  - echo "REDIS_LAST_TRACK_HOST=$REDIS_LAST_TRACK_HOST_CHN" >> .env
                  - echo "REDIS_LAST_TRACK_PORT=$REDIS_LAST_TRACK_PORT_CHN" >> .env
                  - echo "TOKEN_SIGAMY=1a49bd7814ae6d4a0096cafd3e2e3206a5ce8325" >> .env
                  - echo "BASE_URL_SHOWNET_PORTAL_COMPRA=$BASE_URL_SHOWNET_PORTAL_COMPRA" >> .env
                  - echo "OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS=$OMNICOM_DOMINIO_RECEBIMENTO_CHAMADAS" >> .env
                  - echo "BASE_URL_UPLOADS=$BASE_URL_UPLOADS" >> .env
                  - echo "REDIS_VIDEO_HOST=$REDIS_VIDEO_HOST_CHINA" >> .env
                  - echo "REDIS_VIDEO_PORT=$REDIS_VIDEO_PORT_CHINA" >> .env
                  - echo "REDIS_NOTIFICACOES_HOST=$CACHE_HOST_CN" >> .env
                  - echo "REDIS_NOTIFICACOES_PORT=6379" >> .env
                  - echo "STREAMING_SERVER_VIDEO_DNS=$STREAMING_SERVER_VIDEO_DNS" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HOST=$STREAMING_SERVER_VIDEO_HOST_CHINA" >> .env
                  - echo "STREAMING_SERVER_VIDEO_TCP_PORT=5001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_UDP_PORT=5002" >> .env
                  - echo "STREAMING_SERVER_VIDEO_HLS_PORT=6001" >> .env
                  - echo "STREAMING_SERVER_VIDEO_WEBRTC_PORT=6002" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_TCP_PORT=5003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_UDP_PORT=5004" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_HLS_PORT=6003" >> .env
                  - echo "STREAMING_PREVIEW_SERVER_VIDEO_WEBRTC_PORT=6004" >> .env
                  - echo "VIDEO_WS_PORT=16608" >> .env
                  - echo "ID_CONTA_PRINCIPAL_PRODUCAO=1" >> .env
                  - echo "ID_CONTA_PRINCIPAL_HOMOLOGACAO=2121" >> .env
                  - echo "BASE_URL_API_TELEVENDAS=$BASE_URL_API_TELEVENDAS" >> .env
                  - echo "BASE_URL_API_TELEVENDAS_WEBSOCKET=$BASE_URL_API_TELEVENDAS_WEBSOCKET" >> .env
                  - apt-get update
                  - apt-get install -y zip
                  - npm install
                  - npm run build
                  - zip -r china.zip dist public documentacao .env node_modules package.json .platform gestor-425512-34a83fb0020d.json
                  - echo "Compilação concluída"
              artifacts:
                  - china.zip
pipelines:
  branches:
    # Deploy automático para homologação ao dar merge na developers
    developers:
        - step: *buildHomologa
        - step:
            name: Deploy para EBS de homologação
            deployment: teste
            trigger: manual
            script:
                - echo "Fazendo deploy em homologação"
                - pipe: atlassian/aws-elasticbeanstalk-deploy:1.1.0
                  variables:
                    AWS_ACCESS_KEY_ID: 'AKIAQEHLA6SCR4QIVK4E'
                    AWS_SECRET_ACCESS_KEY: '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'
                    AWS_DEFAULT_REGION: 'us-east-2'
                    APPLICATION_NAME: 'api-gestor-homolocao'
                    ENVIRONMENT_NAME: 'Api-gestor-homolocao-env'
                    ZIP_FILE: 'homologa.zip'
                    S3_BUCKET: 'elasticbeanstalk-us-east-2-009082827909'
                    VERSION_LABEL: 'API_HOMOLOGACAO__${BITBUCKET_COMMIT:0:8}'
                - echo "Deploy API homologação finalizado"

    # Build automático com deploy manual para produção ao dar merge na master
    master:
        - step: *buildExterna
        - step: *buildInterna
        - step: *buildCron
        - step: *buildChina
        - step:
              name: Deploy para produção (externa)
              deployment: externa
              trigger: manual  # Uncomment to make this a manual deployment.
              script:
                  - echo "Fazendo deploy para o ambiente de produção"
                  - pipe: atlassian/aws-elasticbeanstalk-deploy:1.1.0
                    variables:
                      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_DEPLOY
                      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_DEPLOY
                      AWS_DEFAULT_REGION: 'us-east-2'
                      APPLICATION_NAME: 'ApiGestor_Externa'
                      ENVIRONMENT_NAME: 'ApiGestor-Externa-env'
                      ZIP_FILE: 'externa.zip'
                      S3_BUCKET: $BUCKET_DEPLOY_PRODUCAO
                      VERSION_LABEL: 'API_EXTERNA__$(date +%Y-%m-%d_%H:%M:%S)__${BITBUCKET_COMMIT:0:8}'
                  - echo "Deploy API externa finalizado"
        - step:
              name: Deploy para produção (interna)
              deployment: interna
              trigger: manual  # Uncomment to make this a manual deployment.
              script:
                  - echo "Fazendo deploy para o ambiente de produção"
                  - pipe: atlassian/aws-elasticbeanstalk-deploy:1.1.0
                    variables:
                      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_DEPLOY
                      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_DEPLOY
                      AWS_DEFAULT_REGION: 'us-east-2'
                      APPLICATION_NAME: 'ApiGestor_Interna'
                      ENVIRONMENT_NAME: 'ApiGestor-Interna-env'
                      ZIP_FILE: 'interna.zip'
                      S3_BUCKET: $BUCKET_DEPLOY_PRODUCAO
                      VERSION_LABEL: 'API_INTERNA__$(date +%Y-%m-%d_%H:%M:%S)__${BITBUCKET_COMMIT:0:8}'
                  - echo "Deploy API interna finalizado"
        - step:
              name: Deploy para produção (Cron)
              deployment: cron
              trigger: manual  # Uncomment to make this a manual deployment.
              script:
                  - echo "Fazendo deploy para o ambiente de produção"
                  - pipe: atlassian/aws-elasticbeanstalk-deploy:1.1.0
                    variables:
                      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_DEPLOY
                      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_DEPLOY
                      AWS_DEFAULT_REGION: 'us-east-2'
                      APPLICATION_NAME: 'Service_Relatorios_Background'
                      ENVIRONMENT_NAME: 'ServiceRelatoriosBackground-env'
                      ZIP_FILE: 'cron.zip'
                      S3_BUCKET: $BUCKET_DEPLOY_PRODUCAO
                      VERSION_LABEL: 'WORKER_CRON__$(date +%Y-%m-%d_%H:%M:%S)__${BITBUCKET_COMMIT:0:8}'
                  - echo "Deploy Worker finalizado"
        - step:
              name: Deploy para produção (China)
              deployment: china
              trigger: manual  # Uncomment to make this a manual deployment.
              script:
                  - echo "Fazendo deploy para o ambiente de produção"
                  - pipe: atlassian/aws-elasticbeanstalk-deploy:1.1.0
                    variables:
                      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_DEPLOY
                      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_DEPLOY
                      AWS_DEFAULT_REGION: 'ap-east-1'
                      APPLICATION_NAME: 'chn-api-interna'
                      ENVIRONMENT_NAME: 'Chn-api-interna-env'
                      ZIP_FILE: 'china.zip'
                      S3_BUCKET: $BUCKET_DEPLOY_PRODUCAO_CHINA
                      VERSION_LABEL: 'API_CHINA__$(date +%Y-%m-%d_%H:%M:%S)__${BITBUCKET_COMMIT:0:8}'
                  - echo "Deploy API China finalizado"