Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .codebuild/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 37 additions & 0 deletions .codebuild/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/wallet-service/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ functions:
Fn::GetAtt: [ SendNotificationToDeviceLambdaFunction , Arn ]
healthcheck:
handler: src/api/healthcheck.getHealthcheck
timeout: 20 # seconds
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While checking the health of the Testnet Hotel after creating it, I received some timeouts.

It was receiving a timeout from the fullnode, but the Lambda timeout was lower than the one of the request, so the Lambda timed out without any information about the problem.

Increasing to 20s makes sure there will be a response indicating the problem (this is important even for the alerts we receive in case of failures in the healthcheck)

events:
- http:
private: true
Expand Down