src/
components/
constants/
containers/
state/
styles/
To run this application in development, run $ ./gradlew start
. This will start webpack-dev-server
, running by default
on the port specified in webpack/constants.js
. To view, visit http://localhost:{PORT}
. Webpack-dev-server will watch all relevant project files, and reload the browser
automatically when those files change.
Env var | Default | Options |
---|---|---|
DEPLOYMENT_ENV |
dev | "dev", "staging", "production" |
Differences in builds by environment:
Target | Sources Maps | Uglification | NODE_ENV === 'production' |
---|---|---|---|
dev | true | false | false |
staging | true | false | false |
production | false | true | true |
Once built, Webpack outputs (e.g., index.html, JS and CSS files) are put into a tar archive, gzipped, and stored in
Artifactory in the maven-snapshot-local
repo. From there, deployments involve: a) pulling a particular artifact (referenced by git tag) out of Artifactory
and b) copying the contents of the artifact to an S3 website bucket. For both staging and production deployments, these
steps are captured in this project's Jenkinsfile and can be executed by setting the proper parameters for the Jenkins build.
The build/deploy process depends on two S3 website buckets existing for this project: one for staging deployments and one for production deployments. In addition, a Cloudfront distribution should be created that sits in front of the production bucket; the Cloudfront distribution will provide both caching and HTTPS. To provision this infrastructure for any new development, talk to the Software team.
Once in place, the Jenkinsfile
will need to be updated with references to the S3 buckets, and scripts/bust-cloudfront-cache.sh
will need to be updated with a
reference to the Cloudfront distribution.
From the Jenkins UI:
- Go to this project's
master
branch pipeline page. - Select "Build with Parameters" on the left-hand-side navigation menu.
- Under the "JOB_TYPE" dropdown, select "DEPLOY_ARTIFACT".
- Under the "DEPLOYMENT_TYPE" dropdown, select "staging".
- In the "GIT_TAG" selectbox, select the tag of the artifact you want to deploy. By default, the selectbox will have the most recent artifact selected by default.
- Hit "Build"
Note: The final step require the AWS CLI as well as permissions on AWS to run a Cloudfront invalidation. See https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html for details on installing the AWS CLI.
From the Jenkins UI:
- Go to this project's
master
branch pipeline page. - Select "Build with Parameters" on the left-hand-side navigation menu.
- Under the "JOB_TYPE" dropdown, select "PROMOTE_ARTIFACT".
- Ignore the "DEPLOYMENT_TYPE" dropdown for now.
- In the "GIT_TAG" selectbox, select the tag of the artifact you want to deploy.
- Hit "Build".
- Once the artifact promotion job has finished, return to the "Build with Parameters" page.
- Under the "JOB_TYPE" dropdown, select "DEPLOY_ARTIFACT".
- Under the "DEPLOYMENT_TYPE" dropdown, select "production".
- In the "GIT_TAG" selectbox, select the tag of the artifact that you just promoted.
- Hit "Build".
- Run the script "bust-cloudfront-cache.sh" found in this repo's
scripts
directory. That will ensure Cloudfront is serving the newly deployed artifacts.