cd terraform/
# Infrastructure
cd infrastructure/
# change vars.tf file with a new name
terraform init
terraform fmt
terraform validate
terraform plan
terraform apply
cd ../
# Application
cd applications/
cd backend/
# change vars.tf file with a new name
terraform init
terraform fmt
terraform validate
terraform plan
terraform apply
# repeat for frontend
cd backend/
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
# Change config.py file
docker build -t aitelemetry-repository .
docker run -d -p 80:80 aitelemetry-repository:latest
# Change config.py file
# Build & Push image to ECR
# Update Task Definition https://docs.aws.amazon.com/AmazonECS/latest/developerguide/update-task-definition.html (E.g. in backend/task-definition.json)
# Update the ECS Service
aws ecs update-service --cluster <CLUSTER_NAME> --service aitelemetry --task-definition <FAMILY> --force-new-deployment
cd frontend/
npm install
npm start
# Adjust localhost in src/services/api.js for loadbalancer' DNS
npm install
npm run build
aws s3 rm s3://<BUCKET NAME>/ --recursive
aws s3 cp build/ s3://<BUCKET NAME>/ --recursive --acl public-read
cd terraform/
terraform destroy