Skip to content

Commit

Permalink
Merge pull request #4447 from flexion/10007-story
Browse files Browse the repository at this point in the history
10007 story
  • Loading branch information
jimlerza authored Mar 12, 2024
2 parents 0b5642b + 898675a commit 0751c48
Show file tree
Hide file tree
Showing 632 changed files with 14,986 additions and 30,533 deletions.
184 changes: 115 additions & 69 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,43 +143,43 @@ jobs:
name: Setup Elasticsearch Index Settings
command: |
./web-api/setup-elasticsearch-index.sh $ENV
- run:
name: Admin User Setup
command: |
if [ "${CIRCLE_BRANCH}" != "prod" ] && [ "$DEPLOY_EMPTY_PERSISTENCE" != "true" ]; then
npx ts-node --transpile-only scripts/user/setup-admin.ts
else
echo "skipping…"
fi
- run:
name: Test Users Setup
command: |
if [ "${CIRCLE_BRANCH}" != "prod" ] && [ "$DEPLOY_EMPTY_PERSISTENCE" != "true" ]; then
./scripts/user/setup-test-users.sh $ENV
else
echo "skipping…"
fi
- run:
name: Judge Users Setup
environment:
FILE_NAME: ./scripts/circleci/judge/judge_users.csv
command: |
if [ "${CIRCLE_BRANCH}" == "prod" ] || [ "$DEPLOY_EMPTY_PERSISTENCE" == "true" ]; then
echo "skipping…"
exit 0
fi
if [ "${CIRCLE_BRANCH}" == "test" ]; then
SOURCE_DOMAIN=$(./scripts/elasticsearch/get-source-elasticsearch.sh "${ENV}")
ELASTICSEARCH_ENDPOINT=$(aws es describe-elasticsearch-domain \
--domain-name "${SOURCE_DOMAIN}" \
--region "us-east-1" \
--query 'DomainStatus.Endpoint' \
--output text)
export ELASTICSEARCH_ENDPOINT="$ELASTICSEARCH_ENDPOINT"
npx ts-node --transpile-only ./scripts/user/setup-glued-judges.ts
else
./scripts/circleci/judge/bulk-import-judge-users.sh
fi
# - run: TODO 10007 Cleanup: Put this step back after 10007 has been deployed
# name: Admin User Setup
# command: |
# if [ "${CIRCLE_BRANCH}" != "prod" ] && [ "$DEPLOY_EMPTY_PERSISTENCE" != "true" ]; then
# npx ts-node --transpile-only scripts/user/setup-admin.ts
# else
# echo "skipping…"
# fi
# - run:
# name: Test Users Setup
# command: |
# if [ "${CIRCLE_BRANCH}" != "prod" ] && [ "$DEPLOY_EMPTY_PERSISTENCE" != "true" ]; then
# ./scripts/user/setup-test-users.sh $ENV
# else
# echo "skipping…"
# fi
# - run:
# name: Judge Users Setup
# environment:
# FILE_NAME: ./scripts/circleci/judge/judge_users.csv
# command: |
# if [ "${CIRCLE_BRANCH}" == "prod" ] || [ "$DEPLOY_EMPTY_PERSISTENCE" == "true" ]; then
# echo "skipping…"
# exit 0
# fi
# if [ "${CIRCLE_BRANCH}" == "test" ]; then
# SOURCE_DOMAIN=$(./scripts/elasticsearch/get-source-elasticsearch.sh "${ENV}")
# ELASTICSEARCH_ENDPOINT=$(aws es describe-elasticsearch-domain \
# --domain-name "${SOURCE_DOMAIN}" \
# --region "us-east-1" \
# --query 'DomainStatus.Endpoint' \
# --output text)
# export ELASTICSEARCH_ENDPOINT="$ELASTICSEARCH_ENDPOINT"
# npx ts-node --transpile-only ./scripts/user/setup-glued-judges.ts
# else
# ./scripts/circleci/judge/bulk-import-judge-users.sh
# fi
- run:
name: 'Deploy - Web Client - S3'
command: |
Expand All @@ -188,10 +188,6 @@ jobs:
name: 'Deploy - Public Web Client - S3'
command: |
./web-client/deploy-public.sh
- run:
name: 'Deploy - Web API - Cognito Customize'
command: |
cd web-api && ./setup-cognito-ui.sh $ENV
- run:
name: 'Deploy - Authorizer Smoke Tests'
command: |
Expand Down Expand Up @@ -358,15 +354,12 @@ jobs:
name: Setup Env
command: |
./scripts/env/env-for-circle.sh
- run:
name: 'Disable Maintenance Mode'
command: npm run maintenance:disengage $ENV
# - run: TODO 10007 Cleanup: Put this step back after 10007 has been deployed
# name: 'Disable Maintenance Mode'
# command: npm run maintenance:disengage $ENV
- run:
name: 'Cypress Smoke Tests'
command: npm run cypress:smoketests
- run:
name: 'Pa11y Smoke Tests'
command: npm run test:pa11y:smoketests
- store_artifacts:
path: /root/project/cypress/cypress-smoketests/videos/

