Skip to content

Commit

Permalink
Merge pull request #313 from ustaxcourt/support-prod-branch-with-ci-c…
Browse files Browse the repository at this point in the history
…ontext

Build the new production environment using CircleCI contexts on the prod branch.
  • Loading branch information
adunkman authored Jul 24, 2020
2 parents 4dac1fb + fa48854 commit 65736df
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 37 deletions.
86 changes: 54 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,21 @@ jobs:
- store_artifacts:
path: /home/app/cypress-smoketests/videos/


build-and-deploy-defaults: &build-and-deploy-defaults
filters:
branches:
ignore:
- develop # run hourly below
- prod # run with context workflow below

build-and-deploy-with-context-defaults: &build-and-deploy-with-context-defaults
context: efcms-<< pipeline.git.branch >>
filters:
branches:
only:
- prod

workflows:
version: 2
hourly:
Expand Down Expand Up @@ -515,41 +530,21 @@ workflows:
build-and-deploy:
jobs:
- build-shared:
filters:
branches:
ignore:
- develop
<<: *build-and-deploy-defaults
- build-api:
filters:
branches:
ignore:
- develop
<<: *build-and-deploy-defaults
- build-client-unit:
filters:
branches:
ignore:
- develop
<<: *build-and-deploy-defaults
- build-client-integration:
filters:
branches:
ignore:
- develop
<<: *build-and-deploy-defaults
- e2e-pa11y:
filters:
branches:
ignore:
- develop
<<: *build-and-deploy-defaults
- e2e-cypress:
filters:
branches:
ignore:
- develop
<<: *build-and-deploy-defaults
- e2e-cypress-public:
filters:
branches:
ignore:
- develop
<<: *build-and-deploy-defaults
- build-client-coverage:
<<: *build-and-deploy-defaults
requires:
- build-shared
- build-api
Expand All @@ -558,10 +553,6 @@ workflows:
- e2e-pa11y
- e2e-cypress
- e2e-cypress-public
filters:
branches:
ignore:
- develop
- deploy:
requires:
- build-client-coverage
Expand All @@ -575,3 +566,34 @@ workflows:
- master
- experimental1
- experimental2

