Steps
- Clone this very repo.
- Set up AWS Stuff 2.1. Create key pair - and copy that to the home directory 2.2. Security Groups - Add 3000 and 22 ports. 2.3. Create a bucket - typescript-express-artifact 2.4. Create a role with S3 full access. 2.5. Create a demo IAM User and configure the AWS Cli. 2.6 AWS Cli - install : https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
- Create the instance - and choose key pair and security group
- SSH into the instance and install nodejs
- Create project folder in the server.
- AWS Cli
- Upload files from the local repo to the S3 bucket.
- Copy from the S3 bucket to the project directory, Run npm install, npm run build and node dist/index.js
- Show the output
Rinse and repeat till you find peace.
zip -r project.zip . -x node_modules* dist* .git* && aws s3 cp project.zip s3://typescript-express-artifact-2/code-deploy-2/project.zip
aws s3 cp s3://typescript-express-artifact-2/code-deploy-2/project.zip project.zip unzip -o project.zip -d Code/express-codedeploy-2/ npm install --prefix Code/express-codedeploy-2/ npm run build --prefix Code/express-codedeploy-2/ sudo systemctl restart node-api.service
aws s3 cp s3://typescript-express-artifact-2/code-deploy-2/project.zip project.zip && unzip -o project.zip -d Code/express-codedeploy-2/ && npm install --prefix Code/express-codedeploy-2/ && npm run build --prefix Code/express-codedeploy-2/ && sudo systemctl restart node-api.service