diff --git a/.codebuild/build.sh b/.codebuild/build.sh index 0bbfead8..38d5fcbc 100644 --- a/.codebuild/build.sh +++ b/.codebuild/build.sh @@ -86,6 +86,25 @@ deploy_hathor_network_account() { send_slack_message "New version deployed to testnet-production: ${GIT_REF_TO_DEPLOY}" + # --- Testnet Hotel --- + # Gets all env vars with `testnethotel_` prefix and re-exports them without the prefix + for var in "${!testnethotel_@}"; do + export ${var#testnethotel_}="${!var}" + done + + make migrate; + make build-daemon; + make deploy-lambdas-testnet-hotel; + # 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 "${!testnethotel_@}"; do + unset ${var#testnethotel_} + done + + send_slack_message "New version deployed to testnet-hotel: ${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 dc03251d..20696a52 100644 --- a/.codebuild/buildspec.yml +++ b/.codebuild/buildspec.yml @@ -37,6 +37,17 @@ env: testnet_PUSH_NOTIFICATION_ENABLED: "true" testnet_PUSH_ALLOWED_PROVIDERS: "android,ios" testnet_APPLICATION_NAME: "wallet-service-testnet" + testnethotel_DEFAULT_SERVER: "https://wallet-service.private-nodes.hotel.testnet.hathor.network/v1a/" + testnethotel_WS_DOMAIN: "ws.wallet-service.hotel.testnet.hathor.network" + testnethotel_NETWORK: "testnet" + testnethotel_LOG_LEVEL: "debug" + testnethotel_NFT_AUTO_REVIEW_ENABLED: "true" + testnethotel_EXPLORER_STAGE: "hotel" + testnethotel_EXPLORER_SERVICE_LAMBDA_ENDPOINT: "https://lambda.eu-central-1.amazonaws.com" + testnethotel_WALLET_SERVICE_LAMBDA_ENDPOINT: "https://lambda.eu-central-1.amazonaws.com" + testnethotel_PUSH_NOTIFICATION_ENABLED: "true" + testnethotel_PUSH_ALLOWED_PROVIDERS: "android,ios" + testnethotel_APPLICATION_NAME: "wallet-service-testnet-hotel" 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" @@ -116,6 +127,32 @@ env: testnet_ALERT_MANAGER_REGION: "WalletService/testnet:ALERT_MANAGER_REGION" testnet_ALERT_MANAGER_TOPIC: "WalletService/testnet:ALERT_MANAGER_TOPIC" testnet_ALERT_MANAGER_ACCOUNT_ID: "WalletService/testnet:ALERT_MANAGER_ACCOUNT_ID" + # Testnet Hotel secrets + testnethotel_ACCOUNT_ID: "WalletService/testnet-hotel:account_id" + testnethotel_AUTH_SECRET: "WalletService/testnet-hotel:auth_secret" + testnethotel_AWS_VPC_DEFAULT_SG_ID: "WalletService/testnet-hotel:aws_vpc_default_sg_id" + testnethotel_AWS_SUBNET_ID_1: "WalletService/testnet-hotel:aws_subnet_id_1" + testnethotel_AWS_SUBNET_ID_2: "WalletService/testnet-hotel:aws_subnet_id_2" + testnethotel_AWS_SUBNET_ID_3: "WalletService/testnet-hotel:aws_subnet_id_3" + testnethotel_DB_NAME: "WalletService/rds-hotel/testnet:dbname" + testnethotel_DB_USER: "WalletService/rds-hotel/testnet:username" + testnethotel_DB_PASS: "WalletService/rds-hotel/testnet:password" + testnethotel_DB_ENDPOINT: "WalletService/rds-hotel/testnet:host" + testnethotel_DB_PORT: "WalletService/rds-hotel/testnet:port" + testnethotel_REDIS_URL: "WalletService/redis-hotel/testnet:url" + testnethotel_REDIS_PASSWORD: "WalletService/redis-hotel/testnet:password" + testnethotel_FIREBASE_PROJECT_ID: "WalletService/testnet-hotel:FIREBASE_PROJECT_ID" + testnethotel_FIREBASE_PRIVATE_KEY_ID: "WalletService/testnet-hotel:FIREBASE_PRIVATE_KEY_ID" + testnethotel_FIREBASE_PRIVATE_KEY: "WalletService/testnet-hotel:FIREBASE_PRIVATE_KEY" + testnethotel_FIREBASE_CLIENT_EMAIL: "WalletService/testnet-hotel:FIREBASE_CLIENT_EMAIL" + testnethotel_FIREBASE_CLIENT_ID: "WalletService/testnet-hotel:FIREBASE_CLIENT_ID" + testnethotel_FIREBASE_AUTH_URI: "WalletService/testnet-hotel:FIREBASE_AUTH_URI" + testnethotel_FIREBASE_TOKEN_URI: "WalletService/testnet-hotel:FIREBASE_TOKEN_URI" + testnethotel_FIREBASE_AUTH_PROVIDER_X509_CERT_URL: "WalletService/testnet-hotel:FIREBASE_AUTH_PROVIDER_X509_CERT_URL" + testnethotel_FIREBASE_CLIENT_X509_CERT_URL: "WalletService/testnet-hotel:FIREBASE_CLIENT_X509_CERT_URL" + 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" # 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 d38f1ff6..35f7dedb 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,10 @@ deploy-lambdas-dev-testnet: deploy-lambdas-testnet: AWS_SDK_LOAD_CONFIG=1 yarn workspace wallet-service run serverless deploy --stage testnet --region eu-central-1 +.PHONY: deploy-lambdas-testnet-hotel +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-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 1378edf5..42cf5e12 100644 --- a/packages/wallet-service/serverless.yml +++ b/packages/wallet-service/serverless.yml @@ -681,6 +681,7 @@ functions: Fn::GetAtt: [ SendNotificationToDeviceLambdaFunction , Arn ] healthcheck: handler: src/api/healthcheck.getHealthcheck + timeout: 20 # seconds events: - http: private: true