Skip to content

Commit

Permalink
Merge pull request #398 from flexion/task/update_readme
Browse files Browse the repository at this point in the history
cleaning up the readmes some
  • Loading branch information
codyseibert authored Dec 17, 2018
2 parents 0b9d4c9 + b05f23d commit 9532951
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 77 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ You can access the dynamodb shell at http://localhost:8000/shell
You can access the dynamodb-admin ui at http://localhost:8001
You can access s3 local at http://localhost:9000

In order to kill that docker container, you will need to run the following command in separate terminal:

`./kill-docker-run.sh`

## Running this project locally without Docker

The EF-CMS is comprised of two components: the API and the UI. Each must be run in order to function.
Expand Down
74 changes: 4 additions & 70 deletions efcms-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,25 @@

- must have JDK 8 installed

- install node dependences: `npm i`

- install dynamodb local: `npm run install:dynamodb`

### Optional prerequisites if deploying a sandbox

- `npm install -g serverless`

- Install [terraform](https://www.terraform.io/intro/getting-started/install.html)

### Optional prerequisites if deploying a sandbox


- `npm install -g serverless`

- Install [terraform](https://www.terraform.io/intro/getting-started/install.html)
- `npm i`

# Contributing

- `npm start`

# Running Tests

You can run the tests over the efcms-service via the following command:

- `npm test`

# Trouble Shooting

## API Gateway Execution and Access Request Logging Note

### Execution Logging

Some manual steps are necessary prior but only need to be done once for execution logging.

Go through this [rawDocument](https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-cloudwatch-logs/).

In general, you need to:

1. Create a new IAM role (for example, apigateway-cloudwatch-logs-role) with trust policy apigateway.amazonaws.com
2. Attach aws exist policy AmazonAPIGatewayPushToCloudWatchLogs to this role
3. Record this IAM role’s ARN
4. Add this role’s arn to apigateway -> settings -> CloudWatch log role ARN\*

Cloudwatch log is API-Gateway-Execution-Logs\_<rest-api-id>/<stage>

# Usage

See the Jenkinsfile.

In general:

$cd stageDir && terraform init && terraform apply
$serverless deploy --stage myStageName

# Contribution

### Starting Serverless Offline

`npm start`

^ this will host a local service at http://localhost:3000

### Running Unit Test Coverage on a Watcher

`npm run test:coverage:watch`

### Running the Full Build (What Jenkins will Run)

`npm run build`
Sometimes you may get errors when doing npm install. To fix, removce the package-lock.json file and re-run npm install.

## Sandbox Deploys to AWS

`EFCMS_DOMAIN=ustc-case-mgmt.flexion.us ENVIRONMENT=<yourname> REGION=us-east-1 ./deploy-sandbox.sh`

Modify the API_URL in web-client/environments/dev.js to match the URL returned from the serverless deploy.

Update the name of the service in the deploy-sandbox.sh script to match your service name from the serverless.yml

## Serverless Local

- see https://medium.com/a-man-with-no-server/running-aws-lambda-and-api-gateway-locally-serverless-offline-3c64b3e54772
for background. NOTE: Docker is required.

1. `npm run install:dynamodb` install a local dynamodb (optional)
2. `npm start` in another terminal run the serverless-local on 3000
If you want to point your local ui to your sandbox, modify the API_URL in web-client/environments/dev.js to match the URL returned from the serverless deploy.

## Load and Smoke Testing with Artillery

Expand Down
2 changes: 1 addition & 1 deletion efcms-service/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=./src
sonar.exclusions=**/node_modules/**/*, **/*.test.js, **/coverage/**, **/*Lambda.js
sonar.exclusions=**/node_modules/**/*, **/*.test.js, **/coverage/**, **/*Lambda.js, **/applicationContext.js
sonar.javascript.file.suffixes=.js

# Encoding of the source code. Default is default system encoding
Expand Down
2 changes: 1 addition & 1 deletion shared/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=./src
sonar.exclusions=**/node_modules/**/*, **/*.test.js, **/coverage/**, **/persistence/**, **/useCases/**
sonar.exclusions=**/node_modules/**/*, **/*.test.js, **/coverage/**, **/persistence/**, **/useCases/**, **/*Proxy.js
sonar.javascript.file.suffixes=.js

# Encoding of the source code. Default is default system encoding
Expand Down
2 changes: 1 addition & 1 deletion web-client/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=./src
sonar.exclusions=**/node_modules/**/*,dist/**, **/*.test.js, **/coverage/**, **/cypress/**, src/environments/**, src/**/*Proxy.js, src/index.*, src/app.js, src/router.js, stylelint.*,
sonar.exclusions=**/node_modules/**/*,dist/**, **/*.test.js, **/coverage/**, **/cypress/**, src/environments/**, src/index.*, src/app.js, src/router.js, stylelint.*, **/applicationContext.js
sonar.javascript.file.suffixes=.js

# Encoding of the source code. Default is default system encoding
Expand Down

0 comments on commit 9532951

Please sign in to comment.