This repository contains a Makefile to automate the deployment of the BGSI-GeneticAnalysisSupportPlatformIndonesia-GASPI (BGSI-GASPI) project. The Makefile streamlines the process of cloning the repository, initializing sBeacon, and deploying to different AWS environments (Hub01 and Hub02).
Before using this Makefile, ensure you have the following prerequisites:
- Git
- Python 3.12
- AWS CLI v2
- Terraform v1.9.4 or newer
- Valid AWS credentials for both Hub01 and Hub02 environments
- SSH access configured for GitHub
- Sudo privileges (for Docker installation)
The Makefile includes automated installation for:
- Node.js v20 (via nvm)
- pnpm package manager
- Docker and Docker Compose
-
Python Virtual Environment:
python3.12 -m venv ~/py312 source ~/py312/bin/activate
-
AWS Credentials: Ensure your AWS credentials are properly configured in
~/.aws/credentials
with the following profiles:[GXC-TF-User-Executor-Hub01] aws_access_key_id = your_access_key aws_secret_access_key = your_secret_key region = ap-southeast-3 [GXC-TF-User-Executor-Hub02] aws_access_key_id = your_access_key aws_secret_access_key = your_secret_key region = ap-southeast-3
-
Full Deployment to Hub01 (Default):
make
This command will:
- Install all dependencies (Node.js, pnpm, Docker)
- Clone the repository
- Initialize submodules
- Initialize sBeacon
- Deploy to Hub01
-
Install Dependencies Only:
make install-deps
This will install:
- NVM (Node Version Manager)
- Node.js v20
- pnpm package manager
- Docker and Docker Compose
-
Individual Dependency Installation:
make install-nvm # Install NVM make install-node # Install Node.js v20 make install-pnpm # Install pnpm make install-docker # Install Docker and Docker Compose
-
Check Tool Versions:
make version-check
This will display versions of:
- Node.js
- pnpm
- Docker
- Docker Compose
- Terraform
- Python
- AWS CLI
-
Clone Repository:
make clone
-
Init Submodule
sbeacon
&svep
:make init-submodule
-
Initialize sBeacon:
make init-sbeacon
-
Plan Terraform Changes:
make plan
-
Apply Terraform Changes:
make apply-terraform # With confirmation prompt # or make apply-terraform-autoapprove # Without confirmation
-
View Terraform Output:
make output
-
Clean Up:
make clean
-
Set Hub01 Environment:
make set-hub01-env
-
Set Hub02 Environment:
make set-hub02-env
-
Deploy Hub01:
make deploy-hub01
-
Deploy Hub02:
make deploy-hub02
After cloning, your repository structure should look like this:
BGSI-GeneticAnalysisSupportPlatformIndonesia-GASPI/
├── sbeacon/
│ └── init.sh
├── svep/
├── backend.tf
├── terraform.tfvars
└── Makefile
- backend.tf:
terraform { backend "s3" { bucket = "terraform-states-hub1-gaspi" key = "gaspi-infrastructure-deployment" region = "ap-southeast-3" dynamodb_table = "terraform-states-hub1-gaspi" } }
- backend.tf:
terraform { backend "s3" { region = "ap-southeast-3" bucket = "tf-state-209479276142-ap-southeast-3" dynamodb_table = "ddb-tf-state-209479276142-ap-southeast-3" key = "gxc-consortium/209479276142/sbeacon/terraform.tfstate" encrypt = true } }
-
AWS Authentication Issues:
- Ensure AWS credentials are properly configured
- Verify the correct AWS profile is being used
- Check AWS CLI configuration using
aws configure list
- Check AWS CLI access token
aws sts get-caller-identity --profile $AWS_PROFILE
-
Python Environment Issues:
- Verify Python 3.12 is installed:
python3.12 --version
- Ensure virtual environment is activated
- Check required Python packages are installed
- Verify Python 3.12 is installed:
-
Terraform State Issues:
- Verify S3 bucket exists and is accessible
- Check DynamoDB table permissions
- Ensure backend configuration is correct
-
Docker Installation Issues:
- Ensure user is in docker group
- Verify docker service is running:
sudo systemctl status docker
- Check docker compose installation:
docker compose version
-
Node.js/pnpm Issues:
- Verify NVM installation:
nvm --version
- Check Node.js version:
node --version
- Verify pnpm installation:
pnpm --version
- Verify NVM installation:
For issues or questions related to this deployment process, please contact:
- DevOps Team: [email protected]