I have an Angular application setting up for the deployment on EC2 instance using AWS CodeDeploy.
My bitbucket-pipelines.yml file contains.
pipelines:
branches:
staging:
- step:
name: Build and test
deployment: staging
image: node:10.15
caches:
- node
script: # Modify the commands below to build your repository.
- echo "$(ls -la)"
- npm install -g @angular/cli
- npm install --dev
- ng build
- echo "$(ls -la dist/qcg-frontend/)"
artifacts:
- dist/**
- step:
name: Generate documentation
caches:
- node
script:
- npm run doc
artifacts:
- documentation/**
- step:
name: Deploy to Staging
image: python:3.7
deployment: staging
script:
- apt-get update # required to install zip
- apt-get install -y zip # required for packaging up the application
- pip install boto3==1.3.0 # required for codedeploy_deploy.py
- zip -r /tmp/artifact.zip * # package up the application for deployment
- python codedeploy_deploy.py # run the deployment script
I have two steps, one to build the application and the next one to build the documentation.
Both are generated in two separate directories which I have defined in the artifacts.
I have to put both artifacts in the same EC2 instance and want to send both artifacts together to the instance.
I have a few questions:
1. How to zip both artifacts
2. Should I copy the Angular source code in EC2 and run the server and manage it by PM2?
3. Or just copy the build directory and point the domain to the index.html file?
4. What should be the best approach for the staging server (where the application will run in the development mode) and production server?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.