Expand Down Expand Up @@ -868,6 +861,42 @@ jobs:
command: |
npm run destroy:glue-cron -- $ENV
engage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/prod
docker:
- image: *efcms-docker-image
aws_auth:
aws_access_key_id: $AWS_ACCESS_KEY_ID
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY
resource_class: medium
steps:
- git-shallow-clone/checkout
- npm-install
- run:
name: Setup Env
command: |
./scripts/env/env-for-circle.sh
- run:
name: 'Engage Maintenance Mode'
command: npm run maintenance:engage $ENV

disengage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/prod
docker:
- image: *efcms-docker-image
aws_auth:
aws_access_key_id: $AWS_ACCESS_KEY_ID
aws_secret_access_key: $AWS_SECRET_ACCESS_KEY
resource_class: medium
steps:
- git-shallow-clone/checkout
- npm-install
- run:
name: Setup Env
command: |
./scripts/env/env-for-circle.sh
- run:
name: 'Disengage Maintenance Mode'
command: npm run maintenance:disengage $ENV

only-prod: &only-prod
context: efcms-<< pipeline.git.branch >>
filters:
Expand Down Expand Up @@ -902,8 +931,12 @@ workflows:
build-and-deploy:
when: << pipeline.parameters.run_build_and_deploy >>
jobs:
- engage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/dev
<<: *only-deployed-lower-environments
- deploy:
<<: *only-deployed-lower-environments
requires:
- engage-maintenance-mode
- migrate:
<<: *only-deployed-lower-environments
requires:
Expand All @@ -926,22 +959,22 @@ workflows:
<<: *only-deployed-lower-environments
requires:
- wait-for-reindex
- smoketests:
<<: *only-deployed-lower-environments
requires:
- disable-reindex-cron
- loadtests:
<<: *only-deployed-lower-environments
requires:
- smoketests
- smoketests-readonly:
<<: *only-deployed-lower-environments
requires:
- loadtests
# - smoketests: # TODO 10007 Cleanup: Add back running readonly smoketests after 10007 has been deployed
# <<: *only-deployed-lower-environments
# requires:
# - disable-reindex-cron
# - loadtests:
# <<: *only-deployed-lower-environments
# requires:
# - disable-reindex-cron
# - smoketests-readonly: # TODO 10007 Cleanup: Add back running readonly smoketests after 10007 has been deployed to ustc/prod
# <<: *only-deployed-lower-environments
# requires:
# - loadtests
- switch-colors:
<<: *only-deployed-lower-environments
requires:
- smoketests-readonly
- disable-reindex-cron
- delete-api-mappings:
<<: *only-deployed-lower-environments
requires:
Expand All @@ -950,12 +983,21 @@ workflows:
<<: *only-deployed-lower-environments
requires:
- switch-colors
- disengage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/dev
<<: *only-deployed-lower-environments
requires:
- cleanup
- delete-api-mappings

build-and-deploy-with-context:
when: << pipeline.parameters.run_build_and_deploy_with_context >>
jobs:
- engage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/prod
<<: *only-prod
- deploy:
<<: *only-prod
requires:
- engage-maintenance-mode
- migrate:
<<: *only-prod
requires:
Expand All @@ -978,18 +1020,18 @@ workflows:
<<: *only-prod
requires:
- wait-for-reindex
- loadtests:
<<: *only-prod
requires:
- disable-reindex-cron
- smoketests-readonly:
<<: *only-prod
requires:
- loadtests
# - loadtests: # TODO 10007 Cleanup: Add back running loadtests after 10007 has been deployed to ustc/prod
# <<: *only-prod
# requires:
# - disable-reindex-cron
# - smoketests-readonly: # TODO 10007 Cleanup: Add back running readonly smoketests after 10007 has been deployed to ustc/prod
# <<: *only-prod
# requires:
# - loadtests
- deploy-switch-colors-cron:
<<: *only-prod
requires:
- smoketests-readonly
- disable-reindex-cron
- wait-for-switch:
<<: *only-prod
type: approval
Expand All @@ -1016,6 +1058,10 @@ workflows:
requires:
- backup-source-dynamo-table
- delete-api-mappings
- disengage-maintenance-mode: # TODO 10007 Cleanup: Remove after 10007 has been deployed to ustc/prod
<<: *only-prod
requires:
- cleanup

build-and-deploy-empty:
when: << pipeline.parameters.run_build_and_deploy_empty >>
Expand Down
8 changes: 2 additions & 6 deletions .cognito/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
"secretAccessKey": "local"
},
"region": "local",
"endpoint": "http://localhost:9997"
"endpoint": "http://localhost:3011"
},
"TokenConfig": {
"IssuerDomain": "http://localhost:9229"
},
"TriggerFunctions": {
"PostConfirmation": "cognito-triggers-sls-dev-PostConfirmation_ConfirmSignUp",
"PostAuthentication": "cognito-triggers-sls-dev-PostAuthentication_Authentication"
},
"LambdaConfig": {
"endpoint": "http://localhost:9997"
"endpoint": "http://localhost:3011"
},
"UserPoolDefaults": {
"UsernameAttributes": ["email"],
Expand Down
Loading

0 comments on commit 0751c48

Please sign in to comment.