diff --git a/.codebuild/build.sh b/.codebuild/build.sh index 38d5fcbc..62b05ac0 100644 --- a/.codebuild/build.sh +++ b/.codebuild/build.sh @@ -105,6 +105,25 @@ deploy_hathor_network_account() { send_slack_message "New version deployed to testnet-hotel: ${GIT_REF_TO_DEPLOY}" + # --- Testnet India --- + # Gets all env vars with `testnetindia_` prefix and re-exports them without the prefix + for var in "${!testnetindia_@}"; do + export ${var#testnetindia_}="${!var}" + done + + make migrate; + make build-daemon; + make deploy-lambdas-testnet-india; + # The idea here is that if the lambdas deploy fail, the built image won't be pushed: + make push-daemon; + + # Unsets all the testnet env vars so we make sure they don't leak to other deploys + for var in "${!testnetindia_@}"; do + unset ${var#testnetindia_} + done + + send_slack_message "New version deployed to testnet-india: ${GIT_REF_TO_DEPLOY}" + # --- Mainnet --- # Gets all env vars with `mainnet_` prefix and re-exports them without the prefix for var in "${!mainnet_@}"; do diff --git a/.codebuild/buildspec.yml b/.codebuild/buildspec.yml index 2f9b4dd1..2eb017a3 100644 --- a/.codebuild/buildspec.yml +++ b/.codebuild/buildspec.yml @@ -48,6 +48,17 @@ env: testnethotel_PUSH_NOTIFICATION_ENABLED: "true" testnethotel_PUSH_ALLOWED_PROVIDERS: "android,ios" testnethotel_APPLICATION_NAME: "wallet-service-testnet-hotel" + testnetindia_DEFAULT_SERVER: "https://wallet-service.private-nodes.india.testnet.hathor.network/v1a/" + testnetindia_WS_DOMAIN: "ws.wallet-service.india.testnet.hathor.network" + testnetindia_NETWORK: "testnet" + testnetindia_LOG_LEVEL: "debug" + testnetindia_NFT_AUTO_REVIEW_ENABLED: "true" + testnetindia_EXPLORER_STAGE: "india" + testnetindia_EXPLORER_SERVICE_LAMBDA_ENDPOINT: "https://lambda.eu-central-1.amazonaws.com" + testnetindia_WALLET_SERVICE_LAMBDA_ENDPOINT: "https://lambda.eu-central-1.amazonaws.com" + testnetindia_PUSH_NOTIFICATION_ENABLED: "true" + testnetindia_PUSH_ALLOWED_PROVIDERS: "android,ios" + testnetindia_APPLICATION_NAME: "wallet-service-testnet-india" mainnet_staging_DEFAULT_SERVER: "https://wallet-service.private-nodes.hathor.network/v1a/" mainnet_staging_WS_DOMAIN: "ws.staging.wallet-service.hathor.network" mainnet_staging_NETWORK: "mainnet" @@ -153,6 +164,32 @@ env: testnethotel_ALERT_MANAGER_REGION: "WalletService/testnet-hotel:ALERT_MANAGER_REGION" testnethotel_ALERT_MANAGER_TOPIC: "WalletService/testnet-hotel:ALERT_MANAGER_TOPIC" testnethotel_ALERT_MANAGER_ACCOUNT_ID: "WalletService/testnet-hotel:ALERT_MANAGER_ACCOUNT_ID" + # Testnet India secrets + testnetindia_ACCOUNT_ID: "WalletService/testnet-india:account_id" + testnetindia_AUTH_SECRET: "WalletService/testnet-india:auth_secret" + testnetindia_AWS_VPC_DEFAULT_SG_ID: "WalletService/testnet-india:aws_vpc_default_sg_id" + testnetindia_AWS_SUBNET_ID_1: "WalletService/testnet-india:aws_subnet_id_1" + testnetindia_AWS_SUBNET_ID_2: "WalletService/testnet-india:aws_subnet_id_2" + testnetindia_AWS_SUBNET_ID_3: "WalletService/testnet-india:aws_subnet_id_3" + testnetindia_DB_NAME: "WalletService/rds/testnet-india:dbname" + testnetindia_DB_USER: "WalletService/rds/testnet-india:username" + testnetindia_DB_PASS: "WalletService/rds/testnet-india:password" + testnetindia_DB_ENDPOINT: "WalletService/rds/testnet-india:host" + testnetindia_DB_PORT: "WalletService/rds/testnet-india:port" + testnetindia_REDIS_URL: "WalletService/redis/testnet-india:url" + testnetindia_REDIS_PASSWORD: "WalletService/redis/testnet-india:password" + testnetindia_FIREBASE_PROJECT_ID: "WalletService/testnet-india:FIREBASE_PROJECT_ID" + testnetindia_FIREBASE_PRIVATE_KEY_ID: "WalletService/testnet-india:FIREBASE_PRIVATE_KEY_ID" + testnetindia_FIREBASE_PRIVATE_KEY: "WalletService/testnet-india:FIREBASE_PRIVATE_KEY" + testnetindia_FIREBASE_CLIENT_EMAIL: "WalletService/testnet-india:FIREBASE_CLIENT_EMAIL" + testnetindia_FIREBASE_CLIENT_ID: "WalletService/testnet-india:FIREBASE_CLIENT_ID" + testnetindia_FIREBASE_AUTH_URI: "WalletService/testnet-india:FIREBASE_AUTH_URI" + testnetindia_FIREBASE_TOKEN_URI: "WalletService/testnet-india:FIREBASE_TOKEN_URI" + testnetindia_FIREBASE_AUTH_PROVIDER_X509_CERT_URL: "WalletService/testnet-india:FIREBASE_AUTH_PROVIDER_X509_CERT_URL" + testnetindia_FIREBASE_CLIENT_X509_CERT_URL: "WalletService/testnet-india:FIREBASE_CLIENT_X509_CERT_URL" + testnetindia_ALERT_MANAGER_REGION: "WalletService/testnet-india:ALERT_MANAGER_REGION" + testnetindia_ALERT_MANAGER_TOPIC: "WalletService/testnet-india:ALERT_MANAGER_TOPIC" + testnetindia_ALERT_MANAGER_ACCOUNT_ID: "WalletService/testnet-india:ALERT_MANAGER_ACCOUNT_ID" # Mainnet Staging secrets mainnet_staging_ACCOUNT_ID: "WalletService/mainnet_staging:account_id" mainnet_staging_AUTH_SECRET: "WalletService/mainnet_staging:auth_secret" diff --git a/Makefile b/Makefile index 596c7d63..2d066fce 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,10 @@ deploy-lambdas-testnet: deploy-lambdas-testnet-hotel: AWS_SDK_LOAD_CONFIG=1 yarn workspace wallet-service run serverless deploy --stage hotel --region eu-central-1 +.PHONY: deploy-lambdas-testnet-india +deploy-lambdas-testnet-india: + AWS_SDK_LOAD_CONFIG=1 yarn workspace wallet-service run serverless deploy --stage india --region eu-central-1 + .PHONY: deploy-lambdas-mainnet-staging deploy-lambdas-mainnet-staging: AWS_SDK_LOAD_CONFIG=1 yarn workspace wallet-service run serverless deploy --stage mainnet-stg --region eu-central-1 diff --git a/packages/wallet-service/serverless.yml b/packages/wallet-service/serverless.yml index 514d8a4b..eb2e0b15 100644 --- a/packages/wallet-service/serverless.yml +++ b/packages/wallet-service/serverless.yml @@ -1,4 +1,4 @@ -service: hathor-wallet-service +service: ${env:SERVERLESS_DEPLOY_PREFIX, "hathor-wallet-service"} frameworkVersion: '3' useDotenv: true