Skip to content

Commit

Permalink
Merge branch 'production' of https://github.com/NYPL/nypl-library-car…
Browse files Browse the repository at this point in the history
…d-app into production
  • Loading branch information
ktp242 committed Dec 18, 2018
2 parents 197e515 + 6df03ae commit 073bdc3
Show file tree
Hide file tree
Showing 17 changed files with 350 additions and 117 deletions.
8 changes: 8 additions & 0 deletions .ebextensions/03_swap_setup.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commands:
setup_swap:
command: |
/bin/dd if=/dev/zero of=/var/swapfile bs=1M count=2048
/bin/chmod 600 /var/swapfile
/sbin/mkswap /var/swapfile
/sbin/swapon /var/swapfile
test: "test ! -e /var/swapfile"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ option_settings:
InstancePort: 80
InstanceProtocol: HTTP
aws:elb:listener:80:
ListenerEnabled: false
ListenerEnabled: false
3 changes: 3 additions & 0 deletions .ebextensions/enhanced-health.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
option_settings:
aws:elasticbeanstalk:healthreporting:system:
SystemType: enhanced
52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
language: node_js
node_js:
- '6'
cache:
directories:
- node_modules
install: npm install
script: npm test
before_deploy: echo 'All unit tests passed;
Preparing to deploy Get a Library Card to AWS'
deploy:
- provider: elasticbeanstalk
skip_cleanup: true
access_key_id: "$AWS_ACCESS_KEY_ID_PRODUCTION"
secret_access_key: "$AWS_SECRET_ACCESS_KEY_PRODUCTION"
region: us-east-1
app: nypl-library-card-app
env: nypl-library-card-app-production
bucket_name: elasticbeanstalk-us-east-1-946183545209
bucket_path: nypl-library-card-app-production
on:
repo: NYPL/nypl-library-card-app
branch: production
- provider: elasticbeanstalk
skip_cleanup: true
access_key_id: "$AWS_ACCESS_KEY_ID_PRODUCTION"
secret_access_key: "$AWS_SECRET_ACCESS_KEY_PRODUCTION"
region: us-east-1
app: nypl-library-card-app
env: nypl-library-card-app-qa
bucket_name: elasticbeanstalk-us-east-1-946183545209
bucket_path: nypl-library-card-app-qa
on:
repo: NYPL/nypl-library-card-app
branch: qa
- provider: elasticbeanstalk
skip_cleanup: true
access_key_id: "$AWS_ACCESS_KEY_ID_DEVELOPMENT"
secret_access_key: "$AWS_SECRET_ACCESS_KEY_DEVELOPMENT"
region: us-east-1
app: nypl-library-card-app
env: nypl-library-card-app-development
bucket_name: elasticbeanstalk-us-east-1-224280085904
bucket_path: nypl-library-card-app-development
on:
repo: NYPL/nypl-library-card-app
branch: master
after_deploy: echo 'Successfully executed deploy trigger for Get a Library Card on
AWS'
env:
global:
secure: ZhfM2PS5VxJCdfIUQXwHUPuqgDMklKwFCSPK7qVcirOTmfvkV7LgA+QIiiB/g+1sxVtDwYId8H7qL7ckymJh4WstXzanyT2XkXmJ3d8NqVTgzMSZCmEsPEtmxow4xXQNadIljTIDN0iUp9NGQDrm3EN5Dd23hCttV/VzQzg1xlbdWK3RRBurwXefkqokgA8kawb4u/sjibCiXKgyz8nuscGHn4u9NSCdQNnIq600EmMnznDT8k5Tfojv29qz2+Vs6wEI8LCjZ+e9vYUDMTCAimVquVjDsMll+RgWPlpUasElFtalJybqGQhGgHspPDO7/yk882a9JRgk/iamXv7paKez+HoB1akZwVA7UDu3nZGfQuB/4mB6mN+ZzlZ/GjpVitvvFBu3ns/02DM6eVdCf8rCEm8JetydJ3Y0eIwjMKCN3VMxCyhYNzzvI3qCcK9emIxJOnQoSTUFB6xMAK/IDJs+2kVtzCzLUckjtWzWQFewN7Hz6Gq7sw6uK4TaEeMG495QY18VenXX+SJtyPVmQPhaABxnYjcwJCz1L5M2rUHrWDpXXIxndpefKudmXTFZ/RWU91YmNE87gWb0/fk2GauJLcXjYgr6rw+74R+MfVFTljqK9HB+x+8d0e9yZqo/c27IfnO90lUOvN2fx1uPS5sGLGxmNc+4ss3azubZIWg=
99 changes: 99 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
## CHANGE LOG

### v0.4.16
- Updating @nypl/dgx-header-component to 2.4.15 and checking for QA in APP_ENV.

### v0.4.15
- Updating @nypl/dgx-header-component to 2.4.14 and setting APP_ENV.