build-and-deploy-with-context:
jobs:
- build-shared:
<<: *build-and-deploy-with-context-defaults
- build-api:
<<: *build-and-deploy-with-context-defaults
- build-client-unit:
<<: *build-and-deploy-with-context-defaults
- build-client-integration:
<<: *build-and-deploy-with-context-defaults
- e2e-pa11y:
<<: *build-and-deploy-with-context-defaults
- e2e-cypress:
<<: *build-and-deploy-with-context-defaults
- e2e-cypress-public:
<<: *build-and-deploy-with-context-defaults
- build-client-coverage:
<<: *build-and-deploy-with-context-defaults
requires:
- build-shared
- build-api
- build-client-unit
- build-client-integration
- e2e-pa11y
- e2e-cypress
- e2e-cypress-public
- deploy:
<<: *build-and-deploy-with-context-defaults
requires:
- build-client-coverage
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The [U.S. Tax Court](https://ustaxcourt.gov/) currently uses a non-web-based leg

#### develop

| develop | master | staging | test |
| develop | prod | staging | test |
| ------- | ------ | ------- | ---- |
| [![CircleCI](https://circleci.com/gh/flexion/ef-cms/tree/develop.svg?style=svg)](https://circleci.com/gh/flexion/ef-cms/tree/develop) | [![CircleCI](https://circleci.com/gh/ustaxcourt/ef-cms/tree/master.svg?style=svg)](https://circleci.com/gh/ustaxcourt/ef-cms/tree/master) | [![CircleCI](https://circleci.com/gh/ustaxcourt/ef-cms/tree/staging.svg?style=svg)](https://circleci.com/gh/ustaxcourt/ef-cms/tree/staging) | [![CircleCI](https://circleci.com/gh/ustaxcourt/ef-cms/tree/test.svg?style=svg)](https://circleci.com/gh/ustaxcourt/ef-cms/tree/test) |
| [![CircleCI](https://circleci.com/gh/flexion/ef-cms/tree/develop.svg?style=svg)](https://circleci.com/gh/flexion/ef-cms/tree/develop) | [![CircleCI](https://circleci.com/gh/ustaxcourt/ef-cms/tree/prod.svg?style=svg)](https://circleci.com/gh/ustaxcourt/ef-cms/tree/prod) | [![CircleCI](https://circleci.com/gh/ustaxcourt/ef-cms/tree/staging.svg?style=svg)](https://circleci.com/gh/ustaxcourt/ef-cms/tree/staging) | [![CircleCI](https://circleci.com/gh/ustaxcourt/ef-cms/tree/test.svg?style=svg)](https://circleci.com/gh/ustaxcourt/ef-cms/tree/test) |

API | Front-End | Shared Code
--- | --------- | -----------
Expand Down
2 changes: 1 addition & 1 deletion docs/environments/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ A prerequisite for a successful build within CircleCI is [access to CircleCI’s

EF-CMS currently has both the concept of a deployment at a domain as well as a named environment (stg, mig, prod, test). This section refers to the latter.

1. Choose a name for the branch which will be used for deployments (henceforth `$BRANCH`). Examples are 'master', 'develop', 'staging'.
1. Choose a name for the branch which will be used for deployments (henceforth `$BRANCH`). Examples are 'prod', 'develop', 'staging'.
2. Choose a name for this environment (henceforth `$ENVIRONMENT`). Examples are 'prod', 'dev', 'stg'.
3. Add CircleCI badge link to the README.md according to `$BRANCH`
4. Edit `get-es-instance-count.sh`, adding a new `elif` statement for your `$BRANCH` which returns the appropriate number of ElasticSearch instances.
Expand Down
2 changes: 2 additions & 0 deletions get-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ elif [[ $BRANCH == 'staging' ]] ; then
echo 'stg'
elif [[ $BRANCH == 'master' ]] ; then
echo 'prod'
elif [[ $BRANCH == 'prod' ]] ; then
echo 'prod'
else
exit 1;
fi
2 changes: 2 additions & 0 deletions get-es-instance-count.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ elif [[ $BRANCH == 'migration' ]] ; then
echo "1"
elif [[ $BRANCH == 'master' ]] ; then
echo "2"
elif [[ $BRANCH == 'prod' ]] ; then
echo "2"
else
exit 1;
fi
2 changes: 2 additions & 0 deletions get-honeybadger-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ elif [[ $BRANCH == 'experimental1' ]] ; then
echo ""
elif [[ $BRANCH == 'master' ]] ; then
echo ""
elif [[ $BRANCH == 'prod' ]] ; then
echo ""
elif [[ $BRANCH == 'staging' ]] ; then
echo "${CIRCLE_HONEYBADGER_API_KEY_STG}"
elif [[ $BRANCH == 'test' ]] ; then
Expand Down
2 changes: 2 additions & 0 deletions get-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ elif [[ $BRANCH == 'irs' ]] ; then
echo "${DYNAMSOFT_PRODUCT_KEYS_IRS}"
elif [[ $BRANCH == 'master' ]] ; then
echo "${DYNAMSOFT_PRODUCT_KEYS_PROD}"
elif [[ $BRANCH == 'prod' ]] ; then
echo "${DYNAMSOFT_PRODUCT_KEYS_PROD}"
elif [[ $BRANCH == 'staging' ]] ; then
echo "${DYNAMSOFT_PRODUCT_KEYS_STG}"
elif [[ $BRANCH == 'test' ]] ; then
Expand Down
4 changes: 2 additions & 2 deletions web-client/src/views/Accessibility/AccessibilityStatement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ export const AccessibilityStatement = () => (
</p>
<ul className="usa-list technical-information related-evidence-other">
<li>
<a href="https://github.com/ustaxcourt/ef-cms/tree/master/docs">
https://github.com/ustaxcourt/ef-cms/tree/master/docs
<a href="https://github.com/ustaxcourt/ef-cms/tree/prod/docs">
https://github.com/ustaxcourt/ef-cms/tree/prod/docs
</a>
</li>
</ul>
Expand Down

0 comments on commit 65736df

Please sign in to comment.