Available Scripts --- Before running any of the `start:{env}`, ensure that you have an `.env.{env}` file saved in the `/env` directory. The file is automatically generated by the running the info:{env} script in the `aws-connect-vm-serverless` module. If you are working in your own environment other than the ones provided by the script. Be sure to update the Pipfile as the file is used to deploy the CloudFormation infrastructure using `stacker`. ``` [scripts] deploy_envname = "stacker build --recreate-failed --region us-west-2 ./env/envname-us-west-2.env ./stacker.yml" ``` Once added, you can update your deployment script in the `package.json` file ``` "scripts" : { ... "deploy:envname": "pipenv run deploy_envname && sh -ac '. ./env/.env.envname; react-scripts build' && node ./scripts/uploader --stage envname --verbose -i" } ``` Runs the pipenv script to deploy your CloudFormation Infrastructure > pipenv run deploy_envname Loads your environment variable into your reactjs environment and builds your reactjs portal > sh -ac '. ./env/.env.envname; react-scripts build Uploads all the build files into the appropriate bucket > node ./scripts/uploader --stage envname --verbose -i Development --- Follow these instructions to build and modify the project files for an existing stack. The purpose of this process is to be able to develop the portal code incrementally. The files will in the `./build` folder. This script will utilize another script `modify_build.js` which replaces some paths and names in the built files to mirror what the deployed infrastructure expects. Here are the instructions: 1) Modify the input values inside of `modify_portal.js` with the outputs of the Cloudformation deployment. Check CloudWatch logs for the values. 2) Run `./development.sh` in `source/aws-connect-vm-portal/scripts/` 3) Then, manually copy the `index.html` and the `asset-manifest.json` file and all files that end in `*.js` or `*.map` into the S3 bucket. 4) Go to CloudFront and invalidate `*`. There are console logs that are suppressed so they don't show in the browser. Feel free to uncomment then for debugging purposes: - The Redux logger can be enabled in `source/aws-connect-vm-portal/src/index.tsx` - Header logs can be enabled here `source/aws-connect-vm-portal/src/service/api.service.ts` line 63 - Auth logs can be enabled here `source/aws-connect-vm-portal/src/common/requiresAuth.js` line 28 & 32 - Redux action logs are commented out in each respective redux action file