### v0.4.14
- Updating @nypl/dgx-header-component to 2.4.13.

### v0.4.13
- Updating @nypl/dgx-header-component to 2.4.12.

### v0.4.12
- Update to use green from Design Toolkit

### v0.4.11
- Updates to form: add radio button, change ptype selection logic from query parameter to radio button
- Copy updates
- Bump Design Toolkit to latest version

### v0.4.10
- Updating @nypl/dgx-react-footer version to 0.5.1 and @nypl/dgx-header-component to 2.4.11.

### v0.4.9
- Updating @nypl/dgx-react-footer version to 0.5.0 and @nypl/dgx-header-component to 2.4.8.

### v0.4.8
#### Updated
- Remove patron information from redirect URL

### v0.4.7
#### Updated
- Add Google Analytics pageview event.

### v0.4.6
#### Updated
- Updated README to reflect new deployment strategies.
#### Added
- Added Travis CI for deployment to AWS Elastic Beanstalk.
- Added CHANGELOG as a separate file.
- Improved CHANGELOG format

### v0.4.5
#### Updated
- Updated the Header component to 2.4.7.
- Added OptinMonster for advocacy 2018.

### v0.4.4
#### Updated
- Updated the Header component to 2.4.5.

### v0.4.3
#### Updated
- Updated the Header component to 2.4.2 and Footer component to 0.4.1.

### v0.4.1
#### Updated
- Updated Header component version to 2.4.0.

### v0.4.1
#### Updated
- Updated header to v2.3.0 -- Includes FundraisingBanner integration

### v0.4.0
#### Added
- Initialized GA.
#### Updated
- Updated header to 2.2.0.

### v0.3.3
#### Updated
- Updated header to 2.1.1.

### v0.3.2
#### Updated
- Updated header to 2.1.0.
- Removed email as a required field.

### v0.3.1

### v0.3.0

### v0.2.1
#### Added
- Added support for NYS agency_type via URL parameter.
#### Updated
- Updated Patron Model to handle default and NYS agency type ID's.

### v0.2.0
#### Added
- Added react-router to the application for handling multiple pages.
- Added tests for <BarcodeContainer- and it's related functions.
- Added related functions for the email validation from server side.
#### Updated
- Updated the client side input field validation to be activated on blur.
- Updated the route for barcode service. It is commented out for current release.
- Updated server side validation, server error messages will be displayed in <ErrorBox- if client side validations fails.
89 changes: 28 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ a patron record.
https://www.nypl.org/library-card/new/

## Version
> 0.4.5
> 0.4.16
| Branch | Status |
|:--------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `master` | [![Build Status](https://travis-ci.org/NYPL/nypl-library-card-app.svg?branch=master)](https://travis-ci.org/NYPL/nypl-library-card-app) |
| `production` | [![Build Status](https://travis-ci.org/NYPL/nypl-library-card-app.svg?branch=production)](https://travis-ci.org/NYPL/nypl-library-card-app) |
| `qa` | [![Build Status](https://travis-ci.org/NYPL/nypl-library-card-app.svg?branch=qa)](https://travis-ci.org/NYPL/nypl-library-card-app) |


## Installation & Configuration

### NVM
### Node Version Manager (nvm)

Developers can use [nvm](https://github.com/creationix/nvm) if they wish.
This repo has a `.nvmrc` file that indicates which node version we development against.
Expand All @@ -23,20 +30,32 @@ For more information see [how `nvm use` works](https://github.com/creationix/nvm
2. `npm install`
3. `npm start` and point browser to http://localhost:3001/library-card/new

### Environtment Variables
### Environment Variables

See `.env.example` for a checklist of the environment variables the app
needs to run.

## Deployment

### Git Strategy
### Git Workflow

Our branches (in order of stability are):

| Branch | Environment | AWS Account |
|:------------|:------------|:----------------|
| master | development | aws-sandbox |
| qa | qa | aws-digital-dev |
| production | production | aws-digital-dev |

### Cutting a feature branch

`master` is stable but bleeding edge. Cut feature branches off of `master`.
Send PRs to be merged into `master`.
1. Feature branches are cut off from `master`
2. Once the feature branch is ready to be merged, file a pull request of the feature branch _into_ `master`.

`master` ==gets merged to==> `qa` ==gets merged into==> `production`.

The `master` branch should be what's running in the Development environment.

The `qa` branch should be what's running in the QA environment.
The `production` branch should be what's running in the production environment.

Expand All @@ -63,60 +82,8 @@ eb create <<environment name>> --instance_type <<size of instance>> \
--profile <<your AWS profile>>
```
6. Subsequent deployment
`eb deploy <<environment name>> --profile <<your AWS profile>>`
## Changelog
### v0.4.5
> Updated the Header component to 2.4.7.
> Added OptinMonster for advocacy 2018.
### v0.4.4
> Updated the Header component to 2.4.5.
### v0.4.3
> Updated the Header component to 2.4.2 and Footer component to 0.4.1.
### v0.4.1
#### Updated
> Updated Header component version to 2.4.0.
### v0.4.1
#### Updated
> Updated header to v2.3.0 -- Includes FundraisingBanner integration
### v0.4.0
#### Added
> Initialized GA.
#### Updated
> Updated header to 2.2.0.
### v0.3.3
#### Updated
> Updated header to 2.1.1.
### v0.3.2
#### Updated
> Updated header to 2.1.0.
> Removed email as a required field.
### v0.3.1
### v0.3.0
### Travis CI
### v0.2.1
#### Added
> Added support for NYS agency_type via URL parameter.
#### Updated
> Updated Patron Model to handle default and NYS agency type ID's.
Subsequent deployments are accomplished via pushing code into `qa` and `production` branches, which triggers Travis CI to build, test, and deploy.
### v0.2.0
#### Added
> Added react-router to the application for handling multiple pages.
> Added tests for <BarcodeContainer> and it's related functions.
> Added related functions for the email validation from server side.
#### Updated
> Updated the client side input field validation to be activated on blur.
> Updated the route for barcode service. It is commented out for current release.
> Updated server side validation, server error messages will be displayed in <ErrorBox> if client side validations fails.
Configuration can be adjusted via `.travis.yml`, located at the root directory of this code repository. Travis CI is set to watch `qa` and `production` branches and waits for code push, e.g. `git push origin qa` will trigger Travis CI to build. When build and test are successful, Travis CI will deploy to specified Elastic Beanstalk instance.
4 changes: 2 additions & 2 deletions appConfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
appTitle: 'Library Card Application Form | NYPL',
appName: 'NYPL Library Card App',
favIconPath: '//d2znry4lg8s0tq.cloudfront.net/images/favicon.ico',
favIconPath: '//www.nypl.org/images/favicon.ico',
port: 3001,
webpackDevServerPort: 3000,
api: {
Expand All @@ -17,6 +17,6 @@ export default {
},
scopes: 'account:write account:read',
confirmationURL: {
base: 'https://www.nypl.org/get-help/library-card/confirmation',
base: process.env.CONFIRMATION_URL || 'https://www.nypl.org/get-help/library-card/confirmation',
},
};
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nypl-library-card-app",
"version": "0.4.5",
"version": "0.4.16",
"description": "NYPL Get A Library Card App",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -48,17 +48,16 @@
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "4.0.0",
"eslint-plugin-react": "6.10.3",
"react-hot-loader": "3.0.0-beta.6",
"webpack-dev-server": "1.14.1",
"mocha": "3.2.0",
"chai": "3.5.0",
"enzyme": "2.8.2",
"sinon": "1.17.6"
"sinon": "1.17.6",
"react-addons-test-utils": "15.6.0"
},
"dependencies": {
"@nypl/design-toolkit": "0.1.13",
"@nypl/dgx-header-component": "2.4.7",
"@nypl/dgx-react-footer": "0.4.1",
"@nypl/design-toolkit": "0.1.36",
"@nypl/dgx-header-component": "2.4.15",
"@nypl/dgx-react-footer": "0.5.1",
"axios": "0.15.3",
"babel-core": "6.24.0",
"babel-loader": "6.4.1",
Expand All @@ -81,18 +80,20 @@
"helmet": "3.5.0",
"history": "1.15.0",
"lodash": "4.17.4",
"moment": "2.18.1",
"moment": "2.19.3",
"node-sass": "3.8.0",
"prop-types": "^15.5.10",
"qs": "6.4.0",
"react": "15.5.4",
"react-dom": "15.5.4",
"react-hot-loader": "3.0.0-beta.6",
"react-router": "2.4.0",
"sass-loader": "4.0.2",
"style-loader": "0.13.1",
"underscore": "1.8.3",
"validator": "7.0.0",
"webpack": "1.13.2",
"webpack-dev-server": "1.14.1",
"winston": "2.3.1"
}
}
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ if (!isProduction) {
}
;
});
}
}
2 changes: 2 additions & 0 deletions src/client/client.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ window.onload = () => {
gaUtils.initialize(config.google.code(isProd), gaOpts);
}

gaUtils.trackPageview(window.location.pathname);

render(
<ApplicationContainer />,
document.getElementById('nypl-library-card-app'),
Expand Down
5 changes: 5 additions & 0 deletions src/client/styles/components/_libCardForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@
border-bottom: .125rem solid #97272c;
box-shadow: none;
}

.nypl-address-note {
border-left: 0.5rem solid #008918;
padding-left: 0.5rem;
}
1 change: 1 addition & 0 deletions src/server/routes/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default function renderApp(req, res) {
isProduction,
appTitle: config.appTitle,
favicon: config.favIconPath,
confirmationURL: config.confirmationURL.base,
csrfToken,
});
}
Loading

0 comments on commit 073bdc3

Please sign in to comment.